Connection to the database terminated (after upgrading to 1.2.4)

A couple of days ago after a restart of my Mac (OSX 10.15.2) Neo4j Desktop prompted me to update.

The upgraded version would not start because it requires Java 11. I have now installed Java 11 (and fixed the various issues in the code relating to that).

There was another problem with starting Neo4j Desktop after letting it perform the upgrade (which is not the subject of this post) and so I uninstalled and downloaded afresh and reinstalled. I am now running Neo4j Desktop Version 1.2.4.1101. The browser refused to connect to the existing database so I deleted it and created a new one.

I am now able to view the new database through the browser, however when I try to start up my Spring Boot application I get the following error:

org.neo4j.driver.v1.exceptions.ServiceUnavailableException: Connection to the database terminated. This can happen due to network instabilities, or due to restarts of the database

I can still connect correctly to a remote database without any problems.

Here are my project's dependencies:

		<dependency>
			<groupId>org.neo4j</groupId>
			<artifactId>neo4j</artifactId>
			<version>3.5.12</version>
		</dependency>

		<dependency>
			<groupId>org.neo4j.driver</groupId>
			<artifactId>neo4j-java-driver</artifactId>
			<version>1.7.5</version>
		</dependency>

The failure happens at the point where the code tries to obtain a database driver:

databaseDriver = GraphDatabase.driver(connectionURL, AuthTokens.basic(username, password));

Please advise how I can get my Spring Boot application talking to my local database again.

Paul

Hi Paul,

Desktop brings it's own java version, not sure where/how you were required to update?

Can you disable encryption in your for the driver for local development?

For production you should add a certificate to your sever.

Hi Michael

Thanks for your response. It is working again now using the 4.0.0 release of the driver libraries. There were a few imports to fix now the v1 packages have been replaced and the syntax for parameters has changed from {} to $ - but otherwise everything looks ok.

Paul

2 Likes

Hi Paul,

I was actually wondering, what particular things did you do to fix your issue? I've been struggling with same issue, and can't quite figure out how to go about resolving it. Would you happen to have any docs or references you could point me to, which you used to resolve your issue?

Any help would be much appreciated,
Dengke

Hi Dengke

I think I was unlucky to have had components out of step just at the point of a major release of Neo4j. The solution was to install the latest driver and the latest browser then everything settled down. I am now running Desktop 1.2.4, with dependencies in the pom on 3.5.12 neo4j and 4.0.0 neo4j-java-driver and it has been stable since my original post. I hope this is of some help.

Paul

1 Like

Hi Paul,

Thank you so much for your assistance! I have managed to trace down the issue now :smile: While my issue ended up being something rather different, your reply helped me check a few things and narrow the issue down to what it wasn't (and so make it easier for me to track down what the issue was).

Much appreciation,
Dengke

1 Like