Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecatedVersionException (status code 499) #1022

Closed
Seirdy opened this issue Oct 5, 2022 · 29 comments
Closed

DeprecatedVersionException (status code 499) #1022

Seirdy opened this issue Oct 5, 2022 · 29 comments
Milestone

Comments

@Seirdy
Copy link

Seirdy commented Oct 5, 2022

Sending and receiving messages with signal-cli seems to trigger a "DeprecatedVersionException" as of 2022-10-05, 21:59 UTC. This exception seems to be intended to disable deprecated clients. I used the latest official binary release (0.11.1) and the old 0.10.0 release.

Verbose log (0.11.1):

2022-10-05TXX:XX:XX.XXX-XXXX [main] INFO  LibSignal - [libsignal]: rust/bridge/jni/src/logging.rs:156: Initializing libsignal version:0.20.0
2022-10-05TXX:XX:XX.XXX-XXXX [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
2022-10-05TXX:XX:XX.XXX-XXXX [main] INFO  com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Added connection org.sqlite.jdbc4.JDBC4Connection@23d1e5d0
2022-10-05TXX:XX:XX.XXX-XXXX [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
2022-10-05TXX:XX:XX.XXX-XXXX [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown initiated...
2022-10-05TXX:XX:XX.XXX-XXXX [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown completed.
Error while checking account +XXXXXXXXXXX: StatusCode: 499
org.whispersystems.signalservice.api.push.exceptions.DeprecatedVersionException: StatusCode: 499
        at org.whispersystems.signalservice.internal.push.PushServiceSocket.validateServiceResponse(PushServiceSocket.java:1887)
        at org.whispersystems.signalservice.internal.push.PushServiceSocket.makeServiceRequest(PushServiceSocket.java:1831)
        at org.whispersystems.signalservice.internal.push.PushServiceSocket.makeServiceRequest(PushServiceSocket.java:1813)
        at org.whispersystems.signalservice.internal.push.PushServiceSocket.makeServiceBodyRequest(PushServiceSocket.java:1802)
        at org.whispersystems.signalservice.internal.push.PushServiceSocket.makeServiceRequest(PushServiceSocket.java:1738)
        at org.whispersystems.signalservice.internal.push.PushServiceSocket.makeServiceRequest(PushServiceSocket.java:1714)
        at org.whispersystems.signalservice.internal.push.PushServiceSocket.setAccountAttributes(PushServiceSocket.java:428)
        at org.whispersystems.signalservice.api.SignalServiceAccountManager.setAccountAttributes(SignalServiceAccountManager.java:422)
        at org.asamk.signal.manager.helper.AccountHelper.updateAccountAttributes(AccountHelper.java:143)
        at org.asamk.signal.manager.helper.AccountHelper.checkAccountState(AccountHelper.java:63)
        at org.asamk.signal.manager.ManagerImpl.checkAccountState(ManagerImpl.java:193)
        at org.asamk.signal.manager.SignalAccountFiles.initManager(SignalAccountFiles.java:116)
        at org.asamk.signal.manager.SignalAccountFiles.initManager(SignalAccountFiles.java:79)
        at org.asamk.signal.App.loadManager(App.java:348)
        at org.asamk.signal.App.handleLocalCommand(App.java:281)
        at org.asamk.signal.App.init(App.java:222)
        at org.asamk.signal.Main.main(Main.java:60)

JVM information:

openjdk 19 2022-09-20
OpenJDK Runtime Environment (Red_Hat-19.0.0.0.36-3.rolling.fc36) (build 19+36)
OpenJDK 64-Bit Server VM (Red_Hat-19.0.0.0.36-3.rolling.fc36) (build 19+36, mixed mode, sharing)

System information:

  • OS: Fedora 36
  • Environment: SIGNAL_CLI_OPTS=-Xint
@Seirdy
Copy link
Author

Seirdy commented Oct 5, 2022

Seems I'm not the only one. Looks like the Signal server did something before 20:32 UTC today which ended up classifying current signal-cli versions as deprecated clients.

@etlweather
Copy link
Contributor

Not sure where that is in this but on the Android build, the CANONICALVERSION must be updated to 1136

@wizkid057
Copy link

This seems to be affecting the latest release and master branch. None of my signal-cli setups are currently functional as a result.

@etlweather
Copy link
Contributor

I was able to hack this a bit and get it somewhat working. I can receive fine after changing the user agent. I can also send but the sending while it does send the message, returns an error



WARN  ManagerImpl - No profile name set. When sending a message it's recommended to set a profile name wit the updateProfile command. This may become mandatory in the future.
WARN  RecipientHelper - CDSI request failed, trying fallback to CDS
java.io.IOException: java.net.SocketTimeoutException: Connect timed out
        at org.whispersystems.signalservice.api.SignalServiceAccountManager.getRegisteredUsersWithCdsi(SignalServiceAccountManager.java:579)
        at org.asamk.signal.manager.helper.RecipientHelper.getRegisteredUsersV2(RecipientHelper.java:158)
        at org.asamk.signal.manager.helper.RecipientHelper.getRegisteredUsers(RecipientHelper.java:112)
        at org.asamk.signal.manager.helper.RecipientHelper.getRegisteredUser(RecipientHelper.java:128)
        at org.asamk.signal.manager.helper.RecipientHelper.lambda$resolveRecipient$0(RecipientHelper.java:91)
        at org.asamk.signal.manager.storage.recipients.RecipientStore.resolveRecipient(RecipientStore.java:167)
        at org.asamk.signal.manager.helper.RecipientHelper.resolveRecipient(RecipientHelper.java:89)
        at org.asamk.signal.manager.ManagerImpl.sendMessage(ManagerImpl.java:447)
        at org.asamk.signal.manager.ManagerImpl.sendMessage(ManagerImpl.java:552)
        at org.asamk.signal.commands.SendCommand.handleCommand(SendCommand.java:179)
        at org.asamk.signal.App.handleLocalCommand(App.java:282)
        at org.asamk.signal.App.init(App.java:222)
        at org.asamk.signal.Main.main(Main.java:60)
Caused by: java.net.SocketTimeoutException: Connect timed out
        at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:546)
        at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597)
        at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
        at java.base/java.net.Socket.connect(Socket.java:633)
        at okhttp3.internal.platform.Platform.connectSocket(Platform.kt:128)
        at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:295)
        at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:207)
        at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
        at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
        at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
        at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at org.asamk.signal.manager.config.ServiceConfig.lambda$getServiceEnvironmentConfig$0(ServiceConfig.java:79)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833

