Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Neo4j Install APOC and Graph Algorithms Neo.ClientError.Procedure.ProcedureRegistrationFailed

I have some issues with APOC and Graph Algorithms plugins. I followed the instruction to put the .jars in {NEO4j_HOME}/plugins and also change the setting in my {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.*

A few procedures work.

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

However, most of the stored procedures do not work at all.

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.

Can someone point out where goes wrong in my setting? Thanks.

like image 323
mlo0424 Avatar asked Feb 13 '18 18:02

mlo0424


2 Answers

Change these lines:

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

to:

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

and restart Neo4j service.

like image 179
Bruno Peres Avatar answered Oct 16 '22 18:10

Bruno Peres


Following on @bruno-peres answer, I encountered similar issues (accessing/using Neo4j APOC/Algorithms) on Arch Linux with Neo4j 3.4.0.

I use the APOC (Awesome Procedures for Neo4j) and the Efficient Graph Algorithms for Neo4j, with the appropriately-versioned .jar files downloaded to my Neo4j plugins directory; i.e.,

/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

However, when I tried to run this command,

CALL algo.pageRank.stream('Metabolism', 'yields',
{iterations:20, dampingFactor:0.85})
YIELD node, score
RETURN node,score order by score desc limit 20

in my Neo4j Browser, I got this error:

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.

Per the accepted answer here (SO 48773505) Neo4j Install APOC and Graph Algorithms...

I needed to make the following edits to my "neo4j.conf" file,

/mnt/Vancouver/apps/neo4j/neo4j-community-3.4.0/conf/neo4j.conf

Uncomment this line,

dbms.directories.plugins=plugins

and add/edit this line,

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

Note (above), it appears that neo4j.conf accepts one

dbms.security.procedures.unrestricted=...

line! Having separate lines, e.g.

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

causes the ... is unavailable because it is sandboxed and has dependencies outside of the sandbox ... error!

Finally, restart your Neo4j server/instance,

neo4j restart
like image 21
Victoria Stuart Avatar answered Oct 16 '22 17:10

Victoria Stuart