neo4j-contrib / neo4j-apoc-procedures

Awesome Procedures On Cypher for Neo4j - codenamed "apoc"                     If you like it, please ★ above ⇧            
https://neo4j.com/labs/apoc
Apache License 2.0
1.7k stars 495 forks source link

Neo4j 3.4.10 incompatible with 3.4.0.4 #1001

Closed brockelmore closed 5 years ago

brockelmore commented 5 years ago

Expected Behavior (Mandatory)

When running Neo4j Community Edition 3.4.10 via a docker-compose file, APOC 3.4.0.4 install works as expected.

Actual Behavior (Mandatory)

3.4.0.4 does not work, but throws an error complaining about corrupt Jar files. 3.4.0.3 works fine.

How to Reproduce the Problem

Docker-compose.yml:

version: '2'
services:
  # https://hub.docker.com/_/neo4j/
  neo4j:
    image: neo4j:3.4.10
    volumes:
      - ./data/neo4j:/var/lib/neo4j/data
      - ./plugins:/var/lib/neo4j/plugins
    ports:
      - 7474:7474
      - 7687:7687
    environment:
      - NEO4J_AUTH=neo4j/neo4j
      - NEO4J_dbms_memory_pagecache_size=10800m
      - NEO4J_dbms_heap_initial__size=9g
      - NEO4J_dbms_heap_max__size=9g
      - NEO4J_apoc_export_file_enabled=true
      - NEO4J_apoc_import_file_enabled=true
      - NEO4J_apoc_import_file_use__neo4j__config=true

error:

command failed: the provided initial password was not set because existing Neo4j users were detected at `/var/lib/neo4j/data/dbms/auth`. Please remove the existing `auth` file if you want to reset your database to only have a default user with the provided password.
Active database: graph.db
Directories in use:
  home:         /var/lib/neo4j
  config:       /var/lib/neo4j/conf
  logs:         /var/lib/neo4j/logs
  plugins:      /var/lib/neo4j/plugins
  import:       /var/lib/neo4j/import
  data:         /var/lib/neo4j/data
  certificates: /var/lib/neo4j/certificates
  run:          /var/lib/neo4j/run
Starting Neo4j.
2018-11-24 05:28:45.871+0000 WARN  Unknown config option: causal_clustering.discovery_listen_address
2018-11-24 05:28:45.876+0000 WARN  Unknown config option: dbms.heap.initial_size
2018-11-24 05:28:45.877+0000 WARN  Unknown config option: causal_clustering.raft_advertised_address
2018-11-24 05:28:45.883+0000 WARN  Unknown config option: causal_clustering.raft_listen_address
2018-11-24 05:28:45.884+0000 WARN  Unknown config option: ha.host.coordination
2018-11-24 05:28:45.884+0000 WARN  Unknown config option: causal_clustering.transaction_advertised_address
2018-11-24 05:28:45.885+0000 WARN  Unknown config option: causal_clustering.discovery_advertised_address
2018-11-24 05:28:45.885+0000 WARN  Unknown config option: ha.host.data
2018-11-24 05:28:45.885+0000 WARN  Unknown config option: dbms.heap.max_size
2018-11-24 05:28:45.885+0000 WARN  Unknown config option: causal_clustering.transaction_listen_address
2018-11-24 05:28:45.911+0000 INFO  ======== Neo4j 3.4.10 ========
2018-11-24 05:28:45.970+0000 INFO  Starting...
2018-11-24 05:28:56.944+0000 INFO  Bolt enabled on 0.0.0.0:7687.
2018-11-24 05:28:57.354+0000 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@7d2998d8' was successfully initialized, but failed to start. Please see the attached cause exception "Some jar procedure files are invalid, see log for details.". Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@7d2998d8' was successfully initialized, but failed to start. Please see the attached cause exception "Some jar procedure files are invalid, see log for details.".
org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@7d2998d8' was successfully initialized, but failed to start. Please see the attached cause exception "Some jar procedure files are invalid, see log for details.".
    at org.neo4j.server.exception.ServerStartupErrors.translateToServerStartupError(ServerStartupErrors.java:68)
    at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:220)
    at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:111)
    at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:79)
    at org.neo4j.server.CommunityEntryPoint.main(CommunityEntryPoint.java:32)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.server.database.LifecycleManagingDatabase@7d2998d8' was successfully initialized, but failed to start. Please see the attached cause exception "Some jar procedure files are invalid, see log for details.".
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:466)
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
    at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:212)
    ... 3 more
Caused by: java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory, /var/lib/neo4j/data/databases/graph.db
    at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:212)
    at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:125)
    at org.neo4j.server.CommunityNeoServer.lambda$static$0(CommunityNeoServer.java:58)
    at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:88)
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:445)
    ... 5 more
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.proc.Procedures@1d5d5621' was successfully initialized, but failed to start. Please see the attached cause exception "Some jar procedure files are invalid, see log for details.".
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:466)
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
    at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:208)
    ... 9 more
Caused by: java.util.zip.ZipException: Some jar procedure files are invalid, see log for details.
    at org.neo4j.kernel.impl.proc.ProcedureJarLoader.loadProceduresFromDir(ProcedureJarLoader.java:76)
    at org.neo4j.kernel.impl.proc.Procedures.start(Procedures.java:323)
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:445)
    ... 11 more
2018-11-24 05:28:57.381+0000 INFO  Neo4j Server shutdown initiated by request

Steps (Mandatory)

  1. Install Docker and Docker-Compose On Ubuntu 18.04 LTS
  2. Make a directory of ./plugins, wget latest release (3.4.0.4)
  3. Make docker-compose.yml (included above)
  4. run docker-compose up

Specifications (Mandatory)

Currently used versions

Versions

jexp commented 5 years ago

Can you hshare your wget code? Do you use: https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/3.4.0.4/apoc-3.4.0.4-all.jar

yayamm commented 5 years ago

Hi,

Same issue for me with Neo4j 3.4.10 and the plugin Neo4j-Apoc 3.4.0.4

curl -L -O https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/3.4.0.3/apoc-3.4.0.3-all.jar

conker84 commented 5 years ago

Hi @brockelmore can you try with this compose-file?

version: '2'
services:
  # https://hub.docker.com/_/neo4j/
  neo4j:
    image: neo4j:3.4.10
    volumes:
      - ./data/neo4j:/data
      - ./plugins:/plugins
    ports:
      - 7474:7474
      - 7687:7687
    environment:
      - NEO4J_AUTH=neo4j/foo
      - NEO4J_dbms_memory_pagecache_size=10800m
      - NEO4J_dbms_heap_initial__size=9g
      - NEO4J_dbms_heap_max__size=9g
      - NEO4J_apoc_export_file_enabled=true
      - NEO4J_apoc_import_file_enabled=true
      - NEO4J_apoc_import_file_use__neo4j__config=true
jexp commented 5 years ago

Ping?

jexp commented 5 years ago

Just tried it again with Neo4j Desktop it works fine for me.

jpenna commented 5 years ago

I am getting the same error. I tried neo4j:3.4.15 with apoc-3.4.0.7-all.jar in the /plugins folder. Also neo4j:3.5.7 and neo4j:3.5.8, both with apoc-3.5.0.3-all.jar and apoc-3.5.0.4-all.jar.

If I remove the APOC lib from the /plugins folder (leave it empty), the database starts fine.

My Docker command:

docker run \
    -p 7474:7474 -p 7687:7687 \
    -v $PWD/neo4j_/data:/data \
    -v $PWD/neo4j_/logs:/logs \
    -v $PWD/neo4j_/plugins:/plugins \
    -e NEO4J_dbms_security_procedures_unrestricted=apoc.\\\* \
    -e NEO4J_apoc_export_file_enabled=true \
    -e NEO4J_apoc_import_file_enabled=true \
    -e NEO4J_apoc_import_file_use__neo4j__config=true \
    -e NEO4J_AUTH=none \
    neo4j:3.4.15

Error logs:

