neo4j / docker-neo4j

Docker Images for the Neo4j Graph Database
Apache License 2.0
331 stars 172 forks source link

Not able to install apoc plugin in docker 5.2.0 community edition #414

Closed rizwan92 closed 1 year ago

rizwan92 commented 1 year ago

ia m trying to install apoc plugin in docker 5.2.0


i am mounting `/home/ubuntu/docker-data/neo4j/plugins` persistent path to my docker volume
where i am downloading two plugin from apoc release

wget https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/5.2.0/apoc-bolt-dependencies-5.2.0-all.jar

wget https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/5.2.0/apoc-5.2.0-extended.jar


- Expected behavior
Apoc plugin must be installed 

- Actual behavior
 when i  start the container it starts in the right ports and works I am able to query and create the nodes but when i visit my container inside `/plugin`  directory there is no plugin available there directory has only the Readme file 

- Neo4j image tag being used, eg `neo4j:latest`
- The output of the `docker version` command
Docker version 20.10.21, build baeda1f
- Operating system: (for example Windows 95/Ubuntu 16.04)

PRETTY_NAME="Ubuntu 22.04.1 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.1 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=jammy


Additionally, include (as appropriate) error messages, log-files, stacktraces, and other debug outputs.

Changed password for user 'neo4j'. IMPORTANT: this change will only take effect if performed before the database is started for the first time. 2022-12-16 10:15:08.381+0000 WARN Use of deprecated setting 'dbms.memory.pagecache.size'. It is replaced by 'server.memory.pagecache.size'. 2022-12-16 10:15:08.403+0000 INFO Starting... 2022-12-16 10:15:08.903+0000 INFO This instance is ServerId{9d9064a9} (9d9064a9-b5f0-4d54-a717-4371695ed8a7) 2022-12-16 10:15:09.758+0000 INFO ======== Neo4j 5.3.0 ======== 2022-12-16 10:15:11.195+0000 INFO Bolt enabled on 0.0.0.0:7687. 2022-12-16 10:15:12.059+0000 INFO Remote interface available at http://localhost:7474/ 2022-12-16 10:15:12.063+0000 INFO id: EE5A870D871C72A72FB431706DD14B7C20CF83A9DBFD91599FF9B4185DDBBEC7 2022-12-16 10:15:12.063+0000 INFO name: system 2022-12-16 10:15:12.064+0000 INFO creationDate: 2022-12-15T09:39:55.761Z 2022-12-16 10:15:12.064+0000 INFO Started.

rizwan92 commented 1 year ago

@jennyowen any update why is this not working?

rizwan92 commented 1 year ago

@jennyowen

this configuration is suggested by the @kvegter for 5.3.0 and after running this i am getting this logs

version: '2'
services:
  neo4j:
    image: neo4j:5.3.0
    restart: always
    environment:
      NEO4J_dbms_memory_pagecache_size: 1G
      NEO4J_AUTH: neo4j/graphbhai
      NEO4J_server_bolt_advertised__address: localhost:7687
      NEO4J_server_http_advertised__address: localhost:7474
      NEO4J_dbms_security_procedures_unrestricted: jwt.security.*,apoc.* \
    ports:
      - 7474:7474 
      - 7473:7473 
      - 7687:7687
    volumes:
      - /home/ubuntu/docker-data/neo4j/data:/data
      - /home/ubuntu/docker-data/neo4j/logs:/logs
      - /home/ubuntu/docker-data/neo4j/import:/var/lib/neo4j/import
      - /home/ubuntu/docker-data/neo4j/plugins:/plugins
