Not able to connect to running instance of neo4j using neo4j-shell

2,233 views
Skip to first unread message

Henry Hwangbo

unread,
Jul 12, 2013, 1:20:48 PM7/12/13
to ne...@googlegroups.com
I'm running Neo4j Community Edition 1.9GA and I'm having no success connecting to a running instance of Neo4j.  It works on my local machine without problems. Here's what I've tried and the following errors:

sudo neo4j-shell -v
ERROR (-v for expanded information):
        Connection refused
java.rmi.ConnectException: Connection refused to host: 172.16.3.125; nested exception is: 
        java.net.ConnectException: Connection timed out
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
        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:128)
        at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:194)
        at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:148)
        at com.sun.proxy.$Proxy1.welcome(Unknown Source)
        at org.neo4j.shell.impl.AbstractClient.sayHi(AbstractClient.java:227)
        at org.neo4j.shell.impl.RemoteClient.findRemoteServer(RemoteClient.java:63)
        at org.neo4j.shell.impl.RemoteClient.<init>(RemoteClient.java:55)
        at org.neo4j.shell.impl.RemoteClient.<init>(RemoteClient.java:43)
        at org.neo4j.shell.ShellLobby.newClient(ShellLobby.java:161)
        at org.neo4j.shell.StartClient.startRemote(StartClient.java:287)
        at org.neo4j.shell.StartClient.start(StartClient.java:165)
        at org.neo4j.shell.StartClient.main(StartClient.java:117)
Caused by: java.net.ConnectException: Connection timed out
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:579)
        at java.net.Socket.connect(Socket.java:528)
        at java.net.Socket.<init>(Socket.java:425)
        at java.net.Socket.<init>(Socket.java:208)
        at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
        at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:146)
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
        ... 14 more


sudo neo4j-shell -v -path data/graph.db/
ERROR (-v for expanded information):
        org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.StoreLockerLifecycleAdapter@5e8ce525' was successfully initialized, but failed to start. Please see attached cause exception.
java.lang.RuntimeException: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.StoreLockerLifecycleAdapter@5e8ce525' was successfully initialized, but failed to start. Please see attached cause exception.
        at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:281)
        at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:106)
        at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:88)
        at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:207)
        at org.neo4j.shell.kernel.GraphDatabaseShellServer.instantiateGraphDb(GraphDatabaseShellServer.java:151)
        at org.neo4j.shell.kernel.GraphDatabaseShellServer.<init>(GraphDatabaseShellServer.java:61)
        at org.neo4j.shell.StartClient.tryStartLocalServerAndClient(StartClient.java:229)
        at org.neo4j.shell.StartClient.startLocal(StartClient.java:216)
        at org.neo4j.shell.StartClient.start(StartClient.java:155)
        at org.neo4j.shell.StartClient.main(StartClient.java:117)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.StoreLockerLifecycleAdapter@5e8ce525' was successfully initialized, but failed to start. Please see attached cause exception.
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:497)
        at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:104)
        at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:259)
        ... 9 more
Caused by: org.neo4j.kernel.StoreLockException: Could not create lock file
        at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:85)
        at org.neo4j.kernel.StoreLockerLifecycleAdapter.start(StoreLockerLifecycleAdapter.java:40)
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:491)
        ... 11 more

Wes Freeman

unread,
Jul 12, 2013, 1:30:31 PM7/12/13
to ne...@googlegroups.com
For the second error: You can't open shell against a path when server is running against that path also. You'll need to shut down the server first. Note: You might want to run it against the server's config file if you do go this route (with the -config option), else your auto indexes and whatever other settings won't be running.

For the first error:  Do you have a firewall set up on the server (port 1337 needs to be open for the shell)? Do you have it listening on the expected IP (configured in neo4j-server.properties, by default it's only localhost)? It's weird that it's trying to connect to an IP without you specifying (rather than localhost).

Wes

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GPG public key fingerprint registered on keyserver: pgp.mit.edu.

pub 1024D/00FC15DB 2008-06-20
Key fingerprint = 2D6E FAD5 8C75 BB29 F05B DB3A 31B4 6FBB 00FC 15DB
uid Wesley Garrett Freeman (Wes Freeman) <freem...@gmail.com>
sub 2048g/B6956219 2008-06-20



--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

henry74

unread,
Jul 12, 2013, 2:13:35 PM7/12/13
to ne...@googlegroups.com

I looked in neo4j.properties but didn't see any references to the shell.

No firewall running on the server. It is strange it is using an ip address that isn't the loop back.

Telneting directly to the default port does return a response.

I tried using the shell and specifying the host and port, but same problem

You received this message because you are subscribed to a topic in the Google Groups "Neo4j" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/neo4j/8xPwzrg20LE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to neo4j+un...@googlegroups.com.

Michael Hunger

unread,
Jul 12, 2013, 2:35:34 PM7/12/13
to ne...@googlegroups.com
You can put


# Using default values
enable_remote_shell=true
# ...or specify custom port, use default values for the others
enable_remote_shell=port=1234

Henry Hwangbo

unread,
Jul 12, 2013, 3:02:29 PM7/12/13
to ne...@googlegroups.com
I can definitely get to it through telnet using: telnet localhost 1337

So the port is open and it's listening.  It's just strange that the neo4j-shell cannot get to it.  Won't those settings just change the port number?  I'm assuming the remote_shell is enabled if I can telnet to it and get  response...

Michael Hunger

unread,
Jul 12, 2013, 4:55:26 PM7/12/13
to ne...@googlegroups.com
bin/neo4j-shell -host host -port port

Michael

Henry Hwangbo

unread,
Jul 12, 2013, 10:24:24 PM7/12/13
to ne...@googlegroups.com
$ which neo4j-shell 
/usr/bin/neo4j-shell
$ telnet localhost 1337
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
^]
telnet> quit
Connection closed.

$ ping localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64 time=0.018 ms
64 bytes from localhost (127.0.0.1): icmp_req=2 ttl=64 time=0.027 ms
64 bytes from localhost (127.0.0.1): icmp_req=3 ttl=64 time=0.023 ms
64 bytes from localhost (127.0.0.1): icmp_req=4 ttl=64 time=0.027 ms
64 bytes from localhost (127.0.0.1): icmp_req=5 ttl=64 time=0.025 ms
^C
--- localhost ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3997ms
rtt min/avg/max/mdev = 0.018/0.024/0.027/0.003 ms

$ /usr/bin/neo4j-shell -v -host localhost -port 1337
What's going on here?

Henry Hwangbo

unread,
Jul 15, 2013, 4:43:35 PM7/15/13
to ne...@googlegroups.com
Okay so it looks like my /etc/hosts file had a bad IP address for the server name.  I'm not sure how that was set, but once I updated it and restarted neo4j I was able to connect to the shell.  I narrowed it by noticing the error had to do with RMI and figured it couldn't connect to the RMI port because it was using the servername to do an IP lookup and getting a bad IP address.

Who knew.

Peter Neubauer

unread,
Jul 15, 2013, 4:45:34 PM7/15/13
to Neo4j User
Wow,
thanks for getting back with this Henry!

/peter


Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Kids in Malmö this summer?        - http://www.kidscraft.se
Neo4j questions? Use GraphGist. - http://gist.neo4j.org

Mark Needham

unread,
Jul 15, 2013, 4:56:42 PM7/15/13
to ne...@googlegroups.com
Henry,

What command did you eventually use to connect to the shell?

Mark

henry74

unread,
Jul 16, 2013, 12:59:29 AM7/16/13
to ne...@googlegroups.com

Just neo4j-shell

Reply all
Reply to author
Forward
0 new messages