Active database: graph.db
Directories in use:
  home:         /var/lib/neo4j
  config:       /var/lib/neo4j/conf
  logs:         /logs
  plugins:      /plugins
  import:       /var/lib/neo4j/import
  data:         /var/lib/neo4j/data
  certificates: /var/lib/neo4j/certificates
  run:          /var/lib/neo4j/run
Starting Neo4j.
2019-08-30 00:02:14.345+0000 WARN  Unknown config option: causal_clustering.discovery_listen_address
2019-08-30 00:02:14.349+0000 WARN  Unknown config option: causal_clustering.raft_advertised_address
2019-08-30 00:02:14.349+0000 WARN  Unknown config option: causal_clustering.raft_listen_address
2019-08-30 00:02:14.350+0000 WARN  Unknown config option: ha.host.coordination
2019-08-30 00:02:14.350+0000 WARN  Unknown config option: causal_clustering.transaction_advertised_address
2019-08-30 00:02:14.350+0000 WARN  Unknown config option: causal_clustering.discovery_advertised_address
2019-08-30 00:02:14.351+0000 WARN  Unknown config option: ha.host.data
2019-08-30 00:02:14.351+0000 WARN  Unknown config option: causal_clustering.transaction_listen_address
2019-08-30 00:02:14.374+0000 INFO  ======== Neo4j 3.5.7 ========
2019-08-30 00:02:14.402+0000 INFO  Starting...
2019-08-30 00:02:17.003+0000 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@4642b71d' was successfully initialized, but failed to start. Please see the attached cause exception "Some jar procedure files are invalid, see log for details.". Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@4642b71d' was successfully initialized, but failed to start. Please see the attached cause exception "Some jar procedure files are invalid, see log for details.".
org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@4642b71d' was successfully initialized, but failed to start. Please see the attached cause exception "Some jar procedure files are invalid, see log for details.".
        at org.neo4j.server.exception.ServerStartupErrors.translateToServerStartupError(ServerStartupErrors.java:45)
        at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:187)
        at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:124)
        at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:91)
        at org.neo4j.server.CommunityEntryPoint.main(CommunityEntryPoint.java:32)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.server.database.LifecycleManagingDatabase@4642b71d' was successfully initialized, but failed to start. Please see the attached cause exception "Some jar procedure files are invalid, see log for details.".
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:473)
        at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
        at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:180)
        ... 3 more
Caused by: java.lang.RuntimeException: Error starting org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory, /data/databases
        at org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:230)
        at org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:146)
        at org.neo4j.server.database.CommunityGraphFactory.newGraphDatabase(CommunityGraphFactory.java:41)
        at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:90)
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
        ... 5 more
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.proc.Procedures@54acff7d' was successfully initialized, but failed to start. Please see the attached cause exception "Some jar procedure files are invalid, see log for details.".
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:473)
        at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
        at org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:225)
        ... 9 more
Caused by: java.util.zip.ZipException: Some jar procedure files are invalid, see log for details.
        at org.neo4j.kernel.impl.proc.ProcedureJarLoader.loadProceduresFromDir(ProcedureJarLoader.java:76)
        at org.neo4j.kernel.impl.proc.Procedures.start(Procedures.java:323)
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
        ... 11 more
2019-08-30 00:02:17.004+0000 INFO  Neo4j Server shutdown initiated by request
jexp commented 5 years ago

Please try to redownload Sounds like a broken jar file

sey commented 4 years ago

Just in case it helps someone in the future: make sure the apoc JAR file is readable by the neo4j user inside the docker container...

FMenet commented 4 years ago

I can pinpoint the exact version break for this from 3.5.5 to 3.5.6

Another noteworthy fact is that if one forcibly does a chmod 777 to set all permissions directly in the volume (through a docker bash), the file is reverted back to permission 700.

EDIT : this may be done by this commit. (L30 removed) https://github.com/neo4j/docker-neo4j/commit/e3fe4c7117bc204ff496e23ce7be28970cf79957#diff-0401b9cd4191779185430d350325da44L30 Any ideas ?