Skip to content

Connection refused in Docker Compose network #39

@JonasHiltl

Description

@JonasHiltl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesIssues about a dependency

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions