bbernhard / signal-cli-rest-api

Dockerized Signal Messenger REST API
https://bbernhard.github.io/signal-cli-rest-api/
MIT License
1.19k stars 144 forks source link

Exception on message received: org.signal.libsignal.protocol.NoSessionException: missing sender key state for distribution ID #514

Open continue47 opened 3 months ago

continue47 commented 3 months ago

The problem

{
  exception: {
    message: 'org.signal.libsignal.protocol.NoSessionException: missing sender key state for distribution ID 96839a83-c7f4-46dd-b0cf-60f1c96a7437',
    type: 'ProtocolNoSessionException'
  },
  envelope: {
    source: 'REDACTED',
    sourceNumber: null,
    sourceUuid: 'REDACTED',
    sourceName: 'Eduard',
    sourceDevice: 1,
    timestamp: 1712416714163
  },
  account: 'REDACTED'
}

This is the output when receiving a message in a group from a specific user only, while messages from other users work fine, with no exception.

I'm running signal-cli-rest-api in in docker with docker compose, and the user is on the latest version of signal on android.

version: "3"
services:
  signal-cli-rest-api:
    image: bbernhard/signal-cli-rest-api:latest
    environment:
      - MODE=json-rpc #supported modes: json-rpc, native, normal
      #- AUTO_RECEIVE_SCHEDULE=0 22 * * * #enable this parameter on demand (see description below)
    ports:
      - "8081:8080" 
    volumes:
      - "./signal-cli-config:/home/.local/share/signal-cli" #map "signal-cli-config" folder on host system into docker container. the folder contains the password and cryptographic keys when a new number is registered

Are you using the latest released version?

Have you read the troubleshooting page?

What type of installation are you running?

signal-cli-rest-api Docker Container

In which mode are you using the docker container?

JSON-RPC Mode

What's the architecture of your host system?

x86-64

Additional information

No response

bbernhard commented 3 months ago

Do you see the same error also in other (e.g normal) modes?

bbernhard commented 3 months ago

might also be related: https://github.com/signalapp/Signal-Desktop/issues/5849#issuecomment-1182010332

continue47 commented 3 months ago

Do you see the same error also in other (e.g normal) modes?

I will test this when the person whose messages are giving the errors is available for this.

might also be related: signalapp/Signal-Desktop#5849 (comment)

Thanks! I'm checking it out.

continue47 commented 3 months ago

[...] Signal clients will request message retries in this case. 169 of your 246 errors were successfully retried, leaving 77 messages as Delivery Issue in your conversations. For those messages, the sending devices perhaps weren't online when they needed to be for the retry.

Are you familiar with this retry mechanism mentioned in the post you linked? Do you know if I need to call a certain endpoint to trigger these retries?

bbernhard commented 3 months ago

I think this might be done automatically - at least I am not aware of any retry mechanism (in json-rpc mode). I would also expect that those errors only happen rarely, given that the all the people that you are sending the message to use Signal on a semi regular basis.