Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection refused in Docker Compose network #39

Open
JonasHiltl opened this issue Dec 8, 2021 · 2 comments
Open

Connection refused in Docker Compose network #39

JonasHiltl opened this issue Dec 8, 2021 · 2 comments
Labels
dependencies Issues about a dependency

Comments

@JonasHiltl
Copy link

JonasHiltl commented Dec 8, 2021

I have a Node.js application and Neo4j running through docker compose, they are in the same network so I thought I wouldn't encounter any issues. But neogma fails to connect to Neo4j. It works just fine without docker through localhost.

This is my bolt connection string: bolt://neo4j:7687.
neo4j is the name of the docker compose service and it just uses the ip address of the docker service.

This is the error message

Neo4jError: Failed to connect to server. Please ensure that your database is listening on the correct host and port and that you have compatible encryption settings both on Neo4j server and driver. Note that the default encryption setting has changed in Neo4j 4.0. Caused by: connect ECONNREFUSED 192.168.192.4:7687

As you can see in the error message (ECONNREFUSED 192.168.192.4:7687), docker successfully routes to the ip of the Neo4j container by just specifying the container name. So I'm unsure what could cause this connection issue.

This probably is not caused by neogma but rather by the underlying driver.

@themetalfleece
Copy link
Owner

themetalfleece commented Dec 8, 2021

Yes this shouldn't be related to Neogma, as it just uses neo4j-driver for connection-related stuff. I'll try this on my own at some point.
Until then, could you try refering to threads like this, in case you find anything useful?

Also, is there any chance that Neogma tries to connect to Neo4j before it's ready?

@JonasHiltl
Copy link
Author

The Node.js docker service depends on neo4j, so it waits on it to start up. This issue is also tracking the same error, but not solved since half a year.

@themetalfleece themetalfleece added the dependencies Issues about a dependency label Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Issues about a dependency
Projects
None yet
Development

No branches or pull requests

2 participants