I am having difficulty connecting to Neo4j running in a Docker container from python in a different Docker container on Ubuntu 18.04. Here are some details:
Creating the container
$ sudo docker run
--name Neo4j.4C
-p27474:7474
-d
--env=NEO4J_AUTH=none
--memory=6G neo4j:4.0.3
TEST 1: With the proper python packages (neo4j/py2neo)- I am able to connect to Neo4j successfully from the host machine
>>> from py2neo import Graph
>>> graph = Graph('http://127.0.0.1:27474/')
>>> graph.run('MATCH (x) RETURN COUNT(x)').data() # <- THIS WORKS
TEST 2: However, I am not able to make a similar connection from python within a separate Docker container:
>>> from py2neo import Graph
>>> graph = Graph('http://172.17.0.1:27474/')
>>> graph.run('MATCH (x) RETURN COUNT(x)') # <- HANGS
Within the Neo4j container, I do not see anything under /var/lib/neo4j/logs/debug.log. the last two entries are from startup:
2020-04-26 15:19:42.179+0000 INFO [o.n.s.AbstractNeoServer$ServerComponentsLifecycleAdapter] [system] Starting web server
2020-04-26 15:19:44.809+0000 INFO [o.n.s.AbstractNeoServer$ServerComponentsLifecycleAdapter] [system] Web server started.
Two questions:
- Has anybody else encountered this issue or have any ideas?
- Is there are way to enable more verbose logging within the Neo4j docker that would help troubleshooting?
Thanks in advance for any ideas here.