报错内容
Traceback (most recent call last):
File "/langchain-master/templates/neo4j-semantic-ollama/ingest.py", line 9, in <module>
graph = Neo4jGraph()
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/langchain_community/graphs/neo4j_graph.py", line 213, in __init__
raise e
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/langchain_community/graphs/neo4j_graph.py", line 205, in __init__
self.refresh_schema()
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/langchain_community/graphs/neo4j_graph.py", line 248, in refresh_schema
for el in self.query(
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/langchain_community/graphs/neo4j_graph.py", line 233, in query
json_data = [r.data() for r in data]
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/langchain_community/graphs/neo4j_graph.py", line 233, in <listcomp>
json_data = [r.data() for r in data]
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/neo4j/_sync/work/result.py", line 270, in __iter__
self._connection.fetch_message()
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/neo4j/_sync/io/_common.py", line 178, in inner
func(*args, **kwargs)
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/neo4j/_sync/io/_bolt.py", line 849, in fetch_message
res = self._process_message(tag, fields)
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/neo4j/_sync/io/_bolt4.py", line 368, in _process_message
response.on_failure(summary_metadata or {})
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/neo4j/_sync/io/_common.py", line 245, in on_failure
raise Neo4jError.hydrate(**metadata)
neo4j.exceptions.ClientError: {code: Neo.ClientError.Procedure.ProcedureRegistrationFailed} {message: apoc.meta.data is unavailable because it is sandboxed and has dependencies outside of the sandbox. Sandboxing is controlled by the dbms.security.procedures.unrestricted setting. Only unrestrict procedures you can trust with access to database internals.}
报错原因
APOC权限不足
解决方案
vim $NEO4J_HOME/conf/neo4j.conf
# 参考
# vim /root/neo4j-community-4.4.30/conf/neo4j.conf
找到security.procedures.unrestricted
在其下方添加以下代码
dbms.security.procedures.unrestricted=apoc.*