question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Image sending seems to have broken

See original GitHub issue

Not sure if this is the stack trace for the issue, sorry if it isnt I got no errors when trying to send image only next boot…

Code for image sending
val i = ImageMessage.newImageMessage()
            .storeId(api.store().id())
            .media(image)
            .caption("test")
            .create()
        api.sendMessage(chat, i)

Exception:

	at it.auties.whatsapp.crypto.SessionCipher.decrypt(SessionCipher.java:146)
	at it.auties.whatsapp.binary.Socket$MessageHandler.decode(Socket.java:1359)
	at it.auties.whatsapp.binary.Socket$MessageHandler.decode(Socket.java:1305)
	at it.auties.whatsapp.binary.Socket$MessageHandler.lambda$decode$34(Socket.java:1254)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at it.auties.whatsapp.binary.Socket$MessageHandler.decode(Socket.java:1254)
	at it.auties.whatsapp.binary.Socket$StreamHandler.digest(Socket.java:547)
	at it.auties.whatsapp.binary.Socket.handleNode(Socket.java:197)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at it.auties.whatsapp.binary.Socket.onBinary(Socket.java:192)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.glassfish.tyrus.core.AnnotatedEndpoint.callMethod(AnnotatedEndpoint.java:553)
	at org.glassfish.tyrus.core.AnnotatedEndpoint$WholeHandler$1.onMessage(AnnotatedEndpoint.java:652)
	at org.glassfish.tyrus.core.TyrusSession.notifyMessageHandlers(TyrusSession.java:560)
	at org.glassfish.tyrus.core.TyrusEndpointWrapper.onMessage(TyrusEndpointWrapper.java:800)
	at org.glassfish.tyrus.core.TyrusWebSocket.onMessage(TyrusWebSocket.java:183)
	at org.glassfish.tyrus.core.frame.BinaryFrame.respond(BinaryFrame.java:70)
	at org.glassfish.tyrus.core.ProtocolHandler.process(ProtocolHandler.java:819)
	at org.glassfish.tyrus.client.TyrusClientEngine$TyrusReadHandler.handle(TyrusClientEngine.java:725)
	at org.glassfish.tyrus.container.grizzly.client.GrizzlyClientFilter$ProcessTask.execute(GrizzlyClientFilter.java:452)
	at org.glassfish.tyrus.container.grizzly.client.TaskProcessor.processTask(TaskProcessor.java:91)
	at org.glassfish.tyrus.container.grizzly.client.TaskProcessor.processTask(TaskProcessor.java:68)
	at org.glassfish.tyrus.container.grizzly.client.GrizzlyClientFilter.handleRead(GrizzlyClientFilter.java:248)
	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:88)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:246)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:178)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:118)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:96)
	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:51)
	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:510)
	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:82)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:83)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:34)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:101)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:535)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:515)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.IllegalArgumentException: Key used already or never filled
	at java.base/jdk.internal.reflect.GeneratedConstructorAccessor40.newInstance(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
	at it.auties.whatsapp.util.Validate.createThrowable(Validate.java:29)
	at it.auties.whatsapp.util.Validate.isTrue(Validate.java:14)
	at it.auties.whatsapp.util.Validate.isTrue(Validate.java:9)
	at it.auties.whatsapp.crypto.SessionCipher.decrypt(SessionCipher.java:166)
	at it.auties.whatsapp.crypto.SessionCipher.tryDecrypt(SessionCipher.java:152)
	at it.auties.whatsapp.crypto.SessionCipher.decrypt(SessionCipher.java:131)
	... 39 more

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Auties00commented, Jul 4, 2022

@Auties00 Also I am on RC13

Can i see the error marked as MEDIA_CONNECTION?

	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$UniApply.tryFire(CompletableFuture.java:649)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
	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.lang.NullPointerException: Cannot invoke "it.auties.whatsapp.model.signal.session.SessionState.remoteIdentityKey()" because "currentState" is null
	at it.auties.whatsapp.crypto.SessionCipher.encrypt(SessionCipher.java:30)
	at it.auties.whatsapp.binary.Socket$MessageHandler.createMessageNode(Socket.java:1130)
	at it.auties.whatsapp.binary.Socket$MessageHandler.lambda$createMessageNodes$16(Socket.java:1124)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
	at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
	at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
	at it.auties.whatsapp.binary.Socket$MessageHandler.createMessageNodes(Socket.java:1125)
	at it.auties.whatsapp.binary.Socket$MessageHandler.lambda$createConversationNodes$8(Socket.java:1076)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
	... 6 more
``` this one ?

Should be fixed in the last commit, Try version RC14. If the error isn’t fixed reopen the issue. I’m closing it as I have tested it and it looks to be working

0reactions
shmezicommented, Jun 30, 2022

@Auties00 Also I am on RC13

Can i see the error marked as MEDIA_CONNECTION?

	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$UniApply.tryFire(CompletableFuture.java:649)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
	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.lang.NullPointerException: Cannot invoke "it.auties.whatsapp.model.signal.session.SessionState.remoteIdentityKey()" because "currentState" is null
	at it.auties.whatsapp.crypto.SessionCipher.encrypt(SessionCipher.java:30)
	at it.auties.whatsapp.binary.Socket$MessageHandler.createMessageNode(Socket.java:1130)
	at it.auties.whatsapp.binary.Socket$MessageHandler.lambda$createMessageNodes$16(Socket.java:1124)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
	at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
	at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
	at it.auties.whatsapp.binary.Socket$MessageHandler.createMessageNodes(Socket.java:1125)
	at it.auties.whatsapp.binary.Socket$MessageHandler.lambda$createConversationNodes$8(Socket.java:1076)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
	... 6 more
``` this one ?
Read more comments on GitHub >

github_iconTop Results From Across the Web

Images are broken in emails sent - Google Sites
If images aren't correctly displayed in the emails sent (you can send you a test email to try), it means your Gmail draft...
Read more >
Solved: Send mail with image embeded as html code
Solved: Hey friends, Ive built simple flow, that is sending an image embeded as HTML to people in my organization via outlook.
Read more >
HTML Email Coding Tips to Fix Broken Images - GroupMail
HTML Email Coding Tips to Fix Broken Images · 1. The fix for most people is to add <style>img {display:block}</style> at the top...
Read more >
How to fix broken images in your email marketing - YouTube
Each one has a quick and easy fix. As referenced in the video, our guide to verify your sending domain (valid for Email...
Read more >
How to Fix a Broken Image on a Website [Guide]
The first thing to check is whether or not the image actually exists in the place that you think it should be. This...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found