@etlweather
Copy link
Contributor

@AsamK any idea?

@wizkid057
Copy link

I was able to hack this a bit and get it somewhat working. I can receive fine after changing the user agent. I can also send but the sending while it does send the message, returns an error

Applied this hack, and everything works fine for me. Thanks!

For linux a quick and dirty way to do it to the binary package (need zip and unzip installed):

cd signal-cli-0.11.1/lib/
mkdir tmp
cd tmp
unzip ../signal-cli-0.11.1.jar 
sed -i 's/Signal-Android\/5.22.3/Signal-Android\/5.51.7/g' org/asamk/signal/BaseConfig.class 
zip -r ../signal-cli-0.11.1.jar org/ META-INF/

@etlweather
Copy link
Contributor

etlweather commented Oct 6, 2022

The SocketTimeoutException error was due to my firewall blocking some new Signal server. So with the fix in my pull request, it solves the problem.

@rfrederick
Copy link

I've had the same issue since around the same timestamp. Currently the only piece of routine functionality that's working for me is sending to groups.

@etlweather
Copy link
Contributor

@AsamK Thanks for merging! I assume you will make an official build next? Once we have that, I have that, I can see that signal-cli-rest-api is updated too (as that's what I am using).

@chetbox
Copy link

chetbox commented Oct 6, 2022

Seeing the same problem here over the last few hours with both signal-cli version 0.10.8 and 0.11.1.

Error while checking account [REDACTED]: StatusCode: 499
org.whispersystems.signalservice.api.push.exceptions.DeprecatedVersionException: StatusCode: 499
        at org.whispersystems.signalservice.internal.push.PushServiceSocket.validateServiceResponse(PushServiceSocket.java:1887)
        at org.whispersystems.signalservice.internal.push.PushServiceSocket.makeServiceRequest(PushServiceSocket.java:1831)
        at org.whispersystems.signalservice.internal.push.PushServiceSocket.makeServiceRequest(PushServiceSocket.java:1813)
        at org.whispersystems.signalservice.internal.push.PushServiceSocket.makeServiceBodyRequest(PushServiceSocket.java:1802)
        at org.whispersystems.signalservice.internal.push.PushServiceSocket.makeServiceRequest(PushServiceSocket.java:1738)
        at org.whispersystems.signalservice.internal.push.PushServiceSocket.makeServiceRequest(PushServiceSocket.java:1714)
        at org.whispersystems.signalservice.internal.push.PushServiceSocket.setAccountAttributes(PushServiceSocket.java:428)
        at org.whispersystems.signalservice.api.SignalServiceAccountManager.setAccountAttributes(SignalServiceAccountManager.java:422)
        at org.asamk.signal.manager.helper.AccountHelper.updateAccountAttributes(AccountHelper.java:143)
        at org.asamk.signal.manager.helper.AccountHelper.checkAccountState(AccountHelper.java:63)
        at org.asamk.signal.manager.ManagerImpl.checkAccountState(ManagerImpl.java:193)
        at org.asamk.signal.manager.SignalAccountFiles.initManager(SignalAccountFiles.java:116)
        at org.asamk.signal.manager.SignalAccountFiles.initManager(SignalAccountFiles.java:79)
        at org.asamk.signal.App.loadManager(App.java:348)
        at org.asamk.signal.App.handleLocalCommand(App.java:281)
        at org.asamk.signal.App.init(App.java:222)
        at org.asamk.signal.Main.main(Main.java:60)

@AsamK
Copy link
Owner

AsamK commented Oct 6, 2022

Indeed, will make another release later today.

@hyrava
Copy link

hyrava commented Oct 6, 2022

I think my problem is related. I updated to latest version and applied that patch and when I try to register new account (signal-cli -a +358xxxxxxxxxx register) it says "Failed to register: [413] Rate limit exceeded: 413".

@stevie553
Copy link

@AsamK, do you think it'd be useful to add checks to stop retrying to connect to the servers in case of fatal errors like this one?

One reason is that so the client doesn't get rate limited or even the IP gets blocked from connecting to the servers. And the error will not be fixed by constantly reconnecting anyway.

Also, are there any other fatal errors like status code 499 that the client should just stop reconnecting since it won't be fixed automatically anyway?

This may not be a problem if you're just using "receive" but it could cause problems if you're running in dbus and the client just keeps reconnecting.

Note: if something like this gets implemented, I don't think it'd be good for the client to just terminate, since that could trigger service manager to just restart it (if configured that way of course) which will throw the client in the same loop of reconnecting. So maybe just an error to the log for further inspection by the user would be suitable?

@AsamK
Copy link
Owner

AsamK commented Oct 6, 2022

@stevie553 There's already an exponential backoff implemented in case the receive websocket connection fails to connect, with a maximum of 51 seconds.

WARN  ReceiveHelper - Connection closed unexpectedly, reconnecting in 100 ms
WARN  ReceiveHelper - Connection closed unexpectedly, reconnecting in 200 ms
WARN  ReceiveHelper - Connection closed unexpectedly, reconnecting in 400 ms
WARN  ReceiveHelper - Connection closed unexpectedly, reconnecting in 800 ms
WARN  ReceiveHelper - Connection closed unexpectedly, reconnecting in 1600 ms
WARN  ReceiveHelper - Connection closed unexpectedly, reconnecting in 3200 ms
WARN  ReceiveHelper - Connection closed unexpectedly, reconnecting in 6400 ms
WARN  ReceiveHelper - Connection closed unexpectedly, reconnecting in 12800 ms
WARN  ReceiveHelper - Connection closed unexpectedly, reconnecting in 25600 ms
WARN  ReceiveHelper - Connection closed unexpectedly, reconnecting in 51200 ms
WARN  ReceiveHelper - Connection closed unexpectedly, reconnecting in 51200 ms

@Miniontoby
Copy link

I also had the connection closed, I restarted the deamon and now this:

● signal.service - Send secure messages to Signal clients
   Loaded: loaded (/etc/systemd/system/signal.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2022-10-06 18:03:34 CEST; 3s ago
 Main PID: 1349 (signal-cli)
    Tasks: 39 (limit: 3596)
   CGroup: /system.slice/signal.service
           ├─1349 /bin/sh /usr/local/bin/signal-cli daemon --system
           └─1350 /opt/jdk-17.0.3+7-jre/bin/java -Djava.library.path=/opt/signal-cli-0.10.0/lib -classpath /opt/signal-cli-0.10.0/lib/signal-cli-0.10.0.jar:/o

Oct 06 18:02:42 kodipi systemd[1]: Starting Send secure messages to Signal clients...
Oct 06 18:03:34 kodipi signal-cli[1349]: WARN App - Ignoring +#########: Error while checking account +#########: StatusCode: 499
Oct 06 18:03:34 kodipi signal-cli[1349]: INFO DaemonCommand - Starting daemon in multi-account mode
Oct 06 18:03:34 kodipi systemd[1]: Started Send secure messages to Signal clients.
Oct 06 18:03:34 kodipi signal-cli[1349]: INFO DaemonCommand - DBus daemon running on SYSTEM bus: org.asamk.Signal

@morph027
Copy link
Contributor

morph027 commented Oct 6, 2022

@Miniontoby please use the fix from #1022 (comment) until the fixed version has been released (0.11.2 i guess ;) )

@AsamK AsamK added this to the next-version milestone Oct 6, 2022
@AsamK
Copy link
Owner

AsamK commented Oct 6, 2022

v0.11.2 has been released with the fix

@Miniontoby
Copy link

Miniontoby commented Oct 6, 2022

Uhmm how to update to a newer version?

Mostly without the

OpenJDK Server VM warning: You have loaded library /tmp/resource11499294156574441690.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
WARN  ServiceConfig - Failed to call libsignal-client: /tmp/resource11499294156574441690.so: /tmp/resource11499294156574441690.so: wrong ELF class: ELFCLASS64 (Possible cause: can't load AMD 64 .so on a ARM platform)
Missing required native library dependency: libsignal-client

error coming up when running signal-cli

Or using an installer script that I found:

WARN  ServiceConfig - Failed to call libsignal-client: 'void org.signal.libsignal.internal.Native.Logger_Initialize(int, java.lang.Class)'
Missing required native library dependency: libsignal-client

@morph027
Copy link
Contributor

morph027 commented Oct 6, 2022

You're using the amd64 version on arm64...Where did you find the installer? Also might be better to create a new discussion as it's not really related with this issue.

@plord12
Copy link

plord12 commented Oct 6, 2022

Uhmm how to update to a newer version?

I'm just doing the same ... see https://github.com/AsamK/signal-cli/wiki/Provide-native-lib-for-libsignal

@Miniontoby
Copy link

Miniontoby commented Oct 7, 2022 via email

@Miniontoby
Copy link

Miniontoby commented Oct 8, 2022 via email

@morph027
Copy link
Contributor

morph027 commented Oct 8, 2022

Are you using a Pi 4 w/ arm64? And Raspbian? Then you could just try to download and install this artifact?

curl -Lo /tmp/signal-cli-jre_0.11.3-1_arm64.deb https://gitlab.com/packaging/signal-cli/-/jobs/3144100577/artifacts/raw/signal-cli-jre_0.11.3-1_arm64.deb
apt-get install /tmp/signal-cli-jre_0.11.3-1_arm64.deb

@Miniontoby
Copy link

Miniontoby commented Oct 8, 2022 via email

@morph027
Copy link
Contributor

morph027 commented Oct 8, 2022

Jeah, latest libsignal builds are quite tricky for armv7 (signalapp/libsignal#481)

@Miniontoby
Copy link

Miniontoby commented Oct 9, 2022 via email

@morph027
Copy link
Contributor

morph027 commented Oct 9, 2022

Also w/ latest version? CHANGELOG says that starting 0.11.0 libsignal-client version 0.20.0 is required....

@Miniontoby
Copy link

Miniontoby commented Oct 10, 2022

Also w/ latest version? CHANGELOG says that starting 0.11.0 libsignal-client version 0.20.0 is required....

Uhmm if you look at the releases page of the prev mentioned URL then you could have filled it in yourself. The answer is no. This is because after 0.18.1 the release assets are just 2 instead of 9, where 1 of 9 was the armv7 release.

I am just going to hope that some change which causes this type of error never accures and then I will be fine! Cause I don't want and I don't do upgrading at all for these type of stuff.

For anyone else here who has armv7 and want signal-cli, use the code in #855 (comment) and change the signal_cli_ver to 0.11.2 and the signal_lib_ver to 0.18.1

(And why GH, why do you not send the reply using email and why did I get a message of a new comment but I don't see it here, BRUH)

@Miniontoby
Copy link

Miniontoby commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests