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

Message decoding error #289

Closed
wf4java opened this issue May 21, 2023 · 25 comments
Closed

Message decoding error #289

wf4java opened this issue May 21, 2023 · 25 comments
Labels
bug Something isn't working

Comments

@wf4java
Copy link

wf4java commented May 21, 2023

2023 2:38:57 PM it.auties.whatsapp.socket.MessageHandler sendRetryReceipt
WARNING: Cannot decode message(id: 3A38DB588622A0317A6B, from: 79635946310@s.whatsapp.net): Cannot decrypt message: no suitable session found

image

Tranlate:
Waiting for a message. It can take some time. More
↓↓↓↓↓↓↓↓↓↓↓↓
4990E01E-4F86-4475-AF69-B42B0ACC6813

Tranlate:
Synchronization is in progress. Don't close the app
↓↓↓↓↓↓↓↓↓↓↓↓
image

The first time everything is fine for 30-60 minutes, then this garbage starts

@Auties00
Copy link
Owner

what version are you using?
can you show me your code?

@Auties00 Auties00 added the waiting triage A maintainer acknowledged the issue, further discussion is needed label May 22, 2023
@wf4java
Copy link
Author

wf4java commented May 22, 2023

version 3.4.0

code:
image

image

image

@wf4java
Copy link
Author

wf4java commented May 22, 2023

I also noticed when this happens, sometimes these errors:

java.io.UncheckedIOException: Cannot read smile
at it.auties.whatsapp.util.Smile.readValue(Smile.java:95)
at it.auties.whatsapp.controller.DefaultControllerSerializer$SmileFile.read(DefaultControllerSerializer.java:368)
at it.auties.whatsapp.controller.DefaultControllerSerializer$SmileFile.read(DefaultControllerSerializer.java:355)
at it.auties.whatsapp.controller.DefaultControllerSerializer.deserializeKeysFromId(DefaultControllerSerializer.java:188)
at it.auties.whatsapp.controller.DefaultControllerSerializer.deserializeKeys(DefaultControllerSerializer.java:176)
at it.auties.whatsapp.controller.Keys.of(Keys.java:233)
at it.auties.whatsapp.api.OptionsBuilder.(OptionsBuilder.java:24)
at it.auties.whatsapp.api.WebOptionsBuilder.(WebOptionsBuilder.java:13)
at it.auties.whatsapp.api.ConnectionBuilder.createConnection(ConnectionBuilder.java:108)
at it.auties.whatsapp.api.ConnectionBuilder.lastConnection(ConnectionBuilder.java:101)
at wf.bot.whatsapp_bot.main.Main.init(Main.java:52)
at wf.bot.whatsapp_bot.main.Main.main(Main.java:26)
Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
at java.base/java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:244)
at java.base/java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at java.base/java.util.zip.GZIPInputStream.read(GZIPInputStream.java:117)
at com.fasterxml.jackson.dataformat.smile.SmileParser._loadMore(SmileParser.java:257)
at com.fasterxml.jackson.dataformat.smile.SmileParser.nextToken(SmileParser.java:415)
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4817)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4723)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3722)
at it.auties.whatsapp.util.Smile.readValue(Smile.java:93)
... 11 more

@wf4java
Copy link
Author

wf4java commented May 22, 2023

image

@Auties00
Copy link
Owner

version 3.4.0

code:
image

image

image

I'll test it when I'm home

@Auties00
Copy link
Owner

can you test with the Master branch?

@wf4java
Copy link
Author

wf4java commented May 27, 2023

I don't know why, but I can't compile the project, I downloaded it and I can't compile. Should I wait for the release in maven?

image
image

@Auties00
Copy link
Owner

I don't know why, but I can't compile the project, I downloaded it and I can't compile. Should I wait for the release in maven?

image image

Can you try now? I've pushed a new commit
Also delete your session when testing

@wf4java
Copy link
Author

wf4java commented May 27, 2023

I'm doing tests, please wait

@wf4java
Copy link
Author

wf4java commented May 28, 2023

The error has not disappeared, but right now it somehow arises differently, I do not fully understand how. But he was able to work several hours in a row several times. And the same error

@Auties00
Copy link
Owner

i figured it out, I'll push a commit later today

@wf4java
Copy link
Author

wf4java commented Jun 1, 2023

java.io.UncheckedIOException: Cannot read smile
at it.auties.whatsapp.util.Smile.readValue(Smile.java:95)
at it.auties.whatsapp.controller.DefaultControllerSerializer$SmileFile.read(DefaultControllerSerializer.java:368)
at it.auties.whatsapp.controller.DefaultControllerSerializer$SmileFile.read(DefaultControllerSerializer.java:355)
at it.auties.whatsapp.controller.DefaultControllerSerializer.deserializeStoreFromId(DefaultControllerSerializer.java:208)
at it.auties.whatsapp.controller.DefaultControllerSerializer.deserializeStore(DefaultControllerSerializer.java:196)
at it.auties.whatsapp.controller.Store.of(Store.java:398)
at it.auties.whatsapp.api.OptionsBuilder.(OptionsBuilder.java:23)
at it.auties.whatsapp.api.WebOptionsBuilder.(WebOptionsBuilder.java:13)
at it.auties.whatsapp.api.ConnectionBuilder.createConnection(ConnectionBuilder.java:108)
at it.auties.whatsapp.api.ConnectionBuilder.lastConnection(ConnectionBuilder.java:101)
at wf.bot.whatsapp_bot.main.Main.init(Main.java:53)
at wf.bot.whatsapp_bot.main.Main.main(Main.java:26)
Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
at java.base/java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:244)
at java.base/java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at java.base/java.util.zip.GZIPInputStream.read(GZIPInputStream.java:117)
at com.fasterxml.jackson.dataformat.smile.SmileParser._loadMore(SmileParser.java:257)
at com.fasterxml.jackson.dataformat.smile.SmileParser.nextToken(SmileParser.java:415)
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4817)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4723)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3722)
at it.auties.whatsapp.util.Smile.readValue(Smile.java:93)
... 11 more
июн. 01, 2023 8:54:43 PM it.auties.whatsapp.socket.MessageHandler sendRetryReceipt
WARNING: Cannot decode message(id: EACAFC981A2AC82E2E05566F56A419A6, from: 79899255873-1630398938@g.us): Cannot find state with id 970146628
Connected
Logged in
июн. 01, 2023 9:34:53 PM it.auties.whatsapp.socket.MessageHandler sendRetryReceipt
WARNING: Cannot decode message(id: EACAFC981A2AC82E2E05566F56A419A6, from: 79899255873-1630398938@g.us): Cannot find state with id 970146628
июн. 01, 2023 9:34:54 PM it.auties.whatsapp.api.ErrorHandler lambda$defaultErrorHandler$1
SEVERE: Socket failure at CRYPTOGRAPHY
java.lang.RuntimeException: Detected a bad mac
at it.auties.whatsapp.socket.StreamHandler.digestError(StreamHandler.java:547)
at it.auties.whatsapp.socket.StreamHandler.digest(StreamHandler.java:88)
at it.auties.whatsapp.socket.SocketHandler.onMessage(SocketHandler.java:172)
at it.auties.whatsapp.socket.SocketSession.readMessages(SocketSession.java:122)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
июн. 01, 2023 9:34:54 PM it.auties.whatsapp.api.ErrorHandler lambda$defaultErrorHandler$1
WARNING: Socket failure at CRYPTOGRAPHY
Disconnect: RESTORE
Disconnected
Reconnecting
java.util.concurrent.CompletionException: java.io.UncheckedIOException: Cannot complete file write
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1807)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.io.UncheckedIOException: Cannot complete file write
at it.auties.whatsapp.controller.DefaultControllerSerializer$SmileFile.writeSync(DefaultControllerSerializer.java:396)
at it.auties.whatsapp.controller.DefaultControllerSerializer$SmileFile.lambda$write$0(DefaultControllerSerializer.java:378)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
... 6 more
Caused by: java.nio.file.NoSuchFileException: C:\Users\momop.whatsapp4j\web\a4d7f40f-4ad0-4de9-9eab-dfb689068b3c\keys.smile
at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:236)
at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:484)
at java.base/java.nio.file.Files.newOutputStream(Files.java:228)
at it.auties.whatsapp.controller.DefaultControllerSerializer$SmileFile.writeSync(DefaultControllerSerializer.java:391)
... 8 more
июн. 01, 2023 9:34:55 PM it.auties.whatsapp.api.ErrorHandler lambda$defaultErrorHandler$1
SEVERE: Socket failure at UNKNOWN
java.lang.RuntimeException: Cannot lock on media connection
at it.auties.whatsapp.controller.Store.mediaConnection(Store.java:963)
at it.auties.whatsapp.controller.Store.mediaConnection(Store.java:946)
at it.auties.whatsapp.api.Whatsapp.attributeMediaMessage(Whatsapp.java:533)
at it.auties.whatsapp.api.Whatsapp.attributeMessageMetadata(Whatsapp.java:453)
at it.auties.whatsapp.api.Whatsapp.sendMessage(Whatsapp.java:442)
at it.auties.whatsapp.api.Whatsapp.sendMessage(Whatsapp.java:431)
at it.auties.whatsapp.api.Whatsapp.sendMessage(Whatsapp.java:408)
at wf.bot.whatsapp_bot.command.DisposableImage.onNewImageMessage(DisposableImage.java:13)
at wf.bot.whatsapp_bot.handler.NewMessageHandler.onNewMessage(NewMessageHandler.java:31)
at it.auties.whatsapp.socket.SocketHandler.lambda$onNewMessage$28(SocketHandler.java:571)
at it.auties.whatsapp.socket.SocketHandler.invokeListenerSafe(SocketHandler.java:660)
at it.auties.whatsapp.socket.SocketHandler.lambda$callListenersAsync$2(SocketHandler.java:138)
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)
Caused by: java.lang.InterruptedException
at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1081)
at java.base/java.util.concurrent.CountDownLatch.await(CountDownLatch.java:276)
at it.auties.whatsapp.controller.Store.mediaConnection(Store.java:957)
... 14 more
июн. 01, 2023 9:34:55 PM it.auties.whatsapp.api.ErrorHandler lambda$defaultErrorHandler$1

