neo4j 3.2.3, tinkerpop 3.3.0. access previously created database.

253 views
Skip to first unread message

Bailey Glen

unread,
Sep 18, 2017, 2:37:42 PM9/18/17
to Gremlin-users
So, I am trying to utilize tinkerpop 3.3.0 to access a neo4j database I created with in python with cypher (official neo4j-driver) in neo4j 3.2.3. I have worked through a lot of the details, but have now run into an error that I am uncertain how to get around. 
I have tried connecting from both the console and the server. Detailing the console below

:install org.apache.tinkerpop neo4j-gremlin 3.3.0
:install org.neo4j neo4j-tinkerpop-api-impl 0.7-3.2.3

graph = Neo4jGraph.open(pathtodb/graph.db);



Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, pathtodb/graph.db
Type ':help' or ':h' for help.
Display stack trace? [yN]y
java
.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, pathtodb/graph.db
 at org
.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:143)
 at org
.neo4j.kernel.impl.factory.CommunityFacadeFactory.newFacade(CommunityFacadeFactory.java:43)
 at org
.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:108)
 at org
.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:129)
 at org
.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:117)
 at org
.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:185)
 at org
.neo4j.tinkerpop.api.impl.Neo4jFactoryImpl.newGraphDatabase(Neo4jFactoryImpl.java:45)
 at org
.neo4j.tinkerpop.api.Neo4jFactory$Builder.open(Neo4jFactory.java:32)
 at org
.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.<init>(Neo4jGraph.java:125)
 at org
.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.open(Neo4jGraph.java:139)
 at org
.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph$open.call(Unknown Source)
 at org
.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
 at org
.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
 at org
.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
 at groovysh_evaluate
.run(groovysh_evaluate:3)
 at org
.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
 at org
.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:70)
 at org
.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:191)
 at org
.apache.tinkerpop.gremlin.console.GremlinGroovysh.super$3$execute(GremlinGroovysh.groovy)
 at sun
.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
 at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java
.lang.reflect.Method.invoke(Method.java:498)
 at org
.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
 at groovy
.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
 at groovy
.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
 at org
.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
 at org
.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:72)
 at org
.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122)
 at org
.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:95)
 at org
.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
 at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java
.lang.reflect.Method.invoke(Method.java:498)
 at org
.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
 at groovy
.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
 at groovy
.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
 at org
.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
 at org
.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:152)
 at org
.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:124)
 at org
.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:59)
 at org
.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
 at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java
.lang.reflect.Method.invoke(Method.java:498)
 at org
.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
 at groovy
.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
 at groovy
.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
 at org
.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
 at org
.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:152)
 at org
.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:83)
 at org
.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
 at org
.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:143)
 at org
.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
 at org
.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:450)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.extension.KernelExtensions@29022a56' failed to initialize. Please see attached cause exception.
 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.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:139)
 
... 55 more
Caused by: java.lang.NoSuchMethodError: org.neo4j.kernel.api.impl.index.LuceneKernelExtensions.directoryFactory(ZLorg/neo4j/io/fs/FileSystemAbstraction;)Lorg/neo4j/kernel/api/impl/index/storage/DirectoryFactory;
 at org
.neo4j.kernel.api.impl.labelscan.LuceneLabelScanStoreExtension.newInstance(LuceneLabelScanStoreExtension.java:78)
 at org
.neo4j.kernel.api.impl.labelscan.LuceneLabelScanStoreExtension.newInstance(LuceneLabelScanStoreExtension.java:44)
 at org
.neo4j.kernel.extension.KernelExtensions.init(KernelExtensions.java:69)
 at org
.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:424)
 
... 58 more


I have tried with a  org.neo4j neo4j-tinkerpop-api-impl 0.3-2.3.2 and received an error that I needed to upgrade the version of the neo4j database. Enabling allow_store_upgrade led to an error indicating that it couldn't properly read in the db version.

Am I using incompatible versions? Do I need to recreate the indexes in an alternative method to avoid Lucene? Do I need to update something else?

Bailey Glen

unread,
Sep 18, 2017, 3:49:32 PM9/18/17
to Gremlin-users
I tried removing all of the neo4j indices but this did not impact the problem

Robert Dale

unread,
Sep 18, 2017, 3:56:47 PM9/18/17
to gremli...@googlegroups.com
The supported version of Neo4j is tightly coupled to the TinkerPop version.. TinkerPop 3.3.0 supports only Neo4j 2.3.3.  See also http://tinkerpop.apache.org/docs/current/reference/#neo4j-gremlin

TinkerPop 3.3.1 will update to Neo4j 3.2.3.  It would be fantastic if you could try out that upgrade path and provide any feedback!