#      - /home/ubuntu/docker-data/neo4j/ssl:/ssl
#      - /home/ubuntu/docker-data/neo4j/conf:/conf
Changed password for user 'neo4j'. IMPORTANT: this change will only take effect if performed before the database is started for the first time.
2022-12-17 11:21:30.467+0000 INFO  Starting...
2022-12-17 11:21:31.021+0000 INFO  This instance is ServerId{9d9064a9} (9d9064a9-b5f0-4d54-a717-4371695ed8a7)
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2022-12-17 11:21:31.948+0000 INFO  ======== Neo4j 5.3.0 ========
2022-12-17 11:21:35.693+0000 ERROR [neo4j/58b7a1f5] failed to start service uuid
java.util.NoSuchElementException: Key 'apoc.uuid.enabled' does not map to an existing object!
    at org.apache.commons.configuration2.AbstractConfiguration.throwMissingPropertyException(AbstractConfiguration.java:1531) ~[apoc-5.1.0-extended.jar:5.1.0]
    at org.apache.commons.configuration2.AbstractConfiguration.checkNonNullValue(AbstractConfiguration.java:1520) ~[apoc-5.1.0-extended.jar:5.1.0]
    at org.apache.commons.configuration2.AbstractConfiguration.getBoolean(AbstractConfiguration.java:940) ~[apoc-5.1.0-extended.jar:5.1.0]
    at apoc.ApocConfig.getBoolean(ApocConfig.java:287) ~[apoc-5.1.0-extended.jar:5.1.0]
    at apoc.uuid.UuidHandler.isEnabled(UuidHandler.java:70) ~[apoc-5.1.0-extended.jar:5.1.0]
    at apoc.uuid.UuidHandler.start(UuidHandler.java:62) ~[apoc-5.1.0-extended.jar:5.1.0]
    at apoc.ApocExtensionFactory$ApocLifecycle.lambda$start$2(ApocExtensionFactory.java:116) ~[apoc-5.1.0-extended.jar:5.1.0]
    at java.util.HashMap.forEach(HashMap.java:1421) ~[?:?]
    at apoc.ApocExtensionFactory$ApocLifecycle.lambda$start$3(ApocExtensionFactory.java:114) ~[apoc-5.1.0-extended.jar:5.1.0]
    at apoc.ApocExtensionFactory$ApocLifecycle.withNonSystemDatabase(ApocExtensionFactory.java:91) ~[apoc-5.1.0-extended.jar:5.1.0]
    at apoc.ApocExtensionFactory$ApocLifecycle.start(ApocExtensionFactory.java:113) ~[apoc-5.1.0-extended.jar:5.1.0]
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:353) ~[neo4j-common-5.3.0.jar:5.3.0]
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:92) ~[neo4j-common-5.3.0.jar:5.3.0]
    at org.neo4j.kernel.extension.AbstractExtensions.start(AbstractExtensions.java:78) ~[neo4j-kernel-5.3.0.jar:5.3.0]
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:353) ~[neo4j-common-5.3.0.jar:5.3.0]
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:92) ~[neo4j-common-5.3.0.jar:5.3.0]
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:353) ~[neo4j-common-5.3.0.jar:5.3.0]
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:92) ~[neo4j-common-5.3.0.jar:5.3.0]
    at org.neo4j.kernel.database.AbstractDatabase.start(AbstractDatabase.java:158) ~[neo4j-kernel-5.3.0.jar:5.3.0]
    at org.neo4j.dbms.database.DatabaseLifecycles.startDatabase(DatabaseLifecycles.java:118) ~[neo4j-5.3.0.jar:5.3.0]
    at org.neo4j.dbms.database.DatabaseLifecycles.initialiseDefaultDatabase(DatabaseLifecycles.java:88) ~[neo4j-5.3.0.jar:5.3.0]
    at org.neo4j.dbms.database.DatabaseLifecycles$DefaultDatabaseStarter.start(DatabaseLifecycles.java:157) ~[neo4j-5.3.0.jar:5.3.0]
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:353) ~[neo4j-common-5.3.0.jar:5.3.0]
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:92) ~[neo4j-common-5.3.0.jar:5.3.0]
    at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:246) ~[neo4j-5.3.0.jar:5.3.0]
    at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.build(DatabaseManagementServiceFactory.java:193) ~[neo4j-5.3.0.jar:5.3.0]
    at org.neo4j.server.CommunityBootstrapper.createNeo(CommunityBootstrapper.java:36) ~[neo4j-5.3.0.jar:5.3.0]
    at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:164) ~[neo4j-5.3.0.jar:5.3.0]
    at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:85) ~[neo4j-5.3.0.jar:5.3.0]
    at org.neo4j.server.CommunityEntryPoint.main(CommunityEntryPoint.java:30) ~[neo4j-5.3.0.jar:5.3.0]