image
image
image

@wf4java
Copy link
Author

wf4java commented Jun 1, 2023

I downloaded master branch 2 hours ago and here are the errors

@Auties00
Copy link
Owner

Auties00 commented Jun 1, 2023

I downloaded master branch 2 hours ago and here are the errors

delete that session
switch fo 3.4.2, the latest release
try again

@wf4java
Copy link
Author

wf4java commented Jun 1, 2023

image

@Auties00
Copy link
Owner

Auties00 commented Jun 1, 2023

image

wait for maven central(10/15 minutes) or use the master branch

@wf4java
Copy link
Author

wf4java commented Jun 2, 2023

The error didn't go away.

WARNING: Cannot decode message(id: 3A4F24E1629B0619A557, from: 79635946310@s.whatsapp.net): Cannot decrypt message: no suitable session found
июн. 02, 2023 8:02:23 PM it.auties.whatsapp.socket.MessageHandler sendRetryReceipt
WARNING: Cannot decode message(id: 3A63D5CCD91FA467DAB5, from: 79635946310@s.whatsapp.net): Cannot decrypt message: no suitable session found
июн. 02, 2023 8:02:23 PM it.auties.whatsapp.socket.MessageHandler sendRetryReceipt
WARNING: Cannot decode message(id: 3A6435F8F229421F27D5, from: 79635946310@s.whatsapp.net): Cannot decrypt message: no suitable session found
Connected
Logged in
июн. 02, 2023 8:02:25 PM it.auties.whatsapp.socket.MessageHandler sendRetryReceipt
WARNING: Cannot decode message(id: 13770A2223034F7A, from: 79635946310:48@s.whatsapp.net): Key used already or never filled

@Auties00
Copy link
Owner

Auties00 commented Jun 2, 2023

The error didn't go away.

WARNING: Cannot decode message(id: 3A4F24E1629B0619A557, from: 79635946310@s.whatsapp.net): Cannot decrypt message: no suitable session found
июн. 02, 2023 8:02:23 PM it.auties.whatsapp.socket.MessageHandler sendRetryReceipt
WARNING: Cannot decode message(id: 3A63D5CCD91FA467DAB5, from: 79635946310@s.whatsapp.net): Cannot decrypt message: no suitable session found
июн. 02, 2023 8:02:23 PM it.auties.whatsapp.socket.MessageHandler sendRetryReceipt
WARNING: Cannot decode message(id: 3A6435F8F229421F27D5, from: 79635946310@s.whatsapp.net): Cannot decrypt message: no suitable session found
Connected
Logged in
июн. 02, 2023 8:02:25 PM it.auties.whatsapp.socket.MessageHandler sendRetryReceipt
WARNING: Cannot decode message(id: 13770A2223034F7A, from: 79635946310:48@s.whatsapp.net): Key used already or never filled

did you delete all of the sessions?

@wf4java
Copy link
Author

wf4java commented Jun 2, 2023

Yes, I deleted all sessions

@Auties00
Copy link
Owner

Auties00 commented Jun 2, 2023

Yes, I deleted all sessions

when does the error happen exactly?

@wf4java
Copy link
Author

wf4java commented Jun 2, 2023

Before, this error occurred after 1-2 hours or when I restarted the program there was a chance that this error would occur. But this time it was different, it worked for 4-5 hours, and I went to sleep and turned off the computer. After 12-15 hours I turned it on again, and the error happened again.

@Auties00
Copy link
Owner

Auties00 commented Jun 2, 2023

Before, this error occurred after 1-2 hours or when I restarted the program there was a chance that this error would occur. But this time it was different, it worked for 4-5 hours, and I went to sleep and turned off the computer. After 12-15 hours I turned it on again, and the error happened again.

this is very good.
in short when you start the bot, all of the messages that were sent while you were offline are sent to you for decryption.
the decryption process needs to happen in chronological order(it has to do with the signal protocol), but if the bot receives too many messages the possibility of the order mixing up grows exponentially as the decoding actually happens asynchronously.
I thought I fixed this error, but it looks like that's not the case.
I'll have a fix shortly, in the meanwhile if you don't stop your bot it will not happen again.

@Auties00 Auties00 changed the title Decode error Message decoding error Jun 7, 2023
@Auties00 Auties00 added bug Something isn't working and removed waiting triage A maintainer acknowledged the issue, further discussion is needed labels Jun 7, 2023
@Auties00
Copy link
Owner

Auties00 commented Jun 9, 2023

Could be fixed in 3.4.5

@sbihaiko
Copy link

Hi Auties00.
Got an another “Cannot decode message” warning at v3.5.1.

nov. 25, 2023 3:24:35 PM it.auties.whatsapp.socket.MessageHandler decodeMessage
WARNING: Cannot decode message(id: 3A1B6CE56625C2FE1AD3, from: 554499981486@s.whatsapp.net): message_decryption

nov. 25, 2023 3:24:47 PM it.auties.whatsapp.socket.MessageHandler decodeMessage
WARNING: Cannot decode message(id: 3A2EC2F9F74D0D467271, from: 120363145496978942@g.us): Cannot find state with id 1586454393

Could you help me?

@Auties00
Copy link
Owner

Hi Auties00.
Got an another “Cannot decode message” warning at v3.5.1.

nov. 25, 2023 3:24:35 PM it.auties.whatsapp.socket.MessageHandler decodeMessage
WARNING: Cannot decode message(id: 3A1B6CE56625C2FE1AD3, from: 554499981486@s.whatsapp.net): message_decryption

nov. 25, 2023 3:24:47 PM it.auties.whatsapp.socket.MessageHandler decodeMessage
WARNING: Cannot decode message(id: 3A2EC2F9F74D0D467271, from: 120363145496978942@g.us): Cannot find state with id 1586454393

Could you help me?

Use the master branch, this issue has already been fixed a long time ago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
@Auties00 @wf4java @sbihaiko and others