Community Forums

Home » Vuze Forums » Open Development


Thread: java.net.SocketException: Network is unreachable


Thread Locked This thread is locked - replies are not allowed.


Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 10 - Pages: 1 - Last Post: Apr 10, 2010 2:46 PM Last Post By: plucian
plucian

Posts: 7
Registered: 04/06/10
java.net.SocketException: Network is unreachable
Posted: Apr 6, 2010 1:13 AM
Click to report abuse...
Hi.

I'm using console ui with azureus 4.3.1.4. I'm flooded with messages like this:

DEBUG::Tue Apr 06 11:06:56 EEST 2010::com.aelitis.azureus.core.networkmanager.impl.tcp.TCPConnectionManager::addNewRequest::443: java.net.SocketException: Network is unreachable
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at com.aelitis.azureus.core.networkmanager.impl.tcp.TCPConnectionManager.addNewRequest(TCPConnectionManager.java:342)
at com.aelitis.azureus.core.networkmanager.impl.tcp.TCPConnectionManager.addNewOutboundRequests(TCPConnectionManager.java:252)
at com.aelitis.azureus.core.networkmanager.impl.tcp.TCPConnectionManager.access$900(TCPConnectionManager.java:53)
at com.aelitis.azureus.core.networkmanager.impl.tcp.TCPConnectionManager$5.run(TCPConnectionManager.java:211)
at org.gudy.azureus2.core3.util.AEThread2$threadWrapper.run(AEThread2.java:294)

Why this message is issued in console since is NOT an error? Simply the tracker does not accept connections on port 443.
Can this be fixed in the next version of azureus?

It's really, really hard to use the console ui because of this.

Thank you.
mmore1q3


Posts: 6,194
Registered: 12/02/07
Re: java.net.SocketException: Network is unreachable
Posted: Apr 6, 2010 3:22 AM   in response to: plucian in response to: plucian
Click to report abuse...
DEBUG::Tue Apr 06 11:06:56 EEST 2010::com.aelitis.azureus.core.networkmanager.impl.tcp.TCPConnectionManager::addNewRequest::443: java.net.SocketException: Network is unreachable
Why this message is issued in console since is NOT an error? Simply the tracker does not accept connections on port 443.
That is actually wrong deduction. 443 references to the line number of source code causing the error.
The actual error is "Network is unreachable", which most likely means that either the tracker's network is down, or something prevent connections there.

But I agree with your main point, that Vuze currently classifies too many "normal" TCP/IP communication errors into exception class and writes the messages into debug.log and console.
plucian

Posts: 7
Registered: 04/06/10
Re: java.net.SocketException: Network is unreachable
Posted: Apr 6, 2010 3:49 AM   in response to: mmore1q3 in response to: mmore1q3
Click to report abuse...
No, tracker is up and running. I can telnet on tracker's IP address/port.
plucian

Posts: 7
Registered: 04/06/10
Re: java.net.SocketException: Network is unreachable
Posted: Apr 6, 2010 5:08 AM   in response to: mmore1q3 in response to: mmore1q3
Click to report abuse...
What type of connection azureus is trying to open/close if remote_address=<null> and remote_port=0?

15:01:56 nwman ConnectDisconnectManager::address exception: full=/2001:X:XXXX:XXXX:XXX:XXXX:XXXX:XXXX:27435, hostname=2001:X:XXXX:XXXX:XXX:XXXX:XXXX:XXXX, port=27435, unresolved=false, full_sub=2001:X:XXXX:XXXX:XXX:XXXX:XXXX:XXXX/2001:X:XXXX:XXXX:XXX:XXXX:XXXX:XXXX, host_address=2001:X:XXXX:XXXX:XXX:XXXX:XXXX:XXXX
channel=java.nio.channels.SocketChannelclosed, socket=Socketunconnected, local_address=/0:0:0:0:0:0:0:1, local_port=60921, remote_address=<null>, remote_port=0
15:01:56 stderr DEBUG::Tue Apr 06 15:01:56 EEST 2010::com.aelitis.azureus.core.networkmanager.impl.tcp.TCPConnectionManager::addNewRequest::443:
15:01:56 DEBUG::Tue Apr 06 15:01:56 EEST 2010::com.aelitis.azureus.core.networkmanager.impl.tcp.TCPConnectionManager::addNewRequest::443:
15:01:56 stderr java.net.SocketException: Network is unreachable
15:01:56 stderr at sun.nio.ch.Net.connect(Native Method)
15:01:56 stderr at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
15:01:56 stderr at com.aelitis.azureus.core.networkmanager.impl.tcp.TCPConnectionManager.addNewRequest(TCPConnectionManager.java:342)
15:01:56 stderr at com.aelitis.azureus.core.networkmanager.impl.tcp.TCPConnectionManager.runSelect(TCPConnectionManager.java:660)
15:01:56 stderr at com.aelitis.azureus.core.networkmanager.impl.tcp.TCPConnectionManager.access$1000(TCPConnectionManager.java:53)
15:01:56 stderr at com.aelitis.azureus.core.networkmanager.impl.tcp.TCPConnectionManager$5.run(TCPConnectionManager.java:213)
15:01:56 stderr at org.gudy.azureus2.core3.util.AEThread2$threadWrapper.run(AEThread2.java:294)
15:01:56 stderr
15:01:56 java.net.SocketException: Network is unreachable
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at com.aelitis.azureus.core.networkmanager.impl.tcp.TCPConnectionManager.addNewRequest(TCPConnectionManager.java:342)
at com.aelitis.azureus.core.networkmanager.impl.tcp.TCPConnectionManager.runSelect(TCPConnectionManager.java:660)
at com.aelitis.azureus.core.networkmanager.impl.tcp.TCPConnectionManager.access$1000(TCPConnectionManager.java:53)
at com.aelitis.azureus.core.networkmanager.impl.tcp.TCPConnectionManager$5.run(TCPConnectionManager.java:213)
at org.gudy.azureus2.core3.util.AEThread2$threadWrapper.run(AEThread2.java:294)

mmore1q3


Posts: 6,194
Registered: 12/02/07
Re: java.net.SocketException: Network is unreachable
Posted: Apr 6, 2010 6:37 AM   in response to: plucian in response to: plucian
Click to report abuse...
15:01:56 nwman ConnectDisconnectManager::address exception: full=/2001:X:XXXX:XXXX:XXX:XXXX:XXXX:XXXX:27435... local_address=/0:0:0:0:0:0:0:1, local_port=60921, remote_address=<null>, remote_port=0

Based on the addresses, that looks like an IPv6 connection, which fails with normal java6 in Windows (Java6 NIO library does not support IPv6... http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6230761 ).

Use a java7 beta version, and IPv6 connections will work in Vuze.

Disable IPv6 support in Vuze advanced network options (after making yourself as an "advanced" user in Mode options), and you might get rid of that error. However, I am not quite sure how handling of that option should be done on console UI...
http://wiki.vuze.com/w/UG_Options#Advanced_Network_Settings

More info about IPv6 problems can be found etc. from
http://forum.vuze.com/thread.jspa?threadID=80495
plucian

Posts: 7
Registered: 04/06/10
Re: java.net.SocketException: Network is unreachable
Posted: Apr 7, 2010 12:07 AM   in response to: mmore1q3 in response to: mmore1q3
Click to report abuse...
Sorry, but I do not use windoze. And IPv6 is disabled:

set
...
IPV6 Enable Support is not set. int, default: 0
IPV6 Prefer Addresses is not set. int, default: 0
....

Thanks anyway.
mmore1q3


Posts: 6,194
Registered: 12/02/07
Re: java.net.SocketException: Network is unreachable
Posted: Apr 7, 2010 12:11 AM   in response to: plucian in response to: plucian
Click to report abuse...
Sorry, but I do not use windoze.
It doesn't matter, as IPv6 NIO does not work in any Java6 implementation. I only mentioned Windows, as this matter started to surface after Windows Vista was practically the first consumer OS to have IPv6 support turned on by default.

But I will try to disable IPv6.
Do that.

Edited by: mmore1q3 on 07-Apr-2010 10:12
Despite what you think about the status of IPv6 in Vuze, all those addresses are IPv6 addresses:
hostname=2001:X:XXXX:XXXX:XXX:XXXX:XXXX:XXXX, local_address=/0:0:0:0:0:0:0:1, etc.
plucian

Posts: 7
Registered: 04/06/10
Re: java.net.SocketException: Network is unreachable
Posted: Apr 7, 2010 2:44 AM   in response to: mmore1q3 in response to: mmore1q3
Click to report abuse...
Do that.
Again, IPv6 is disabled. "set" command typed in terminal show all settings:

IPV6 Enable Support is not set. int, default: 0
IPV6 Prefer Addresses is not set. int, default: 0

Also tracker does not have a AAAA record in DNS.

Despite what you think about the status of IPv6 in Vuze, all those addresses are IPv6 addresses:
hostname=2001:X:XXXX:XXXX:XXX:XXXX:XXXX:XXXX, local_address=/0:0:0:0:0:0:0:1, etc.
A lot of applications (proftpd, dovecot, etc.) use this notation even for IPv4 addresses: ::ffff:1.2.3.4
plucian

Posts: 7
Registered: 04/06/10
Re: java.net.SocketException: Network is unreachable
Posted: Apr 7, 2010 9:23 AM   in response to: mmore1q3 in response to: mmore1q3
Click to report abuse...
Use a java7 beta version, and IPv6 connections will work in Vuze.
Same errors using java 7 beta. :-(
The 8472

Posts: 2,169
Registered: 11/13/07
Re: java.net.SocketException: Network is unreachable
Posted: Apr 9, 2010 11:04 AM   in response to: plucian in response to: plucian
Click to report abuse...
The issue is that you have ipv6 disabled but it tries to connect to a v6 address, which results in a network not being reachable.

If you want to use the console UI you can do 2 things:
a) redirect STDERR to a file/different console/whatever
b) use the telnet UI, which shouldn't see things spewed to the console... i think

plucian

Posts: 7
Registered: 04/06/10
Re: java.net.SocketException: Network is unreachable
Posted: Apr 10, 2010 2:46 PM   in response to: The 8472 in response to: The 8472
Click to report abuse...
a) redirect STDERR to a file/different console/whatever
Of course I can redirect stderr to file, to /dev/null etc. but this will redirect all the errors not just java.net.SocketException.
So if something will go wrong I will not see the errors.

b) use the telnet UI, which shouldn't see things spewed to the console... i think
Crappy ui interface. You cannot specify the IP address for the telnet server to listen on. Only the port number.
Yes, I can use Telnet_sAllowedHosts but it's not the same. If somehow configuration file is lost, any client can access the telnet server.
So it's insecure by default. A better way would be: deny everything by default, allow clients via configuration variable.
Legend
Master: 800 - 9999 pts
Expert: 400 - 799 pts
Advanced: 200 - 399 pts
Intermediate: 100 - 199 pts
Beginner: 50 - 99 pts
Newbie: 0 - 49 pts
Vuze Staff Member
Vuze Community Moderator
Helpful Answer (3 pts)
Correct Answer (5 pts)

Point your RSS reader here for a feed of the latest messages in all forums