cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Problem with installing APOC in neo4j server

Hello,

My apoc plugin is not correctly installed, but I really don't know what went wrong.

  • OS: CentOS 7
  • neo4j version: 4.4.1
  • API / driver: Neo4j GraphQL Library

Jar file under plugins folder: /var/lib/neo4j/plugins/
-rwxr-xr-x 1 neo4j neo4j 23302562 Dec 9 19:06 apoc-4.4.0.1-all.jar
In config file: /etc/neo4j/neo4j.conf

dbms.security.procedures.unrestricted=apoc.*
dbms.security.procedures.allowlist=apoc.coll.*,apoc.load.*,apoc.*
apoc.import.file.enabled=true

When I run:

neo4j@neo4j> call apoc.help("help");
Failed to invoke procedure `apoc.help`: Caused by: java.lang.ClassNotFoundException: org.neo4j.graphdb.TransactionGuardException

When I call some Neo4j GraphQL APIs, I get:
Unhandled Rejection (Error): Unknown function 'apoc.util.validatePredicate'

Neo4j has been restarted many times.

Please help, Thanks!

Regards,
Joanne

1 ACCEPTED SOLUTION

Problem solved when I get ride of the lock file error.

View solution in original post

3 REPLIES 3

@joannelyu

There is something useful in neo4j.log and debug.log files?

The config seems correct (anyway, in dbms.security.procedures.allowlist you can write only apoc.*, but the result is the same)

Dear @giuseppe.villani

Here is some part of the log:

2022-01-11 01:28:22.426+0000 INFO  [o.n.d.i.DefaultIdentityModule] Found ServerId on disk: ServerId{7f148f53} (7f148f53-aa87-40d2-883d-8696dfb3c052)
2022-01-11 01:28:22.427+0000 INFO  [o.n.d.i.DefaultIdentityModule] This instance is ServerId{7f148f53} (7f148f53-aa87-40d2-883d-8696dfb3c052)
2022-01-11 01:28:22.431+0000 INFO  [o.n.g.f.EditionLocksFactories] Locking implementation 'forseti' selected.
2022-01-11 01:28:24.512+0000 INFO  [o.n.s.CommunityNeoWebServer] ======== Neo4j 4.4.1 ========
2022-01-11 01:28:24.544+0000 INFO  [o.n.d.d.DefaultDatabaseManager] Creating 'DatabaseId{00000000[system]}'.
2022-01-11 01:28:24.639+0000 INFO  [a.ApocConfig] successfully registered ApocConfig for @Context
2022-01-11 01:28:24.641+0000 INFO  [a.Pools] successfully registered Pools for @Context
2022-01-11 01:28:24.674+0000 INFO  [a.ApocConfig] from system properties: NEO4J_CONF=/etc/neo4j
2022-01-11 01:28:24.674+0000 INFO  [a.ApocConfig] system property NEO4J_CONF set to /etc/neo4j
2022-01-11 01:28:24.674+0000 INFO  [a.ApocConfig] loading apoc meta config from jar:file:/var/lib/neo4j/plugins/apoc-4.4.0.1-all.jar!/apoc-config.xml
2022-01-11 01:28:25.076+0000 INFO  [a.ApocConfig] setting from neo4j.conf: apoc.jobs.pool.num_threads=null
2022-01-11 01:28:25.076+0000 INFO  [a.ApocConfig] setting from neo4j.conf: apoc.export.file.enabled=false
2022-01-11 01:28:25.077+0000 INFO  [a.ApocConfig] setting from neo4j.conf: apoc.ttl.enabled=false
2022-01-11 01:28:25.077+0000 INFO  [a.ApocConfig] setting from neo4j.conf: apoc.ttl.schedule=PT1M
2022-01-11 01:28:25.078+0000 INFO  [a.ApocConfig] setting from neo4j.conf: apoc.jobs.queue.size=null
2022-01-11 01:28:25.078+0000 INFO  [a.ApocConfig] setting from neo4j.conf: apoc.initializer.cypher=null
2022-01-11 01:28:25.078+0000 INFO  [a.ApocConfig] setting from neo4j.conf: apoc.jobs.scheduled.num_threads=null
2022-01-11 01:28:25.079+0000 INFO  [a.ApocConfig] setting from neo4j.conf: apoc.import.file.enabled=true
2022-01-11 01:28:25.080+0000 INFO  [a.ApocConfig] setting from neo4j.conf: apoc.trigger.enabled=false
2022-01-11 01:28:25.080+0000 INFO  [a.ApocConfig] setting from neo4j.conf: apoc.import.file.use_neo4j_config=true
2022-01-11 01:28:25.081+0000 INFO  [a.ApocConfig] setting from neo4j.conf: apoc.uuid.enabled=false
2022-01-11 01:28:25.082+0000 INFO  [a.ApocConfig] setting from neo4j.conf: apoc.ttl.limit=1000
2022-01-11 01:28:25.166+0000 INFO  [o.n.b.BoltServer] Bolt server loaded
2022-01-11 01:28:25.313+0000 ERROR [o.n.g.f.DatabaseManagementServiceFactory] Error starting Neo4j database server at /var/lib/neo4j/data/databases
org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.internal.locker.LockerLifecycleAdapter@15515c51' was successfully initialized, but failed to start. Please see the attached cause exception "Lock file has been locked by another process: /var/lib/neo4j/data/databases/store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)".
	at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:463) ~[neo4j-common-4.4.1.jar:4.4.1]
	at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:110) ~[neo4j-common-4.4.1.jar:4.4.1]
	at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:219) [neo4j-4.4.1.jar:4.4.1]
	at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.build(DatabaseManagementServiceFactory.java:181) [neo4j-4.4.1.jar:4.4.1]
	at org.neo4j.server.CommunityBootstrapper.createNeo(CommunityBootstrapper.java:36) [neo4j-4.4.1.jar:4.4.1]
	at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:142) [neo4j-4.4.1.jar:4.4.1]
	at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:95) [neo4j-4.4.1.jar:4.4.1]
	at org.neo4j.server.CommunityEntryPoint.main(CommunityEntryPoint.java:34) [neo4j-4.4.1.jar:4.4.1]
Caused by: org.neo4j.kernel.internal.locker.FileLockException: Lock file has been locked by another process: /var/lib/neo4j/data/databases/store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)
	at org.neo4j.kernel.internal.locker.Locker.storeLockException(Locker.java:175) ~[neo4j-kernel-4.4.1.jar:4.4.1]
	at org.neo4j.kernel.internal.locker.Locker.checkLock(Locker.java:95) ~[neo4j-kernel-4.4.1.jar:4.4.1]
	at org.neo4j.kernel.internal.locker.GlobalFileLocker.checkLock(GlobalFileLocker.java:58) ~[neo4j-kernel-4.4.1.jar:4.4.1]
	at org.neo4j.kernel.internal.locker.GlobalLocker.checkLock(GlobalLocker.java:28) ~[neo4j-kernel-4.4.1.jar:4.4.1]
	at org.neo4j.kernel.internal.locker.LockerLifecycleAdapter.start(LockerLifecycleAdapter.java:36) ~[neo4j-kernel-4.4.1.jar:4.4.1]
	at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:442) ~[neo4j-common-4.4.1.jar:4.4.1]
	... 7 more
2022-01-11 01:28:25.314+0000 INFO  [o.n.g.f.DatabaseManagementServiceFactory] Shutdown started

It seems the apoc jar file is loaded, but call apoc still not working. There is an error of lock file, but not about apoc I guess.

Thanks!

Problem solved when I get ride of the lock file error.