Upgrade Neo4j
^^^^^^^^^^^^^

See Neo4j's https://neo4j.com/guides/upgrade/   3.2 Upgrade FAQ for a complete guide on how to upgrade from the previous 2.3.3 version. Also note that many of the configuration settings have https://neo4j.com/developer/kb/manually-migrating-configuration-settings-from-neo4j-2x-to-neo4j-3x/  changed from neo4j 2x to 3x

In particular, these properties referenced in TinkerPop documentation and configuration were renamed:

|=========================================================
|Neo4j 2.3 (TinkerPop \<= 3.3.0) |Neo4j 3.2 (TinkerPop 3.3.1)
|node_auto_indexing              |dbms.auto_index.nodes.enabled
|relationship_auto_indexing      |dbms.auto_index.relationships.enabled
|ha.cluster_server               |ha.host.coordination
|ha.server                       |ha.host.data
|=========================================================

Robert Dale

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/e3f6c1f1-311d-4128-af8c-274523da3e0e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Bailey Glen

unread,
Sep 18, 2017, 4:14:36 PM9/18/17
to Gremlin-users
So, just to be clear, the two reasonable options at this point seem to be...
rebuild my db in neo4j 2.3.3 with tp 3.3.0
OR
upgrade tp to 3.3.1 AND upgrade/rebuild my neo4j databaase to 3.2.3

I'm inclined to tackle the first option as it seems like it will be much more straightforward/better supported, and I have yet to attempt building TP from source. However, if it would be helpful for you, I would be happy to try option 2 as well, but will need some pointers on exactly which version of the source I should start with to build tp 3.3.1. Or are binaries available somewhere?

Robert Dale

To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

Bailey Glen

unread,
Sep 18, 2017, 6:02:24 PM9/18/17
to Gremlin-users
First off, at some point in this thread I got confused about my neo4j server version. It was build from scratch with 3.2.3, which as I understand it is the correct version for 3.0.1. Also, since I couldn't seem to find the documentation for neo4j 2.3.3, I decided to take a crack at building 3.3.1. I did the following.

>docker run -it maven /bin/bash

then from the docker
>git clone https://github.com/apache/tinkerpop.git  # (it looks like master is 3.3.1-SNAPSHOT)
created the ~/.groovy/groovy.xml from the 3.0.0 docs
>mvn clean install -pl neo4j-gremlin/ 
>mvn clean install -pl neo4j-gremlin/ 
>./gremlin-console/target/apache-tinkerpop-gremlin-console-3.3.1-SNAPSHOT-standalone/bin/gremlin.sh

then from the console
>:install org.apache.tinkerpop neo4j-gremlin 3.3.1-SNAPSHOT
restart console
>conf = new BaseConfiguration()
>conf.setProperty('gremlin.neo4j.directory','pathtodb/graph.db/');
>conf.setProperty('gremlin.neo4j.conf.allow_store_upgrade', 'true');
>graph = Neo4jGraph.open(conf);
>g = graph.traversal()
>g.V().count()
0

so. I got no errors, and was able to seemingly connect to the neo4j database, but it appears empty from the console. 
If I spin up a 3.2.3 server, I can still see all my graph content.

Thoughts?

Bailey Glen

unread,
Sep 18, 2017, 7:41:42 PM9/18/17
to Gremlin-users
A few edits, and also got it to work.
The graph was blank because I forgot to mount to volume to the docker, so it was simply creating a new blank graph.
i also didn't need the goovy xml, had a dupliucate command in the build, and left out activating the plugin

docker run -it --mount type=bind,source=/path/to/data,target=/path/to/data maven /bin/bash


>git clone https://github.com/apache/tinkerpop.git  # (it looks like master is 3.3.1-SNAPSHOT)
>cd tinkerpop
>mvn clean install -pl gremlin-console/ 
>mvn clean install -pl neo4j-gremlin/ 
>./gremlin-console/target/apache-tinkerpop-gremlin-console-3.3.1-SNAPSHOT-standalone/bin/gremlin.sh

then from the console
>:install org.apache.tinkerpop neo4j-gremlin 3.3.1-SNAPSHOT
restart console
>:plugin use tinkerpop.neo4j
>conf = new BaseConfiguration()
>conf.setProperty('gremlin.neo4j.directory','/path/to/data/databases/graph.db/');
>conf.setProperty('gremlin.neo4j.conf.allow_store_upgrade', 'true');
>graph = Neo4jGraph.open(conf);
>g = graph.traversal()
>g.V().count()
57258

All seems to be working at the moment. Now going to try embedding in gremlin server and connecting via gremlin-python
Reply all
Reply to author
Forward
0 new messages