bbernhard / signal-cli-rest-api

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

MissingCapabilitiesException: StatusCode: 409 when registering device #457

Closed bdunn1100 closed 11 months ago

bdunn1100 commented 11 months ago

The problem

Having an issue with the latest docker image bbernhard/signal-cli-rest-api.

Issue: When linking a device using the qr code it adds the account to the accounts.json but the device is not linked. When trying to send messages to the device I get a response "{"error":"User +1234567890 is not registered.\n"}

Troubleshooting: Inside of the docker container running as the signal-api user I run:

signal-cli -v --config /home/.local/share/signal-cli link -n signal-api | tee >(xargs -L 1 qrencode -t utf8)

With the verbosity output I get this error message:

2023-11-24T15:43:42.467Z [main] INFO LibSignal - [WebSocketConnection]: [provisioning:1603696865] disconnect() 2023-11-24T15:43:42.487Z [main] INFO o.a.s.m.i.ProvisioningManagerImpl - Received link information from +1234567890, linking in progress ... 2023-11-24T15:43:42.503Z [OkHttp https://chat.signal.org/...] INFO LibSignal - [WebSocketConnection]: [provisioning:1603696865] onClosing() 2023-11-24T15:43:42.504Z [OkHttp https://chat.signal.org/...] INFO LibSignal - [WebSocketConnection]: [provisioning:1603696865] onClose() 2023-11-24T15:43:42.795Z [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting... 2023-11-24T15:43:43.076Z [main] INFO com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Added connection org.sqlite.jdbc4.JDBC4Connection@32f61a31 2023-11-24T15:43:43.079Z [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed. 2023-11-24T15:43:43.189Z [main] DEBUG o.a.s.m.s.r.MergeRecipientHelper - Got new recipient, serviceId, PNI and number are unknown 2023-11-24T15:43:43.193Z [main] DEBUG o.a.s.m.s.recipients.RecipientStore - Added new recipient RecipientId[id=1] with address RecipientAddress[serviceId=Optional[GUID], pni=Optional[PNI:GUID], number=Optional[+1234567890], username=Optional.empty] 2023-11-24T15:43:43.314Z [main] DEBUG o.a.s.m.s.i.IdentityKeyStore - Storing new identity for recipient GUID with trust TRUSTED_UNVERIFIED 2023-11-24T15:43:43.322Z [main] DEBUG o.a.s.m.s.i.IdentityKeyStore - Updating trust level for recipient GUID with trust TRUSTED_VERIFIED 2023-11-24T15:43:43.328Z [main] DEBUG o.a.s.m.s.i.IdentityKeyStore - Storing new identity for recipient PNI:GUID with trust TRUSTED_UNVERIFIED 2023-11-24T15:43:43.335Z [main] DEBUG o.a.s.m.s.i.IdentityKeyStore - Updating trust level for recipient PNI:GUID with trust TRUSTED_VERIFIED 2023-11-24T15:43:43.392Z [main] DEBUG o.a.s.m.i.ProvisioningManagerImpl - Finishing new device registration 2023-11-24T15:43:44.434Z [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown initiated... 2023-11-24T15:43:44.439Z [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown completed. Link request error: StatusCode: 409 org.whispersystems.signalservice.internal.push.exceptions.MissingCapabilitiesException: StatusCode: 409 at org.whispersystems.signalservice.internal.push.PushServiceSocket.lambda$static$0(PushServiceSocket.java:506) at org.whispersystems.signalservice.internal.push.PushServiceSocket.makeServiceRequest(PushServiceSocket.java:1992) at org.whispersystems.signalservice.internal.push.PushServiceSocket.makeServiceRequest(PushServiceSocket.java:1932) at org.whispersystems.signalservice.internal.push.PushServiceSocket.finishNewDeviceRegistration(PushServiceSocket.java:500) at org.whispersystems.signalservice.api.SignalServiceAccountManager.finishNewDeviceRegistration(SignalServiceAccountManager.java:733) at org.asamk.signal.manager.internal.ProvisioningManagerImpl.finishDeviceLink(ProvisioningManagerImpl.java:153) at org.asamk.signal.commands.LinkCommand.handleCommand(LinkCommand.java:46) at org.asamk.signal.commands.CommandHandler.handleProvisioningCommand(CommandHandler.java:25) at org.asamk.signal.App.handleProvisioningCommand(App.java:255) at org.asamk.signal.App.handleCommand(App.java:158) at org.asamk.signal.App.init(App.java:144) at org.asamk.signal.Main.main(Main.java:61)

Signal CLI Version: signal-cli 0.12.4

Is there a step I missed or is there an issue with the signal-cli application.

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?

Native Mode

What's the architecture of your host system?

x86-64

Additional information

No response

Gridddm commented 11 months ago

I have the same error. Did you find the solution?

JaderDias commented 11 months ago

this commit probably fixes it https://github.com/AsamK/signal-cli/commit/66077f317be3a3e9c5b99e44e468a6e0a67e393b

bbernhard commented 11 months ago

Please give the docker image bbernhard/signal-cli-rest-api:0.133-dev a try

bdunn1100 commented 11 months ago

Gave the above image a try. Getting a different error now:

2023-12-15T16:15:05.837Z [main] DEBUG org.asamk.signal.util.IOUtils - XDG_RUNTIME_DIR not set, falling back to temp dir 2023-12-15T16:15:05.850Z [main] DEBUG org.asamk.signal.App - Starting signal-cli 0.12.6 2023-12-15T16:15:06.057Z [main] INFO LibSignal - [libsignal]: rust/bridge/jni/src/logging.rs:158: Initializing libsignal version:0.32.1 2023-12-15T16:15:06.607Z [main] INFO LibSignal - [WebSocketConnection]: [provisioning:1111111111] connect() 2023-12-15T16:15:07.752Z [OkHttp https://chat.signal.org/...] INFO LibSignal - [WebSocketConnection]: [provisioning:1111111111] onOpen() connected sgnl://linkdevice?uuid=XA0FBgi1-00CPuby5vr_QA&pub_key=BXJthmwy6rsCRRK8X9Y%2FcMuzafF8sqczE%2Bb8Cf7G65dF 2023-12-15T16:16:07.748Z [OkHttp https://chat.signal.org/...] WARN LibSignal - [WebSocketConnection]: [provisioning:1111111111] onFailure() java.io.EOFException at okio.RealBufferedSource.require(RealBufferedSource.kt:202) at okio.RealBufferedSource.readByte(RealBufferedSource.kt:212) at okhttp3.internal.ws.WebSocketReader.readHeader(WebSocketReader.kt:119) at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.kt:102) at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.kt:293) at okhttp3.internal.ws.RealWebSocket$connect$1.onResponse(RealWebSocket.kt:195) at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source)

2023-12-15T16:16:07.749Z [OkHttp https://chat.signal.org/...] INFO LibSignal - [WebSocketConnection]: [provisioning:1111111111] Client not null when closed Link request error: Connection closed! java.io.IOException: Connection closed! at org.whispersystems.signalservice.internal.websocket.WebSocketConnection.readRequest(WebSocketConnection.java:224) at org.whispersystems.signalservice.internal.push.ProvisioningSocket.readRequest(ProvisioningSocket.java:69) at org.whispersystems.signalservice.internal.push.ProvisioningSocket.getProvisioningMessage(ProvisioningSocket.java:56) at org.whispersystems.signalservice.api.SignalServiceAccountManager.getNewDeviceRegistration(SignalServiceAccountManager.java:681) at org.asamk.signal.manager.internal.ProvisioningManagerImpl.finishDeviceLink(ProvisioningManagerImpl.java:97) at org.asamk.signal.commands.LinkCommand.handleCommand(LinkCommand.java:46) at org.asamk.signal.commands.CommandHandler.handleProvisioningCommand(CommandHandler.java:25) at org.asamk.signal.App.handleProvisioningCommand(App.java:255) at org.asamk.signal.App.handleCommand(App.java:158) at org.asamk.signal.App.init(App.java:144) at org.asamk.signal.Main.main(Main.java:61)

jodelkoenig commented 11 months ago

hey @bbernhard .. I saw, that you updated Dockerfile to SIGNAL_CLI_VERSION=0.12.7. After a fresh clone and build I can confirm that I can link my device to my iPhone 15 pro with latest IOS. I sent test messages to my wife's phone number as well as to my own and both work as well. Thanks

LightningRhino commented 11 months ago

I can confirm linking my iPhone is now working again after building the docker image with the latest Dockerfile. Thanks. Now I'm waiting for a new official docker image.

bdunn1100 commented 11 months ago

Tried with the Dockerfile build and it's also working for me now too.

bbernhard commented 11 months ago

should be fixed with the latest release