Cypher-shell - Connection to the database terminated

Last year I took some advice from the forum on which version of cypher-shell to install on a platform with a packaged version of neo4j v3.4.1 enterprise. The answer was 1.1.13 and it worked well.

I now have a new platform where neo4j has moved on to version 3.5.19. I checked the changelog for neo4j and predicted that the version of cypher-shell would either be 1.1.13 or 1.1.14. I have tried both on my new platform but neither is able to connect.

The default address of bolt://localhost:7687 should be valid but in both versions it fails with:

Connection to the database terminated. This can happen due to network instabilities, or due to restarts of the database

With --debug qualifier, this extra stack trace comes:

        at org.neo4j.driver.internal.util.Futures.blockingGet(Futures.java:123)
        at org.neo4j.driver.internal.DriverFactory.verifyConnectivity(DriverFactory.java:349)
        at org.neo4j.driver.internal.DriverFactory.newInstance(DriverFactory.java:95)
        at org.neo4j.driver.v1.GraphDatabase.driver(GraphDatabase.java:141)
        at org.neo4j.driver.v1.GraphDatabase.driver(GraphDatabase.java:124)
        at org.neo4j.shell.state.BoltStateHandler.getDriver(BoltStateHandler.java:225)
        at org.neo4j.shell.state.BoltStateHandler.connect(BoltStateHandler.java:102)
        at org.neo4j.shell.CypherShell.connect(CypherShell.java:129)
        at org.neo4j.shell.Main.connectMaybeInteractively(Main.java:126)
        at org.neo4j.shell.Main.startShell(Main.java:90)
        at org.neo4j.shell.Main.main(Main.java:40)
        Suppressed: org.neo4j.driver.internal.util.ErrorUtil$InternalExceptionCause
                at org.neo4j.driver.internal.util.ErrorUtil.newConnectionTerminatedError(ErrorUtil.java:50)
                at org.neo4j.driver.internal.async.HandshakeHandler.channelInactive(HandshakeHandler.java:81)
                at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245)
                at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231)
                at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:224)
                at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:377)
                at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:342)
                at org.neo4j.driver.internal.shaded.io.netty.handler.ssl.SslHandler.channelInactive(SslHandler.java:1010)
                at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245)
                at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231)
                at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:224)
                at org.neo4j.driver.internal.shaded.io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:75)
                at org.neo4j.driver.internal.shaded.io.netty.handler.timeout.IdleStateHandler.channelInactive(IdleStateHandler.java:277)
                at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245)
                at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231)
                at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:224)
                at org.neo4j.driver.internal.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1409)
                at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245)
                at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231)
                at org.neo4j.driver.internal.shaded.io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:927)
                at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannel$AbstractUnsafe$8.run(AbstractChannel.java:822)
                at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
                at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
                at org.neo4j.driver.internal.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
                at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)
                at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
                at java.lang.Thread.run(Thread.java:748)

Can anyone confirm the compatibility and / or advise on what might be wrong ?

Thanks.

similar to the post of last year you linked from, which indicated

From https://neo4j.com/docs/operations-manual/current/tools/cypher-shell/ 5
"Cypher Shell is a command-line tool that comes with the Neo4j installation. It can also be downloaded from Neo4j Download Center 6 and installed separately."

and so if you have 3.5.19 running you should be able to run from the $NEO4J_HOME/bin directory so as to determine what version of cypher-shell is included, for example

~/single/instance1/neo4j-enterprise-3.5.19/bin$ ./cypher-shell -v
Cypher-Shell 1.1.13

if you run

cypher-shell -debug

does this provide more detail of the failure

Hi Dana. As per the last time I wrote, our instance of neo4j is cut-down and packaged with a bigger application, and does not include cypher-shell. That is why I am trying to add it separately to the platform, and why I can't check the version for myself.

The stack trace I posted in my base note is what came with the --debug qualifier.

I am sure the address string is correct as it is exactly what I see when connecting successfully to the neo4j browser.

@steve.shadbolt hmm
how else is

our instance of neo4j is cut-down and packaged with a bigger application

i.e. does it include the standard Neo4j jar files but not cypher-shell. Or are you excluding much more?

@dana.canzano I am not sure what is included and what is excluded though I might be able to approach our product team to find out, if it is important.

I did a search of the server and found 83 .jar files with "neo4j" in their name. e.g.

neo4j-common-3.5.19.jar
neo4j-concurrent-3.5.19.jar
neo4j-csv-3.5.19.jar
neo4j-cypher-3.5.19.jar

Like I say, cypher-shell worked fine with the earlier version, as per my post last year.

@dana.canzano , or anyone else, do you have any suggestions on how to solve or troubleshoot this issue ? I really need to get it working.

Thanks and regards, Steve

A colleague found the solution to this issue. Encryption seems to be enabled by default, so this command qualifier fixes it:

# cypher-shell --encryption false

I would suggest it needs a better error message here.