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.

java.lang.IllegalStateException when connecting

See original GitHub issue

Roughly 2/3rds of the times that I attempt to connect to my bot, I get the following error:

java.lang.IllegalStateException: Socket closed before ready packet was received!
	at de.btobastian.javacord.ImplDiscordAPI.connectBlocking(ImplDiscordAPI.java:162)
	at de.btobastian.javacord.ImplDiscordAPI$2.call(ImplDiscordAPI.java:144)
	at de.btobastian.javacord.ImplDiscordAPI$2.call(ImplDiscordAPI.java:141)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Bastiancommented, Jan 17, 2017

Hey,

api.setWaitForServersOnStartup(false);

works as a temporary fix. I still have to find out the reason for this error, but this is at least a temporary solution for everyone with this problem (It seems to not affect everyone).

1reaction
Bastiancommented, Aug 25, 2017

Are there still people experiencing this bug?

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.IllegalStateException: A connection to a distributed ...
The error here is pretty self explanatory: you can't have more than one connection to a distributed system within a single JVM.
Read more >
java.lang.IllegalStateException when connecting #449 - GitHub
I have the same issue with the code that is on the readme. #42.
Read more >
Initialization of bean failed; nested exception is java.lang ...
DefaultDatabase': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Fail to connect to database.
Read more >
java.lang.IllegalStateException:Already Connected
Hi Gauri, It seems that the problem is that U haven't closed the connection. Some other open connection is causing the problem. ......
Read more >
Error encountered while executing a Web Service; java.lang ...
Webhook throws ERROR (9130): Error encountered while executing a Web Service; java.lang.IllegalStateException:Already connected.
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