2022-12-17 11:21:35.700+0000 ERROR [neo4j/58b7a1f5] failed to start service ttl
java.util.NoSuchElementException: Key 'apoc.ttl.enabled' does not map to an existing object!
    at org.apache.commons.configuration2.AbstractConfiguration.throwMissingPropertyException(AbstractConfiguration.java:1531) ~[apoc-5.1.0-extended.jar:5.1.0]
    at org.apache.commons.configuration2.AbstractConfiguration.checkNonNullValue(AbstractConfiguration.java:1520) ~[apoc-5.1.0-extended.jar:5.1.0]
    at org.apache.commons.configuration2.AbstractConfiguration.getBoolean(AbstractConfiguration.java:940) ~[apoc-5.1.0-extended.jar:5.1.0]
    at apoc.ApocConfig.getBoolean(ApocConfig.java:287) ~[apoc-5.1.0-extended.jar:5.1.0]
    at apoc.TTLConfig.configFor(TTLConfig.java:26) ~[apoc-5.1.0-extended.jar:5.1.0]
    at apoc.ttl.TTLLifeCycle.start(TTLLifeCycle.java:44) ~[apoc-5.1.0-extended.jar:5.1.0]
    at apoc.ApocExtensionFactory$ApocLifecycle.lambda$start$2(ApocExtensionFactory.java:116) ~[apoc-5.1.0-extended.jar:5.1.0]
    at java.util.HashMap.forEach(HashMap.java:1421) ~[?:?]
    at apoc.ApocExtensionFactory$ApocLifecycle.lambda$start$3(ApocExtensionFactory.java:114) ~[apoc-5.1.0-extended.jar:5.1.0]
    at apoc.ApocExtensionFactory$ApocLifecycle.withNonSystemDatabase(ApocExtensionFactory.java:91) ~[apoc-5.1.0-extended.jar:5.1.0]
    at apoc.ApocExtensionFactory$ApocLifecycle.start(ApocExtensionFactory.java:113) ~[apoc-5.1.0-extended.jar:5.1.0]
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:353) ~[neo4j-common-5.3.0.jar:5.3.0]
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:92) ~[neo4j-common-5.3.0.jar:5.3.0]
    at org.neo4j.kernel.extension.AbstractExtensions.start(AbstractExtensions.java:78) ~[neo4j-kernel-5.3.0.jar:5.3.0]
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:353) ~[neo4j-common-5.3.0.jar:5.3.0]
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:92) ~[neo4j-common-5.3.0.jar:5.3.0]
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:353) ~[neo4j-common-5.3.0.jar:5.3.0]
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:92) ~[neo4j-common-5.3.0.jar:5.3.0]
    at org.neo4j.kernel.database.AbstractDatabase.start(AbstractDatabase.java:158) ~[neo4j-kernel-5.3.0.jar:5.3.0]
    at org.neo4j.dbms.database.DatabaseLifecycles.startDatabase(DatabaseLifecycles.java:118) ~[neo4j-5.3.0.jar:5.3.0]
    at org.neo4j.dbms.database.DatabaseLifecycles.initialiseDefaultDatabase(DatabaseLifecycles.java:88) ~[neo4j-5.3.0.jar:5.3.0]
    at org.neo4j.dbms.database.DatabaseLifecycles$DefaultDatabaseStarter.start(DatabaseLifecycles.java:157) ~[neo4j-5.3.0.jar:5.3.0]
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:353) ~[neo4j-common-5.3.0.jar:5.3.0]
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:92) ~[neo4j-common-5.3.0.jar:5.3.0]
    at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:246) ~[neo4j-5.3.0.jar:5.3.0]
    at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.build(DatabaseManagementServiceFactory.java:193) ~[neo4j-5.3.0.jar:5.3.0]
    at org.neo4j.server.CommunityBootstrapper.createNeo(CommunityBootstrapper.java:36) ~[neo4j-5.3.0.jar:5.3.0]
    at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:164) ~[neo4j-5.3.0.jar:5.3.0]
    at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:85) ~[neo4j-5.3.0.jar:5.3.0]
    at org.neo4j.server.CommunityEntryPoint.main(CommunityEntryPoint.java:30) ~[neo4j-5.3.0.jar:5.3.0]
2022-12-17 11:21:36.806+0000 INFO  Called db.clearQueryCaches(): Query cache already empty.
2022-12-17 11:21:36.861+0000 INFO  Bolt enabled on 0.0.0.0:7687.
2022-12-17 11:21:37.611+0000 INFO  Remote interface available at http://localhost:7474/
2022-12-17 11:21:37.615+0000 INFO  id: EE5A870D871C72A72FB431706DD14B7C20CF83A9DBFD91599FF9B4185DDBBEC7
2022-12-17 11:21:37.616+0000 INFO  name: system
2022-12-17 11:21:37.616+0000 INFO  creationDate: 2022-12-15T09:39:55.761Z
2022-12-17 11:21:37.616+0000 INFO  Started.
saeedseyfi commented 1 year ago

the right path for plugins folder is $NEO4J_HOME/plugins which is /var/lib/neo4j/plugins in this case your volumes should be mounted similar to this:

    volumes:
      ...
      - /home/ubuntu/docker-data/neo4j/plugins:/var/lib/neo4j/plugins
      ...

ps. the same patters applies to the rest of directories: data logs import plugins and etc.

jennyowen commented 1 year ago

@saeedseyfi no that is totally wrong. The correct mount point is /data, /logs, /plugins etc NOT /var/lib/neo4j/*. Please don't tell people incorrect things.

@rizwan92 There are a few things causing apoc not to load properly here.

  1. You also need to download apoc-core from https://github.com/neo4j/apoc/releases and put it into your plugins folder.
  2. The trailing \ on the NEO4J_dbms_security_procedures_unrestricted line is probably confusing docker.
  3. You need to make sure the apoc version matches the neo4j version. If you still have 5.2 apoc in the plugins folder you need to delete those and download 5.3 apoc if you're going to use neo4j 5.3.

The APOC bolt dependencies for 5.3.0 aren't available any more because those dependencies are included in the neo4j java driver, which comes with neo4j already.

This modified version of your docker-compose.yaml worked for me:

version: '2'
services:
  neo4j:
    image: neo4j:5.3
    restart: always
    environment:
      NEO4J_AUTH: none
      NEO4J_dbms_security_procedures_unrestricted: jwt.security.*,apoc.*
    ports:
      - 7474:7474
      - 7687:7687
    volumes:
      - $HOME/neo4j/plugins53:/plugins

where...

$ ls $HOME/neo4j/plugins53 
apoc-5.3.0-core.jar  apoc-5.3.1-extended.jar