Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-16-2021 09:20 PM
I want to use python driver to connect neo4j 3.5.22 that core-standalone mode on k8s.
Following this document(Using Neo4j from Python - Developer Guides), but I got error message like this.
Traceback (most recent call last):
File "/Users/user/Documents/workspace/direct-answer/steady_clustering/venv/lib/python3.8/site-packages/neo4j/io/__init__.py", line 707, in fetch_routing_info
cx.fetch_all()
File "/Users/user/Documents/workspace/direct-answer/steady_clustering/venv/lib/python3.8/site-packages/neo4j/io/_bolt3.py", line 414, in fetch_all
detail_delta, summary_delta = self.fetch_message()
File "/Users/user/Documents/workspace/direct-answer/steady_clustering/venv/lib/python3.8/site-packages/neo4j/io/_bolt3.py", line 349, in fetch_message
response.on_failure(summary_metadata or {})
File "/Users/user/Documents/workspace/direct-answer/steady_clustering/venv/lib/python3.8/site-packages/neo4j/io/_common.py", line 175, in on_failure
handler(metadata)
File "/Users/user/Documents/workspace/direct-answer/steady_clustering/venv/lib/python3.8/site-packages/neo4j/io/__init__.py", line 693, in fail
raise BoltRoutingError("Server does not support routing", address)
neo4j._exceptions.BoltRoutingError: Server does not support routing
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/user/Documents/workspace/movie/movie_data/create_node.py", line 67, in <module>
QQ = qf.query_function()
File "/Users/user/Documents/workspace/movie/movie_data/query_function.py", line 6, in __init__
self.driver=GraphDatabase.driver(neo4j_uri, auth=("",""), encrypted=False)
File "/Users/user/Documents/workspace/direct-answer/steady_clustering/venv/lib/python3.8/site-packages/neo4j/__init__.py", line 186, in driver
return cls.neo4j_driver(parsed.netloc, auth=auth, routing_context=routing_context, **config)
File "/Users/user/Documents/workspace/direct-answer/steady_clustering/venv/lib/python3.8/site-packages/neo4j/__init__.py", line 209, in neo4j_driver
return Neo4jDriver.open(*targets, auth=auth, routing_context=routing_context, **config)
File "/Users/user/Documents/workspace/direct-answer/steady_clustering/venv/lib/python3.8/site-packages/neo4j/__init__.py", line 410, in open
pool = Neo4jPool.open(*addresses, auth=auth, routing_context=routing_context, pool_config=pool_config, workspace_config=default_workspace_config)
File "/Users/user/Documents/workspace/direct-answer/steady_clustering/venv/lib/python3.8/site-packages/neo4j/io/__init__.py", line 581, in open
pool.update_routing_table(database=workspace_config.database)
File "/Users/user/Documents/workspace/direct-answer/steady_clustering/venv/lib/python3.8/site-packages/neo4j/io/__init__.py", line 790, in update_routing_table
if self.update_routing_table_from(self.first_initial_routing_address, database=database):
File "/Users/user/Documents/workspace/direct-answer/steady_clustering/venv/lib/python3.8/site-packages/neo4j/io/__init__.py", line 768, in update_routing_table_from
new_routing_table = self.fetch_routing_table(address=router, timeout=self.pool_config.connection_timeout, database=database)
File "/Users/user/Documents/workspace/direct-answer/steady_clustering/venv/lib/python3.8/site-packages/neo4j/io/__init__.py", line 731, in fetch_routing_table
new_routing_info = self.fetch_routing_info(address=address, timeout=timeout, database=database)
File "/Users/user/Documents/workspace/direct-answer/steady_clustering/venv/lib/python3.8/site-packages/neo4j/io/__init__.py", line 712, in fetch_routing_info
raise ServiceUnavailable(*error.args)
neo4j.exceptions.ServiceUnavailable: Server does not support routing
I know that standalone mode doesn't have routing table. But documents says using neo4j protocol.
What should I do?
06-17-2021 02:49 PM
Could you please show us your code that you are using to try and make the connection? Thanks!
06-20-2021 10:30 PM
This is python code that I make the connection. Use py2neo lib, python 3.6.
def create_genre_query(data, start_idx):
print(start_idx)
query = "MATCH (m:MOVIE {mcode:{mcode}})\n" + \
"MATCH (g:GENRE {name:{genre_name}})\n" + \
"MERGE (m)-[mgr:MOVIE_GENRE]->(g)\n" + \
"MERGE (g)-[gmr:GENRE_MOVIE]->(m)\n"
param = {}
for idx, each in enumerate(data[start_idx:start_idx+1000]):
genres = [x.strip() for x in each['genres'].split(',')]
param['mcode'] = int(each['mcode'].strip())
for genre in genres:
graph = Graph(scheme='neo4j', host=neo4j_uri, port=port, user=id, password=passwd)
param['genre_name'] = genre
graph.run(query, param)
Thank you for your reply.
06-29-2021 06:52 AM
Are you using bolt://ip or bolt+routing://ip?
Additionally, there is some discussion in this thread that might be a good place to start diagnosing this problem.
All the sessions of the conference are now available online