# Cypher-shell - Connection to the database terminated

**URL:** <https://community.neo4j.com/t/cypher-shell-connection-to-the-database-terminated/39471>\
**Category:** Installation\
**Created:** [June 7, 2021, 2:57pm UTC](https://community.neo4j.com/t/cypher-shell-connection-to-the-database-terminated/39471 "2021-06-07T14:57:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve.shadbolt](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/steve.shadbolt/32/3933_2.png) [@steve.shadbolt](https://community.neo4j.com/u/steve.shadbolt)\
**Post date:** [June 7, 2021, 2:57pm UTC](https://community.neo4j.com/t/cypher-shell-connection-to-the-database-terminated/39471/1 "2021-06-07T14:57:45Z")

</div>

Last year I took some [advice from the forum](https://community.neo4j.com/t/cypher-shell-compatibility/22502) 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:

```auto
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:

```auto
        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.

---

<div class="post-metadata">

**Author:** ![dana\_canzano](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/dana_canzano/32/27392_2.png) [@dana\_canzano](https://community.neo4j.com/u/dana_canzano)\
**Post date:** [June 7, 2021, 7:31pm UTC](https://community.neo4j.com/t/cypher-shell-connection-to-the-database-terminated/39471/2 "2021-06-07T19:31:29Z")

</div>

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

```auto
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

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

```

if you run

```auto
cypher-shell -debug

```

does this provide more detail of the failure

---

<div class="post-metadata">

**Author:** ![steve.shadbolt](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/steve.shadbolt/32/3933_2.png) [@steve.shadbolt](https://community.neo4j.com/u/steve.shadbolt)\
**Post date:** [June 7, 2021, 8:47pm UTC](https://community.neo4j.com/t/cypher-shell-connection-to-the-database-terminated/39471/3 "2021-06-07T20:47:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dana\_canzano](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/dana_canzano/32/27392_2.png) [@dana\_canzano](https://community.neo4j.com/u/dana_canzano)\
**Post date:** [June 7, 2021, 9:46pm UTC](https://community.neo4j.com/t/cypher-shell-connection-to-the-database-terminated/39471/4 "2021-06-07T21:46:15Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![steve.shadbolt](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/steve.shadbolt/32/3933_2.png) [@steve.shadbolt](https://community.neo4j.com/u/steve.shadbolt)\
**Post date:** [June 8, 2021, 5:39am UTC](https://community.neo4j.com/t/cypher-shell-connection-to-the-database-terminated/39471/5 "2021-06-08T05:39:49Z")

</div>

@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.

```auto
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.

---

<div class="post-metadata">

**Author:** ![steve.shadbolt](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/steve.shadbolt/32/3933_2.png) [@steve.shadbolt](https://community.neo4j.com/u/steve.shadbolt)\
**Post date:** [June 14, 2021, 6:46am UTC](https://community.neo4j.com/t/cypher-shell-connection-to-the-database-terminated/39471/6 "2021-06-14T06:46:20Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![steve.shadbolt](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/steve.shadbolt/32/3933_2.png) [@steve.shadbolt](https://community.neo4j.com/u/steve.shadbolt)\
**Post date:** [July 22, 2021, 6:18am UTC](https://community.neo4j.com/t/cypher-shell-connection-to-the-database-terminated/39471/7 "2021-07-22T06:18:09Z")

</div>

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

```auto
# cypher-shell --encryption false

```

I would suggest it needs a better error message here.
