[Neo4j 3.0.6] Impossible to connect to remote shell

140 views
Skip to first unread message

Pierre-Alexandre Voye

unread,
Sep 22, 2016, 11:02:32 AM9/22/16
to Neo4j
Hi, I have a strange bug as I'm unable to connect to remote shell with neo4j 3.0.6 from a machine A to B. The server B (ip address192.168.10.204)  hosts Neo4j.

First, dbms.shell.enabled=true and dbms.shell.host=0.0.0.0 (and port) are of course set in neo4j.conf

I dig into this bug and got several situations.

At the begining, when I launched shell in machine A :

Shell$ ./neo4j-shell -host 192.168.10.204 -port 1337 -v

Welcome to the Neo4j Shell! Enter 'help' for a list of commands
NOTE: Remote Neo4j graph database service 'shell' at port 1337

neo4j-sh (?)$ return "1";
Connection refused to host: 127.0.1.1; nested exception is:
    java.net.ConnectException: Connection refused
neo4j-sh (?)$
Shell$

Digging deeply in this bug, I played with /etc/hosts file and RMI flags and tried different things (for instance by commenting line with 127.0.1.1 address)

My situation now :
/etc/hosts
127.0.0.1    localhost
127.0.1.1    debian-jessie.vagrantup.com    debian-jessie

The flags I add in neo4j-wrapper.conf are these :
-Djava.rmi.server.hostname=debian-jessie.vagrantup.com -Dremoting.bind_by_host=false


With these flags, Neo4j start. If I set -Djava.rmi.server.hostname=0.0.0.0  it refused to start:

Caused by: java.rmi.UnknownHostException: Unknown host: 0.0.0.0; nested exception is:
    java.net.UnknownHostException: debian-jessie: debian-jessie: unknown error

Now Neo4j accept to start, I can try to connect remotely, so I get :

$ ./neo4j-shell -host 192.168.10.204 -port 1337 -v
ERROR (-v for expanded information):
    Unknown host: debian-jessie.vagrantup.com; nested exception is:
    java.net.UnknownHostException: debian-jessie.vagrantup.com
java.rmi.UnknownHostException: Unknown host: debian-jessie.vagrantup.com; nested exception is:
    java.net.UnknownHostException: debian-jessie.vagrantup.com
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:616)

I tested a random port (like 50587, RMI used to use these kind of ports) to know if they are closed by default in my linux, and they are open.

I don't know what to do...

Any advices ?

By advance, thank you

Regards

Pierre-Alexandre Voye

unread,
Sep 22, 2016, 2:13:40 PM9/22/16
to Neo4j
Information I can give afk :
Linux Debian 8
Java 8

Pierre-Alexandre Voye

unread,
Sep 23, 2016, 3:44:12 AM9/23/16
to Neo4j

Here the stacktrace of the failed connection, when I launch 'neo4j-shell -host 192.168.10.204 -port 1337 -v'

ERROR (-v for expanded information):
    Unknown host: debian-jessie.vagrantup.com; nested exception is:
    java.net.UnknownHostException: debian-jessie.vagrantup.com
java.rmi.UnknownHostException: Unknown host: debian-jessie.vagrantup.com; nested exception is:
    java.net.UnknownHostException: debian-jessie.vagrantup.com
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:616)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:130)
    at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)
    at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)
    at com.sun.proxy.$Proxy1.welcome(Unknown Source)
    at org.neo4j.shell.impl.AbstractClient.sayHi(AbstractClient.java:257)
    at org.neo4j.shell.impl.RemoteClient.findRemoteServer(RemoteClient.java:70)
    at org.neo4j.shell.impl.RemoteClient.<init>(RemoteClient.java:62)
    at org.neo4j.shell.impl.RemoteClient.<init>(RemoteClient.java:45)
    at org.neo4j.shell.ShellLobby.newClient(ShellLobby.java:204)
    at org.neo4j.shell.StartClient.startRemote(StartClient.java:358)
    at org.neo4j.shell.StartClient.start(StartClient.java:229)
    at org.neo4j.shell.StartClient.main(StartClient.java:147)
Caused by: java.net.UnknownHostException: debian-jessie.vagrantup.com
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at java.net.Socket.connect(Socket.java:538)
    at java.net.Socket.<init>(Socket.java:434)
    at java.net.Socket.<init>(Socket.java:211)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
    ... 14 more

Benoît Simard

unread,
Sep 27, 2016, 4:20:29 PM9/27/16
to ne...@googlegroups.com

Hi PA

I haven't tried to reproduce your problem.

But I can tell you that in the next version (3.1) the shell is completely rewrite and will be based on bolt  (no RMI anymore).

Cheers.


--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages