Build failure
Jempan opened this issue · 4 comments
Started to get inconsistency exceptions yesterday from my Neo4j 2.2.3 production database yesterday :( Used this tool successfully 2 years ago to repair another database in another project but now I cannot get it to work. I am on Windows and I have set the environment variable MAVEN_OPTS according to copy-store.sh and run the command:
mvn compile exec:java -e -Dexec.mainClass="org.neo4j.tool.StoreCopy" -Ddbms.pagecache.memory=2G -Dexec.args="C:/Users/Jenny/Desktop/backup C:/Users/Jenny/Desktop/new_store"
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building store-util 2.2.3
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ store-util --- [INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Jenny\Desktop\store-utils-22\src\main\resources [INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ store-util --- [INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] >>> exec-maven-plugin:1.1:java (default-cli) > validate @ store-util >>>
[INFO]
[INFO] <<< exec-maven-plugin:1.1:java (default-cli) < validate @ store-util <<<
[INFO]
[INFO] --- exec-maven-plugin:1.1:java (default-cli) @ store-util --- Copying from C:/Users/Jenny/Desktop/backup to C:/Users/Jenny/Desktop/new_store ingoring rel-types [] ignoring properties [] ignoring labels [] .................
[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 44.245 s
[INFO] Finished at: 2016-11-16T17:46:35+01:00
[INFO] Final Memory: 45M/244M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.1:java (default-cli) on project store-util: An exception occured while executing the Java class. null: InvocationTargetException: Java heap space -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.1:java (default-cli) on project store-util: An exception occured while executing the Java class. null at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286) at org.apache.maven.cli.MavenCli.main(MavenCli.java:197) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.MojoExecutionException: An exception occured while executing the Java class. null at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:345) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 20 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:290) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.OutOfMemoryError: Java heap space at org.neo4j.kernel.impl.store.LongerShortString.decode(LongerShortString.java:779) at org.neo4j.kernel.impl.store.PropertyType$11.readProperty(PropertyType.java:272) at org.neo4j.kernel.impl.store.record.PropertyBlock.newPropertyData(PropertyBlock.java:251) at org.neo4j.unsafe.batchinsert.BatchInserterImpl$7.receive(BatchInserterImpl.java:926) at org.neo4j.unsafe.batchinsert.BatchInserterImpl$7.receive(BatchInserterImpl.java:921) at org.neo4j.kernel.impl.transaction.state.PropertyTraverser.getPropertyChain(PropertyTraverser.java:67) at org.neo4j.unsafe.batchinsert.BatchInserterImpl.getPropertyChain(BatchInserterImpl.java:920) at org.neo4j.unsafe.batchinsert.BatchInserterImpl.getNodeProperties(BatchInserterImpl.java:821) at org.neo4j.tool.StoreCopy.copyNodes(StoreCopy.java:189) at org.neo4j.tool.StoreCopy.copyStore(StoreCopy.java:72) at org.neo4j.tool.StoreCopy.main(StoreCopy.java:45) ... 6 more [ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
How big is your store?
Can you try to run it with MAVEN_OPTS="-Xmx4G" mvn ...
The store is 179 MB. Cmd didn't like setting MAVEN_OPTS but it accepted mvn -DargLine="-Xmx4G".. which unfortunately fails with the same exception.
I don't think it does the same as it doesn't for a new by default and argLine are regular arguments too.
set MAVEN_OPTS="-Xmx4G"
echo %MAVEN_OPTS%
you can test it by setting it to -version
then any maven command should just output the java version and exit.
I finally after some trial and error got it to work with MAVEN_OPTS set to -Xms1G. Thanks for your help Michael!