As described on Stackoverflow I have an issue which might be caused by some versions of Spring Boot dependencies.
I have a Spring Boot app on version 2.2.4, which can connect to a local Docker instance of Neo4J. Also in a CI/CD pipeline, the app connects correctly to the docker. The problem arises when trying to connect to a neo4j vm instance on the Google Cloud Platform. The first thing that came to mind was a faulty network configuration, but after triple checking everything I tried with a very basic spring boot app which happened to run on version 2.0.5. With that project I could connect to every instance both locally and in the cloud. After that I ported the dependencies and app configuration one by one to my 2.2.4 app. It didn't work. Then when I tried version 2.0.5 there it worked again.
This is my build.gradle:
-> I also tried removing the org.neo4j.driver dependency as someone mentioned in the comments.
This are the versions that are effectively installed:
And here is my application.properties:
spring.data.neo4j.uri=bolt://35.xxx.xxx.xxx:7687 # <- in prod
spring.data.neo4j.uri=bolt://localhost:7687 # <- in dev
spring.data.neo4j.uri=bolt://neo4j:7687 # <- in CI/CD
spring.data.neo4j.username=neo4j
spring.data.neo4j.password=****
spring.data.neo4j.embedded.enabled=false
Comment From: mbhave
I don't think there's anything in Spring Boot itself that would cause this. If there is a bug, it would most likely be something in neo4j or Spring Data Neo4j.
@mp911de Would it be worth opening an issue in Spring Data Neo4j to investigate further?
Comment From: mp911de
According to the stack trace, it looks like an I/O issue somewhere near the driver. Paging @michael-simons.
We can close this issue here.
Comment From: wilkinsona
Thanks, @mp911de.
Comment From: jclaessens97
FYI, updated with a solution that worked for me, not sure if it's of any interest for you guys but I'll just leave it here: https://stackoverflow.com/questions/60283634/neo4j-connection-timed-out-in-spring-boot-2-2-4-but-not-in-2-0-5/60430904#60430904