Neo4j安装APOC和图形算法时出现Neo.ClientError.Procedure.ProcedureRegistrationFailed错误。

12

我在使用 APOC 和 Graph Algorithms 插件时遇到了一些问题。我按照指示将 .jars 文件放置在 {NEO4j_HOME}/plugins 中,并且还更改了我的 {NEO4j_HOME}/conf/neo4j.conf 文件中的设置。

dbms.directories.data=/Users/mlo/neo4j-community-3.3.1/data
dbms.directories.plugins=/Users/mlo/neo4j-community-3.3.1/plugins
dbms.directories.certificates=/Users/mlo/neo4j-community-3.3.1/certificates
dbms.directories.logs=/Users/mlo/neo4j-community-3.3.1/logs
dbms.directories.lib=/Users/mlo/neo4j-community-3.3.1/lib
dbms.directories.run=/Users/mlo/neo4j-community-3.3.1/run

dbms.security.auth_enabled=false
dbms.security.procedures.unrestricted=algo.*
dbms.security.procedures.unrestricted=apoc.*

有几个程序可行。

CALL apoc.help('dijkstra')
CALL algo.list()

然而,大多数存储过程根本不起作用。

Neo.ClientError.Procedure.ProcedureRegistrationFailed
algo.unionFind 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.
algo.pageRank 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.

有人能指出我的设置哪里错了吗?谢谢。

2个回答

28

修改这些行:

dbms.security.procedures.unrestricted=algo.*
dbms.security.procedures.unrestricted=apoc.*
抱歉,我只能理解和回答英文问题。如果您有关于英文的问题,请随时问我!
dbms.security.procedures.unrestricted=algo.*,apoc.*

并重新启动Neo4j服务。


1
如果这些行不存在,就添加后面的行。 - til
很棒的解决方案,但对我来说,解决我的错误“spatial.addPointLayer不可用,因为它被沙盒化并且具有外部依赖项....” 的行是 dbms.security.procedures.unrestricted=algo.*,apoc.*,spatial.* - qualebs
在使用Docker时,您可以使用: --env=NEO4J_dbms_security_procedures_unrestricted=algo.,apoc. \ - undefined

5

延续@bruno-peres的回答,在使用Neo4j 3.4.0的Arch Linux上,我也遇到了类似的问题(访问/使用Neo4j APOC/Algorithms)。

我使用APOC (适用于Neo4j的强大过程)Neo4j高效图形算法,并将相应版本的.jar文件下载到我的Neo4j插件目录中,即:

/mnt/Vancouver/apps/neo4j/neo4j-community-3.4.0/plugins/apoc-3.4.0.1-all.jar
/mnt/Vancouver/apps/neo4j/neo4j-community-3.4.0/plugins/graph-algorithms-algo-3.4.0.0.jar

然而,当我尝试运行这个命令时,
CALL algo.pageRank.stream('Metabolism', 'yields',
{iterations:20, dampingFactor:0.85})
YIELD node, score
RETURN node,score order by score desc limit 20

在我的Neo4j浏览器中,我遇到了这个错误:
Error: Neo.ClientError.Procedure.ProcedureRegistrationFailed

Neo.ClientError.Procedure.ProcedureRegistrationFailed: algo.pageRank 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.

根据这里的被接受的答案(SO 48773505)Neo4j安装APOC和Graph Algorithms...,我需要对我的“neo4j.conf”文件进行以下编辑。
/mnt/Vancouver/apps/neo4j/neo4j-community-3.4.0/conf/neo4j.conf

请取消注释这一行:

dbms.directories.plugins=plugins

并添加/编辑这一行,

dbms.security.procedures.unrestricted=apoc.trigger.*,apoc.*,algo.*

注意(上文),似乎 neo4j.conf 只接受 一个
dbms.security.procedures.unrestricted=...

行!拥有单独的行,例如:

dbms.security.procedures.unrestricted=apoc.trigger.*,apoc.*
dbms.security.procedures.unrestricted=algo.*

出现了 ...因为它被沙箱化并且具有沙箱之外的依赖项... 错误!

最后,重新启动您的Neo4j服务器/实例。

neo4j restart

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接