Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-27-2020 03:24 AM
Hi everyone!
The problem: I get an errno 111: no connection between the python client and the activated neo4j graph db. Same situation with both py2neo and neo4j python driver
The setup: WSL2 (build 4.19.121.1) with Ubuntu 18.04 LTS, on windows 10 Pro insider preview (build 20152.rs_prelease.200617-1502)
On WSL2, a conda env was created with py2neo, rapidsai, etc. On windows, neo4j and pycharm are installed. The code is written in pycharm and as an interpreter I use the conda env from WSL2. However, every time I'm trying to run a query, I get an errno 111 error message. Queries from the neo4j interface run smoothly.
The code:
graph = Graph("bolt://localhost:7687", auth=("user", "pass"), max_connection_lifetime=200)
q1 = """ CALL apoc.periodic.iterate( "MATCH (n:Person) RETURN n", "DETACH DELETE n", {batchSize:1000})
"""output = graph.run(q1).to_data_frame()
The problem appears in line 3. What would cause this issue?
Neo4j desktop 1.2.9
DB version: 3.5.17 and 3.5.19 were tried
Thanks!
Andreas
06-28-2020 03:13 AM
Sounds like there is some sort of connectivity issue.
Do I understand it correctly if I think the database is running natively in Windows and your script in the WSL environment?
Not familiar with WSL at all but I would suspect that the localhost of WSL is a different one than the windows environment. Perhaps I am completely wrong though, haven't seen Windows from up close for over 15 years.
However that 111 error is a Python connection error, I would dig into that direction.
01-03-2021 09:32 AM
WSL works with a neo4j docker instance.
It does not work with Neo4j desktop instances. Not sure why it fails even with all of the configuration matching for the docker image. Probably something related to the bolt protocol.
Steps to get it working
docker pull neo4j:latest
Run this in docker to connect your WSL ports correctly.
# This script spins up a docker instance
INSTANCE_NAME="neo4j-server"
PASSWORD="your-password"
docker run \
--name $INSTANCE_NAME \
-p7474:7474 -p7687:7687 \
--env NEO4J_dbms_connector_https_advertised__address="localhost:7473" \
--env NEO4J_dbms_connector_http_advertised__address="localhost:7474" \
--env NEO4J_dbms_connector_bolt_advertised__address="localhost:7687" \
--env NEO4J_AUTH=neo4j/$PASSWORD \
neo4j:latest
01-09-2021 05:23 AM
Hi @FrederickEngelhardt, thanks for the answer! I would try your suggestion if I hadn't switched to linux.
In case I switch back to that setup I'll give it a try 🙂
01-03-2021 07:00 PM
Errno 111 is "Connection refused". So, my guess is there is some permissions problem, such that the DB is not happy with the client that's trying to connect to it.
Maybe bad config or bad username/password?
01-06-2021 09:37 AM
Hi @and.manousakis, at which environment you are getting this error ? on the WSL2 or on Windows ? Also, you mentioned py2neo is installed only in conda, but I am sure you have already installed in windows also.
Also, since you mentioned WSL2, I believe you have docker also installed. So, follow @FrederickEngelhardt steps, but be sure to mount the volume to persist the data. Since you are using Neo4j 3.5, feel free to download my image and the docker-compose file
Let me know if you need further assistance.
All the sessions of the conference are now available online