- Newest
- Most votes
- Most comments
It appears you're encountering issues connecting to your Neptune cluster using both the Bolt protocol for openCypher and WebSocket for Gremlin. Let's address each of these separately.
For the openCypher connection using Bolt: The issue likely stems from how you're trying to connect. Neptune requires a specific configuration when using Bolt. Instead of using "bolt://" in your connection string, you should use "bolt+s://" to ensure an encrypted connection. Also, you need to set up the driver with the correct authentication and trust strategy. Here's how you can modify your code:
from neo4j import GraphDatabase, Auth uri = "bolt+s://(your cluster endpoint URL):8182" driver = GraphDatabase.driver(uri, auth=Auth.NONE, encrypted=True, trust="TRUST_ALL_CERTIFICATES")
For the Gremlin connection: The hanging issue might be related to how you're setting up the connection. Make sure you're using the WebSocket secure (wss) protocol and the correct port. Here's an example of how to set up the connection:
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection from gremlin_python.structure.graph import Graph from gremlin_python.process.anonymous_traversal import traversal writer_url = 'wss://(your cluster endpoint URL):8182/gremlin' graph = Graph() g = graph.traversal().withRemote(DriverRemoteConnection(writer_url, 'g'))
In both cases, make sure your Neptune cluster's security group allows inbound traffic on port 8182 from your client's IP address or security group.
Also, even though you mentioned that IAM authentication is disabled, double-check your Neptune cluster's settings to ensure there are no other authentication mechanisms in place that might be preventing your connection.
If you're still encountering issues after these modifications, you may want to check your Neptune cluster's logs for any error messages that could provide more insight into the connection problems.
Sources
Using the Bolt protocol to make openCypher queries to Neptune - Amazon Neptune
Using Node.js to connect to a Neptune DB instance - Amazon Neptune
The above comment about using
bolt+s
is incorrect. Encryption is set for bolt connections using theencrypted=True
parameter.I am able to access through gremlin, however cypher does not work. Can someone at AWS please confirm the neo4j approach above works?
That should work. We have it included in the docs here: https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-opencypher-bolt.html#access-graph-opencypher-bolt-python
Is there an approach where IAM auth is not enabled? I cannot get it to work otherwise.
Relevant content
- asked 4 months ago
- AWS OFFICIALUpdated 2 years ago
Are your curl commands and your Python scripts being run from the same source location? Both are executed with access to the Neptune endpoint?