bbernhard / signal-cli-rest-api

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

Not receiving messages in json-rpc mode with 0.86 #572

Closed ralphou closed 1 month ago

ralphou commented 1 month ago

The problem

I'm using json-rpc mode and receiving messages in Node-RED using websocket, with the following address: ws://1315902c-signal-messenger:8080/v1/receive/XXXXXXXXXX

Also sending messages from Node-RED at http://1315902c-signal-messenger:8080/v2/send

Everything works very well in 0.85.

After updating to 0.86, messages are still being sent successfully, but Node-RED stops receiving messages, either after a few seconds or after the first message.

I realize this isn't much information to go on, but I'm not sure what to look at to help diagnose the issue. Let me know. In the meantime, I've just rolled back to 0.85.

Are you using the latest released version?

Have you read the troubleshooting page?

What type of installation are you running?

Home Assistant Signal Addon

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

zutewas commented 1 month ago

Same problem in my environment like by ralphou. I see no errors in log of Node-RED or Docker. Sending messages works fine but receive doesn't work with JSON-RPC Mode.

Can I set a log level to get more information?

bbernhard commented 1 month ago

Does it work without Node-RED? So, if you e.g use wscat to receive the messages?

zutewas commented 1 month ago

wscat -c ws://serv.local:8170/v1/receive/xxxxxx I get only the info "Connected". No info about receive messages.

In signal app I see that message is delivered grafik but the web socket give no information about processing (in Node-RED and wscat).

bbernhard commented 1 month ago

Please switch to the debug mode with curl -X POST -H "Content-Type: application/json" -d '{"logging": {"level": "debug"}}' 'http://127.0.0.1:8080/v1/configuration' for additional output

(the debug mode is reset once the container gets restarted)

benjy3gg commented 1 month ago

same problem here:

"json-rpc received data: {\"jsonrpc\":\"2.0\",\"method\":\"receive\",\"params\":{\"envelope\":{\"source\":\"xxxx-xxxx-xxxx-xxxx-xxxx\",\"sourceNumber\":null,\"sourceUuid\":\"xxx-xxxxx-xxxx-xxxxx-xxxxxx\",\"sourceName\":\"xxx xxxx\",\"sourceDevice\":1,\"timestamp\":1723035630501,\"dataMessage\":{\"timestamp\":1723035630501,\"message\":\"Test\",\"expiresInSeconds\":0,\"viewOnce\":false}},\"account\":\"+xxxxxx\"}}\n" time="2024-08-07T13:00:31Z" level=debug msg="Message sent to golang channel" time="2024-08-07T13:00:31Z" level=debug msg="Couldn't send message to golang channel, as there's no receiver"

bbernhard commented 1 month ago

Could you please give this version a try: bbernhard/signal-cli-rest-api:0.165-dev

benjy3gg commented 1 month ago

recieving messages again thanks

zutewas commented 1 month ago

Could you please give this version a try: bbernhard/signal-cli-rest-api:0.165-dev

This works for me.

zutewas commented 1 month ago

Perhaps it is only in my env but the problem exists again with bbernhard/signal-cli-rest-api:0.165-dev. I restart the container and the first 1-2 receives works. After a undefined time it stop to work.

bbernhard commented 1 month ago

Unfortunately I can't reproduce the issue anymore. Anything special you are doing?

btxshark1 commented 1 month ago

Am also still having this issue with 0.87 tl;dr - works for a short while and then silently stalls out. Doesn't seem to be related to number of messages or time elapsed.

More background in the linked issue above if it helps.

sigBot-backend  | [GIN] 2024/08/09 - 16:57:56 | 204 |     258.379µs |       127.0.0.1 | POST     "/v1/configuration"
sigBot-backend  | time="2024-08-09T16:58:02Z" level=debug msg="json-rpc received data: {\"jsonrpc\":\"2.0\",\"method\":\"receive\",\"params\":{\"envelope\":{\"source\":\"<myNumber>\",\"sourceNumber\":\"<myNumber>\",\"sourceUuid\":\"\",\"sourceName\":\"\",\"sourceDevice\":3,\"imestamp\":1723222682698,\"typingMessage\":{\"action\":\"STARTED\",\"timestamp\":1723222682698,\"groupId\":\"kWIoF+/ywRwOF4gluzFjkz6WaeyZKzaGZQuQZ3Er0HI=\"}},\"account\":\"<botNumber>\"}}\n"
sigBot-backend  | time="2024-08-09T16:58:02Z" level=debug msg="Message sent to golang channel"
sigBot-backend  | time="2024-08-09T16:58:06Z" level=debug msg="json-rpc received data: {\"jsonrpc\":\"2.0\",\"method\":\"receive\",\"params\":{\"envelope\":{\"source\":\"<myNumber>\",\"sourceNumber\":\"<myNumber>\",\"sourceUuid\":\"\",\"sourceName\":\"\",\"sourceDevice\":3,\"imestamp\":1723222686174,\"dataMessage\":{\"timestamp\":1723222686174,\"message\":\"!hep\",\"expiresInSeconds\":300,\"viewOnce\":false,\"groupInfo\":{\"groupId\":\"\",\"type\":\"DELIVER\"}}},\"account\":\"<botNumber>\"}}\n"
sigBot-backend  | time="2024-08-09T16:58:06Z" level=debug msg="Couldn't send message to golang channel, as there's no receiver"

Unrelated, but looks like a typo in the debug output \"imestamp\":1723222682698

bbernhard commented 1 month ago

Please try bbernhard/signal-cli-rest-api:0.166-dev (which should be available in a few minutes)

btxshark1 commented 1 month ago

Looking good so far.

sigBot-backend  | + exec setpriv --reuid=1000 --regid=1000 --init-groups --inh-caps=-cap_0,-cap_1,-cap_2,-cap_3,-cap_4,-cap_5,-cap_6,-cap_7,-cap_8,-cap_9,-cap_10,-cap_11,-cap_12,-cap_13,-cap_14,-cap_15,-cap_16,-cap_17,-cap_18,-cap_19,-cap_20,-cap_21,-cap_22,-cap_23,-cap_24,-cap_25,-cap_26,-cap_27,-cap_28,-cap_29,-cap_30,-cap_31,-cap_32,-cap_33,-cap_34,-cap_35,-cap_36,-cap_37,-cap_38,-cap_39,-cap_40 signal-cli-rest-api -signal-cli-config=/home/.local/share/signal-cli
sigBot-backend  | time="2024-08-09T22:21:24Z" level=info msg="Started Signal Messenger REST API"
sigBot-backend  | [GIN] 2024/08/09 - 22:21:43 | 200 |   83.037813ms |     172.19.0.18 | GET      "/v1/groups/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:21:49 | 204 |  384.392213ms |     172.19.0.18 | POST     "/v1/reactions/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:21:49 | 204 |  128.256078ms |     172.19.0.18 | PUT      "/v1/typing-indicator/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:21:50 | 204 |   95.475984ms |     172.19.0.18 | DELETE   "/v1/typing-indicator/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:21:50 | 201 |  184.570414ms |     172.19.0.18 | POST     "/v2/send"
sigBot-backend  | [GIN] 2024/08/09 - 22:21:51 | 204 |    98.59154ms |     172.19.0.18 | POST     "/v1/reactions/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:21:56 | 204 |   125.77705ms |     172.19.0.18 | POST     "/v1/reactions/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:21:56 | 204 |  134.418457ms |     172.19.0.18 | PUT      "/v1/typing-indicator/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:21:56 | 201 |  117.907145ms |     172.19.0.18 | POST     "/v2/send"
sigBot-backend  | [GIN] 2024/08/09 - 22:21:56 | 204 |  130.393636ms |     172.19.0.18 | DELETE   "/v1/typing-indicator/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:21:57 | 204 |  113.510599ms |     172.19.0.18 | POST     "/v1/reactions/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:22:30 | 204 |  129.047026ms |     172.19.0.18 | POST     "/v1/reactions/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:22:30 | 204 |  127.821478ms |     172.19.0.18 | PUT      "/v1/typing-indicator/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:22:32 | 204 |  134.471598ms |     172.19.0.18 | DELETE   "/v1/typing-indicator/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:22:35 | 201 |  119.305173ms |     172.19.0.18 | POST     "/v2/send"
sigBot-backend  | [GIN] 2024/08/09 - 22:22:36 | 204 |   95.563188ms |     172.19.0.18 | POST     "/v1/reactions/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:24:02 | 204 |  167.245554ms |     172.19.0.18 | POST     "/v1/reactions/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:24:02 | 204 |  136.282811ms |     172.19.0.18 | PUT      "/v1/typing-indicator/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:24:04 | 201 |  1.299137348s |     172.19.0.18 | POST     "/v2/send"
sigBot-backend  | [GIN] 2024/08/09 - 22:24:04 | 204 |  115.824571ms |     172.19.0.18 | DELETE   "/v1/typing-indicator/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:24:05 | 204 |   97.213075ms |     172.19.0.18 | POST     "/v1/reactions/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:24:10 | 204 |  145.662872ms |     172.19.0.18 | POST     "/v1/reactions/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:24:10 | 204 |  133.340487ms |     172.19.0.18 | PUT      "/v1/typing-indicator/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:24:12 | 201 |  106.868657ms |     172.19.0.18 | POST     "/v2/send"
sigBot-backend  | [GIN] 2024/08/09 - 22:24:12 | 204 |  133.442339ms |     172.19.0.18 | DELETE   "/v1/typing-indicator/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:24:13 | 204 |     89.6147ms |     172.19.0.18 | POST     "/v1/reactions/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:24:15 | 204 |  139.950315ms |     172.19.0.18 | POST     "/v1/reactions/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:24:15 | 204 |  126.370515ms |     172.19.0.18 | PUT      "/v1/typing-indicator/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:24:16 | 204 |   87.665074ms |     172.19.0.18 | DELETE   "/v1/typing-indicator/<botNumber>"
sigBot-backend  | [GIN] 2024/08/09 - 22:24:16 | 201 |  148.400123ms |     172.19.0.18 | POST     "/v2/send"
sigBot-backend  | [GIN] 2024/08/09 - 22:24:17 | 204 |   96.206703ms |     172.19.0.18 | POST     "/v1/reactions/<botNumber>"
zutewas commented 1 month ago

bbernhard/signal-cli-rest-api:0.166-dev looks good. This works for me. I checked it over night. No problems so far.

bbernhard commented 1 month ago

Thanks for the feedback! Then I'll release the productive version in the next day(s) :)

ralphou commented 1 month ago

Thank you so much!

richtier commented 3 weeks ago

I had same problem. After a few hours of debugging and searching I found this. version 0.88 fixed it for me