neo4j-devtools / neo4j-desktop

The Neo4j Graph Platform, on your desktop OS.
19 stars 1 forks source link

DB Upgrade doesn't upgrade APOC which DB will fail to start #44

Open MichaelRBlack opened 5 years ago

MichaelRBlack commented 5 years ago

When you upgrade versions of Neo4j, the APOC plugin doesn't get upgraded which will cause your database to fail to start. Removing the plugin also doesn't work, it thinks it does but it doesn't really. You have to go into the file system, remove APOC, and then you can use Neo4jDesktop to install the APOC plugin which will be the updated version and your database will also start.

Metaur commented 5 years ago

@MichaelRBlack are there any messages in log file related to the upgrade process? could you please describe the steps you have done to achieve this behaviour?

MichaelRBlack commented 5 years ago

Steps to recreate:

  1. Older version of Neo4j
  2. Older version of APOC
  3. Upgrade Neo4j
  4. Attempt to start
  5. Scratch your head why it fails
  6. Manually delete APOC from the plugins folder

From here everything will work, you can start the DB, you can reinstall APOC, life is good from here.

Here's some screen shots and output log that I captured while I was recreating this

State before upgrade attempt: image

image

After upgrade: image

image

2019-01-21 15:18:50.140+0000 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@1951b871' was successfully initialized, but failed to start. Please see the attached cause exception "org.neo4j.kernel.impl.logging.LogService". Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@1951b871' was successfully initialized, but failed to start. Please see the attached cause exception "org.neo4j.kernel.impl.logging.LogService". org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@1951b871' was successfully initialized, but failed to start. Please see the attached cause exception "org.neo4j.kernel.impl.logging.LogService". at org.neo4j.server.exception.ServerStartupErrors.translateToServerStartupError(ServerStartupErrors.java:45) at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:184) at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:123) at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:90) at com.neo4j.server.enterprise.CommercialEntryPoint.main(CommercialEntryPoint.java:22) Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.server.database.LifecycleManagingDatabase@1951b871' was successfully initialized, but failed to start. Please see the attached cause exception "org.neo4j.kernel.impl.logging.LogService". 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:177) ... 3 more Caused by: java.lang.RuntimeException: Error starting org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory, C:\Users\mblack\.Neo4jDesktop\neo4jDatabases\database-889459e1-08ee-4f93-b34d-3821ff5c58bf\installation-3.5.1\data\databases at org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:212) at com.neo4j.commercial.edition.CommercialGraphDatabase.<init>(CommercialGraphDatabase.java:20) at com.neo4j.server.database.CommercialGraphFactory.newGraphDatabase(CommercialGraphFactory.java:40) at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:78) at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452) ... 5 more Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.extension.GlobalKernelExtensions@4795ded0' failed to initialize. Please see the attached cause exception "org.neo4j.kernel.impl.logging.LogService". at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:434) at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:66) at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:102) at org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:207) ... 9 more Caused by: org.neo4j.kernel.extension.FailedToBuildKernelExtensionException: Failed to build kernel extension KernelExtension:ApocKernelExtensionFactory[APOC] because it is compiled with a reference to a class, method, or field, that is not in the class path: 'org/neo4j/kernel/impl/logging/LogService'. The most common cause of this problem, is that Neo4j has been upgraded without also upgrading allinstalled extensions, such as APOC. Make sure that all of your extensions are build against your specific version of Neo4j. at org.neo4j.kernel.extension.KernelExtensionFailureStrategies.wrap(KernelExtensionFailureStrategies.java:60) at org.neo4j.kernel.extension.KernelExtensionFailureStrategies.access$100(KernelExtensionFailureStrategies.java:26) at org.neo4j.kernel.extension.KernelExtensionFailureStrategies$1.handle(KernelExtensionFailureStrategies.java:76) at org.neo4j.kernel.extension.AbstractKernelExtensions.init(AbstractKernelExtensions.java:72) at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:413) ... 12 more Caused by: java.lang.NoClassDefFoundError: org/neo4j/kernel/impl/logging/LogService at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.privateGetPublicMethods(Class.java:2902) at java.lang.Class.getMethods(Class.java:1615) at sun.misc.ProxyGenerator.generateClassFile(ProxyGenerator.java:451) at sun.misc.ProxyGenerator.generateProxyClass(ProxyGenerator.java:339) at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:639) at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:557) at java.lang.reflect.WeakCache$Factory.get(WeakCache.java:230) at java.lang.reflect.WeakCache.get(WeakCache.java:127) at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:419) at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:719) at org.neo4j.kernel.impl.util.DependenciesProxy.dependencies(DependenciesProxy.java:55) at org.neo4j.kernel.extension.AbstractKernelExtensions.getKernelExtensionDependencies(AbstractKernelExtensions.java:114) at org.neo4j.kernel.extension.AbstractKernelExtensions.init(AbstractKernelExtensions.java:61) ... 13 more Caused by: java.lang.ClassNotFoundException: org.neo4j.kernel.impl.logging.LogService at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 28 more 2019-01-21 15:18:50.166+0000 INFO Neo4j Server shutdown initiated by request

bwinchester commented 3 years ago

DESKTOP Version: Version 1.4.1 (1.4.1.46)

Although more recent 4.x neo4j versions, the error is different. This is still an issue. If you take a 3.5.x neo4j DB in the desktop app which already has APOC installed, and upgrade Neo4J to 4.x, The APOC plugin 1) shows it has the compatible APOC version installed (it doesn't, its still the 3.x version), and 2) starting Neo4J DB pops this error:

ERROR Failed to start Neo4j on dbms.connector.http.listen_address, a socket address. If missing port or hostname it is acquired from dbms.default_listen_address

Users have to manually remove the APOC jar from that DB's plugins directory, and then can use the neo4j desktop interface to install the correct APOC jar plugin.

Users not familiar with administrating a Neo4J DB will be hesitant to operate this procedure. And Users encountering this error are not told the root cause of the error. And seems the Neo4J plugin compatibility code is silenced on this matter, or not hit before this error exits neo4j.