Network is unreachable

Hi,

I’m trying to run pgdbg on my amd64 workstation running Debian Squeeze.
I get the following error:


PGDBG 10.6-0 x86-64 (Workstation, 8 Process)
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2010, STMicroelectronics, Inc. All Rights Reserved.
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at SplashLoader$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.SocketException: Network is unreachable
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.(Unknown Source)
at java.net.Socket.(Unknown Source)
at jpgdbg.main(Unknown Source)
… 6 more

What can I do to fix this? Thanks!

It looks like a possible cause for this error could be failure of the gethostname(2) call in the debugger. This might happen with an extremely long host name, or if the network for the given hostname isn’t configured.

What is the output of the hostname(1) command on your system? Also, “uname -n”?

thanks
–Don

Here they are:

varda-lionel:hostname
varda
varda-lionel:uname -n
varda
varda-lionel:

I suspect some kind of network config issue. “Network unreachable” implies that the network stack cannot find the requested destination. In this case we just want to go to the local host, but we are using its hostname (varda), as opposed to “localhost”.

Can you check to see if you have a firewall (or other security software) running that could be blocking local access via TCP sockets?

thanks
–Don

Google came to the rescue!

sun-java6-jre: net.ipv6.bindv6only=1 breaks java networking


I typed

sudo sed -i ‘s/net.ipv6.bindv6only\ =\ 1/net.ipv6.bindv6only\ =\ 0/’
/etc/sysctl.d/bindv6only.conf && sudo invoke-rc.d procps restart

and now it works.

Cheers,

RL