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

java.io.IOException: Can't create listen socket #41

Open
DemonRx opened this issue Jun 10, 2021 · 5 comments
Open

java.io.IOException: Can't create listen socket #41

DemonRx opened this issue Jun 10, 2021 · 5 comments

Comments

@DemonRx
Copy link

DemonRx commented Jun 10, 2021

This problem occurs upon running the start.sh script.

WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
2021-06-10 13:11:36 ERROR Network:148 - Can't create listen socket: Protocol family unavailable
2021-06-10 13:11:36 ERROR Controller:439 - Unable to start networking
java.io.IOException: Can't create listen socket
	at org.qortal.network.Network.start(Network.java:149) ~[qortal.jar:1.5.3]
	at org.qortal.controller.Controller.main(Controller.java:437) [qortal.jar:1.5.3]
Caused by: java.net.SocketException: Protocol family unavailable
	at sun.nio.ch.Net.bind0(Native Method) ~[?:?]
	at sun.nio.ch.Net.bind(Net.java:455) ~[?:?]
	at sun.nio.ch.Net.bind(Net.java:447) ~[?:?]
	at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227) ~[?:?]
	at org.qortal.network.Network.start(Network.java:142) ~[qortal.jar:1.5.3]
	... 1 more
@DemonRx
Copy link
Author

DemonRx commented Jun 10, 2021

Apparently on linux, openjdk-11-jre package is too old of a version on ubuntu 21.04. I updated to openjdk-17-jre and this solved the problem.

@archived-2
Copy link

Hey, see this issue: #25

It can be solved on JDK 11 / 14 by adding this to your settings.json:

{ "bindAddress":"0.0.0.0" }

Interesting that JDK 17 fixes it; I'll have to investigate that at some point. There is also an automatic fix for this in the bindaddress-ipv4 branch, which I may merge into master soon to prevent this problem from happening at all.

@DemonRx
Copy link
Author

DemonRx commented Jun 10, 2021

Ahh actually it wasn't working without this parameter.

With openjdk-17 it would start with only saying "WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance."

So it is still needed anyway. But on the bright side it works fine with version 17 :)

@DemonRx
Copy link
Author

DemonRx commented Jun 10, 2021

I'll keep this issue open, since it still affects users that keep ipv6 disabled in their network (as I do).

@archived-2
Copy link

Thanks. I'll update on here when the fix is merged.

Also, the "sun.reflect.Reflection.getCallerClass is not supported. This will impact performance." warning is normal, and you'll see that in all cases.

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

2 participants