Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-24-2020 04:41 PM
Hello,
I have written a python script to execute queries on a remote Neo4j server. However, after updating my version of Neo4j last week I am having a difficult time connecting to the Neo4j database and, consequently, running my queries against it. I've tried bolt based and http based connections but to no avail. I've checked my neo4j.conf file to confirm that it matches my previous version where I could connect.
Below you will find the relevant section of my .conf file and the .log file where database start up and remote interface is successful., can someone help my troubleshoot my connection problems?
2020-02-25 00:30:54.128+0000 INFO ======== Neo4j 3.5.14 ========
2020-02-25 00:30:54.134+0000 INFO Starting...
2020-02-25 00:30:56.670+0000 INFO Deprecated index providers in use: lucene+native-2.0 (15 indexes). Use procedure 'db.indexes()' to see what indexes use which index provider.
2020-02-25 00:31:00.778+0000 INFO Bolt enabled on 0.0.0.0:7687.
2020-02-25 00:31:01.816+0000 INFO Started.
2020-02-25 00:31:02.849+0000 INFO Remote interface available at http://<MY IP>:7474/
#*****************************************************************
#Network connector configuration
#*****************************************************************
#With default configuration Neo4j only accepts local connections.
#To accept non-local connections, uncomment this line:
dbms.connectors.default_listen_address=0.0.0.0
#dbms.connectors.default_listen_address=localhost
#You can also choose a specific network interface, and configure a non-default
#port for each connector, by setting their individual listen_address.
#The address at which this server can be reached by its clients. This may be the server's IP address or DNS name, or
#it may be the address of a reverse proxy which sits in front of the server. This setting may be overridden for
#individual connectors below.
#dbms.connectors.default_advertised_address=localhost
#dbms.connectors.default_advertised_address=0.0.0.0
dbms.connectors.default_advertised_address=<MY IP>
#You can also choose a specific advertised hostname or IP address, and
#configure an advertised port for each connector, by setting their
#individual advertised_address.
#Bolt connector
dbms.connector.bolt.enabled=true
#dbms.connector.bolt.tls_level=OPTIONAL
dbms.connector.bolt.listen_address=:7687
#HTTP Connector. There can be zero or one HTTP connectors.
dbms.connector.http.enabled=true
dbms.connector.http.listen_address=<MY IP>:7474
#HTTPS Connector. There can be zero or one HTTPS connectors.
dbms.connector.https.enabled=true
#dbms.connector.https.listen_address=:7473
#Number of Neo4j worker threads.
#dbms.threads.worker_count=
You can see that I was messing with the local connection in my default_advertised_address section.
Thanks for the help!
02-26-2020 08:02 AM
Looks fine to me.
<my IP>
, and to what connector/port?02-26-2020 10:20 AM
In Python I was using the neo4j-connector method. It was working successfully with the local host connection (when I was running my computations on the same server as my hosted Neo4j graph.) However, I want to avoid graph and computation work on the same server to avoid crashing, etc.
When I was attempting to a nonlocalhost based connection I used the following port. IP-wise, we are using a AWS instance based IP address.
neo4j-connector
import neo4j
from neo4j import Connector
from neo4j import Statement
connector = neo4j.Connector('http:// MY IP :7474', (name, pw))
The error was as connection time out error and I ran into while working through a debugger on VScode and just running program.
Unfortunately, I didn't see anything in the Neo4j logs.
Thanks!
02-26-2020 10:40 AM
... nonlocalhost based connection... using a AWS instance... IP address.
connector = neo4j.Connector('http:// MY IP :7474', (name, pw))
You'll need to check a few things:
http:// MY IP :7474
, and get to that Neo4j instance?neo4j.conf
connector config
dbms.connectors.default_listen_address= MY IP
dbms.connectors.default_advertised_address= MY IP
Once you're going from machine to machine, hostnames will simplify networking. A simple temp shortcut is to set default_advertised_address=anynameyouwant
, then add that as an entry to your hosts
file: MY IP anynameyouwant
. Then you could simply connect to http://anynameyouwant:7474
.
02-28-2020 12:12 PM
Hey there, so I changed the values:
dbms.connectors.default_listen_address=
dbms.connectors.default_advertised_address=
to the respective IP address where I my graph db is stored.
Additionally, I verified that I am using the right IP and that my basic connectivity works from the browser. (On the note of the browser, I am able to connect from a browser on another machine and from the machine where the graph db is hosted.)
However, I am still seeing a failure as shown below:
requests.exceptions.ConnectionError: HTTPConnectionPool(host=' MY IP', port=7474): Max retries exceeded with url: /db/data/transaction/commit (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f60fb350898>: Failed to establish a new connection: [Errno 110] Connection timed out',)
Will changing the host name work in this case?
02-28-2020 12:48 PM
Additionally, I tried using the bolt connector to troubleshoot but it failed as well. The error was:
I checked my conf files and my log files again to make sure it was enabled as well and it was according to below.
2020-02-28 19:58:57.515+0000 INFO ======== Neo4j 3.5.14 ========
2020-02-28 19:58:57.531+0000 INFO Starting...
2020-02-28 19:59:02.946+0000 INFO Deprecated index providers in use: lucene+native-2.0 (15 indexes). Use procedure 'db.indexes()' to see what indexes use which index provider.
2020-02-28 19:59:11.567+0000 INFO Bolt enabled on :7687.
2020-02-28 19:59:13.922+0000 INFO Started.
2020-02-28 19:59:15.934+0000 INFO Remote interface available at http:// :7474/
#With default configuration Neo4j only accepts local connections.
#To accept non-local connections, uncomment this line:
#dbms.connectors.default_listen_address=0.0.0.0
dbms.connectors.default_listen_address= < MY IP >
#dbms.connectors.default_listen_address=localhost
#You can also choose a specific network interface, and configure a non-default
#port for each connector, by setting their individual listen_address.
#The address at which this server can be reached by its clients. This may be the server's IP address or DNS name, or
#it may be the address of a reverse proxy which sits in front of the server. This setting may be overridden for
#individual connectors below.
#dbms.connectors.default_advertised_address=localhost
#dbms.connectors.default_advertised_address=0.0.0.0
dbms.connectors.default_advertised_address= < MY IP >
#You can also choose a specific advertised hostname or IP address, and
#configure an advertised port for each connector, by setting their
#individual advertised_address.
#Bolt connector
dbms.connector.bolt.enabled=true
#dbms.connector.bolt.tls_level=OPTIONAL
dbms.connector.bolt.listen_address=:7687
#HTTP Connector. There can be zero or one HTTP connectors.
dbms.connector.http.enabled=true
dbms.connector.http.listen_address=:7474
#HTTPS Connector. There can be zero or one HTTPS connectors.
dbms.connector.https.enabled=true
#dbms.connector.https.listen_address=:7473
02-28-2020 01:58 PM
I can't see a reason why you wouldn't be able to connect to the Neo4j instance.
Will changing the host name work in this case?
Using a hostname to connect probably will not solve this issue, but it might be worth a try anyway.
The browser uses those same ports and hosts, so if it can connect to bolt, your app shouldn't have any trouble. Maybe the script, or the environment it is ran in, is blocking or redirecting the traffic. Might also be worth checking local machine firewalls. Failing that, wireshark.
02-28-2020 03:05 PM
Ok, I'll check it out. Thanks.
02-28-2020 05:52 PM
Can you please check the debug.log and security.log to see if you see any errors.
03-02-2020 09:20 AM
I did and I wasn't seeing any connection errors
All the sessions of the conference are now available online