Issue Details (XML | Word | Printable)

Key: SFOS-1182
Type: Bug Bug
Status: Resolved Resolved
Resolution: Won't Fix
Priority: Major Major
Assignee: Steve Loughran
Reporter: Steve Loughran
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
SmartFrog

SF is trying to deploy over IPv6, when it shouldn't

Created: 30/Apr/09 12:30 PM (BST)   Updated: 20/Jun/09 12:44 PM (BST)
Return to search
Component/s: .sfCore, _service_hadoop
Affects Version/s: 3.17.010
Fix Version/s: None

Time Tracking:
Not Specified

Issue Links:
Metabug
 

Compatibility: unknown


 Description  « Hide
I get an error trying to deploy to a VM:
 Exception creating connection to: 0:0:0:0:0:0:0:1; nested exception is:
   [deploy] java.net.SocketException: Protocol family unavailable


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Steve Loughran added a comment - 30/Apr/09 12:31 PM (BST)
Full stack trace
   [deploy] - FAILED when trying DEPLOY of 'cluster', [/org/smartfrog/extras/hadoop/cluster/cluster.sf], host:16.25.169.167
   [deploy] Result:
   [deploy] * Exception: 'SmartFrogException:: java.rmi.ConnectIOException: Exception creating connection to: 0:0:0:0:0:0:0:1; nested exception is:
   [deploy] java.net.SocketException: Protocol family unavailable
   [deploy] SmartFrog 3.17.008 (2009-04-29 17:20:32 BST)'
   [deploy] * StackTrace: '
   [deploy] SmartFrogException:: java.rmi.ConnectIOException: Exception creating connection to: 0:0:0:0:0:0:0:1; nested exception is:
   [deploy] java.net.SocketException: Protocol family unavailable, SmartFrog 3.17.008 (2009-04-29 17:20:32 BST)
   [deploy] at org.smartfrog.sfcore.common.SmartFrogException.forward(SmartFrogException.java:92)
   [deploy] at org.smartfrog.sfcore.common.ActionDeploy.Deploy(ActionDeploy.java:192)
   [deploy] at org.smartfrog.sfcore.common.ActionDeploy.doDeploy(ActionDeploy.java:297)
   [deploy] at org.smartfrog.sfcore.common.ActionDeploy.execute(ActionDeploy.java:272)
   [deploy] at org.smartfrog.sfcore.common.ConfigurationAction.execute(ConfigurationAction.java:113)
   [deploy] at org.smartfrog.sfcore.common.ConfigurationDescriptor.execute(ConfigurationDescriptor.java:1076)
   [deploy] at org.smartfrog.SFSystem.runConfigurationDescriptor(SFSystem.java:367)
   [deploy] at org.smartfrog.SFSystem.runConfigurationDescriptor(SFSystem.java:346)
   [deploy] at org.smartfrog.SFSystem.runConfigurationDescriptors(SFSystem.java:303)
   [deploy] at org.smartfrog.SFSystem.runSmartFrog(SFSystem.java:591)
   [deploy] at org.smartfrog.SFSystem.execute(SFSystem.java:434)
   [deploy] at org.smartfrog.SFSystem.main(SFSystem.java:395)
   [deploy] Caused by: java.rmi.ConnectIOException: Exception creating connection to: 0:0:0:0:0:0:0:1; nested exception is:
   [deploy] java.net.SocketException: Protocol family unavailable
   [deploy] at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:614)
   [deploy] at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
   [deploy] at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
   [deploy] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
   [deploy] at org.smartfrog.sfcore.processcompound.ProcessCompoundImpl_Stub.sfDeployComponentDescription(Unknown Source)
   [deploy] at org.smartfrog.sfcore.common.ActionDeploy.Deploy(ActionDeploy.java:155)
   [deploy] ... 10 more
   [deploy] Caused by: java.net.SocketException: Protocol family unavailable
   [deploy] at java.net.PlainSocketImpl.socketConnect(Native Method)
   [deploy] at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
   [deploy] at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
   [deploy] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
   [deploy] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
   [deploy] at java.net.Socket.connect(Socket.java:518)
   [deploy] at java.net.Socket.connect(Socket.java:468)
   [deploy] at java.net.Socket.<init>(Socket.java:365)
   [deploy] at java.net.Socket.<init>(Socket.java:179)
   [deploy] at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
   [deploy] at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
   [deploy] at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
   [deploy] ... 15 more
   [deploy] ALL: SmartFrogException: java.rmi.ConnectIOException: Exception creating connection to: 0:0:0:0:0:0:0:1; nested exception is:

Steve Loughran added a comment - 30/Apr/09 12:33 PM (BST)
The target machine has IPv6 installed, and if you look at the daemon's gui, it says its name is rosyth_0:0:0:0:0:1

[smartfrog@rosyth ~]$ /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:C9:14:95
          inet addr:16.25.169.167 Bcast:16.25.171.255 Mask:255.255.252.0
          inet6 addr: fe80::20c:29ff:fec9:1495/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:76034 errors:5 dropped:5 overruns:0 frame:0
          TX packets:5945 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:45860297 (43.7 MiB) TX bytes:425988 (416.0 KiB)
          Interrupt:67 Base address:0x2000

eth1 Link encap:Ethernet HWaddr 00:0C:29:C9:14:9F
          UP BROADCAST MULTICAST MTU:1500 Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
          Interrupt:67 Base address:0x2080

lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:2066 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2066 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3382840 (3.2 MiB) TX bytes:3382840 (3.2 MiB)

The local developer machine that is trying to deploy does have ipV6 enabled.

Steve Loughran added a comment - 30/Apr/09 12:34 PM (BST)
-the obvious workaround is to disable IPv6. But it raises some questions
1. Why is RMI defaulting to IPv6 and ::1 as the address?
2. If it is, why isn't it listening on that port/

Steve Loughran added a comment - 30/Apr/09 12:38 PM (BST)
turn off ipv6 by editing /etc/modprobe.conf and adding two lines

alias net-pf-10 off
alias ipv6 off

Steve Loughran added a comment - 30/Apr/09 12:45 PM (BST)
Part of the problem is /etc/hosts, that binds localhost to a ::1 address. This must be deleted

Also, remove the "rosyth" entry there, as that was what was binding the local hostname to ::1. Hostname lookup should be via DNS, or, if you are in a VM-centric world, via explicit /etc/hosts entries everywhere. Not with machine names bound to localhost. This is wrong.

Steve Loughran added a comment - 20/Jun/09 10:08 AM (BST)
the solution is to insert the following option into setSFEnvVariables.sh

#IPv4 only, please
export SF_OPTS="-Djava.net.preferIPv4Stack=true"

and in build.properties (for testing)
daemon.jvmargs="-Djava.net.preferIPv4Stack=true"

this switches SF to IPv4 only. I'm not going to stick this setting into bin/default.ini (yet), though it is tempting.

Steve Loughran added a comment - 20/Jun/09 10:09 AM (BST)
Linking to the Hadoop problem. The fix is the same.

Steve Loughran added a comment - 20/Jun/09 12:44 PM (BST)
resolving as wontfix; there is a workaround.