Neo4J and Gremlin --- can't access to db

436 views
Skip to first unread message

Serge Scevenels

unread,
Oct 26, 2015, 2:50:54 PM10/26/15
to Gremlin-users
Hi,

I have installed neo4j 2.3.0 on ubuntu 14.04 using the following instructions :


then i downloaded, unzip tinkerpop3 - gremlin- console from the following link : https://www.apache.org/dist/incubator/tinkerpop/3.0.1-incubating/apache-gremlin-console-3.0.1-incubating-bin.zip

I then installed the missing plugins for neo4j in this way :

$ bin/gremlin.sh
gremlin> :install org.apache.tinkerpop neo4j-gremlin 3.0.1-incubating
gremlin> :install org.neo4j neo4j-tinkerpop-api-impl 0.1-2.2
gremlin> :quit
$ bin/gremlin.sh
gremlin> :plugin use tinkerpop.neo4j

Then i try to open the default graph db generated at Neo4J installation

gremlin> graph=Neo4jGraph.open('/var/lib/neo4j/data/graph.db')

and i got the following error message:
java.io.FileNotFoundException: /var/lib/neo4j/data/graph.db/messages.log (Permission denied)

Details :
java.lang.RuntimeException: java.io.FileNotFoundException: /var/lib/neo4j/data/graph.db/messages.log (Permission denied)
at org.neo4j.kernel.impl.util.StringLogger$ActualStringLogger.<init>(StringLogger.java:588)
at org.neo4j.kernel.impl.util.StringLogger$ActualStringLogger.<init>(StringLogger.java:560)
at org.neo4j.kernel.impl.util.StringLogger.loggerDirectory(StringLogger.java:109)
at org.neo4j.kernel.logging.ClassicLoggingService.<init>(ClassicLoggingService.java:41)
at org.neo4j.kernel.logging.ClassicLoggingService.<init>(ClassicLoggingService.java:36)
at org.neo4j.kernel.logging.LogbackWeakDependency$1.apply(LogbackWeakDependency.java:42)
at org.neo4j.kernel.logging.LogbackWeakDependency$1.apply(LogbackWeakDependency.java:38)
at org.neo4j.kernel.logging.LogbackWeakDependency.tryLoadLogbackService(LogbackWeakDependency.java:98)
at org.neo4j.kernel.logging.LogbackWeakDependency.tryLoadLogbackService(LogbackWeakDependency.java:103)
at org.neo4j.kernel.logging.DefaultLogging.createDefaultLogging(DefaultLogging.java:38)
at org.neo4j.kernel.InternalAbstractGraphDatabase.createLogging(InternalAbstractGraphDatabase.java:887)
at org.neo4j.kernel.InternalAbstractGraphDatabase.create(InternalAbstractGraphDatabase.java:433)
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:323)
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:59)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:108)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:95)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:176)
at org.neo4j.tinkerpop.api.impl.Neo4jFactoryImpl.newGraphDatabase(Neo4jFactoryImpl.java:44)
at org.neo4j.tinkerpop.api.Neo4jFactory$Builder.open(Neo4jFactory.java:32)
at org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.<init>(Neo4jGraph.java:130)
at org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.open(Neo4jGraph.java:144)
at org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.open(Neo4jGraph.java:153)
at org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph$open.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:110)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:122)
at groovysh_evaluate.run(groovysh_evaluate:3)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
at org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:69)
at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:185)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:119)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
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:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:130)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:150)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:58)
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:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:130)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:150)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:82)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:144)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:303)
Caused by: java.io.FileNotFoundException: /var/lib/neo4j/data/graph.db/messages.log (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at org.neo4j.io.fs.DefaultFileSystemAbstraction.openAsOutputStream(DefaultFileSystemAbstraction.java:61)
at org.neo4j.kernel.impl.util.StringLogger$ActualStringLogger.instantiateWriter(StringLogger.java:615)
at org.neo4j.kernel.impl.util.StringLogger$ActualStringLogger.<init>(StringLogger.java:584)
... 61 more

Marko Rodriguez

unread,
Oct 26, 2015, 2:52:50 PM10/26/15
to gremli...@googlegroups.com
Hello,

I believe you just need to reference the /neo4j directory, not the database file.

Marko.
--
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-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/addc436b-4153-4619-9913-5379b3cbd292%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Serge Scevenels

unread,
Oct 26, 2015, 3:22:37 PM10/26/15
to Gremlin-users
'/var/lib/neo4j/data/graph.db is a directory, where I got all these files :

drwxr-xr-x 2 neo4j nogroup  4096 Oct 26 18:46 index/
-rw-r--r-- 1 neo4j nogroup 40376 Oct 26 19:00 messages.log
-rw-r--r-- 1 neo4j nogroup  8192 Oct 26 18:46 neostore
-rw-r--r-- 1 neo4j nogroup    96 Oct 26 18:46 neostore.counts.db.a
-rw-r--r-- 1 neo4j nogroup     9 Oct 26 19:00 neostore.id
-rw-r--r-- 1 neo4j nogroup     0 Oct 26 18:46 neostore.labeltokenstore.db
-rw-r--r-- 1 neo4j nogroup     9 Oct 26 19:00 neostore.labeltokenstore.db.id
-rw-r--r-- 1 neo4j nogroup  8192 Oct 26 18:46 neostore.labeltokenstore.db.names
-rw-r--r-- 1 neo4j nogroup     9 Oct 26 19:00 neostore.labeltokenstore.db.names.id
-rw-r--r-- 1 neo4j nogroup     0 Oct 26 18:46 neostore.nodestore.db
-rw-r--r-- 1 neo4j nogroup     9 Oct 26 19:00 neostore.nodestore.db.id
-rw-r--r-- 1 neo4j nogroup  8192 Oct 26 18:46 neostore.nodestore.db.labels
-rw-r--r-- 1 neo4j nogroup     9 Oct 26 19:00 neostore.nodestore.db.labels.id
-rw-r--r-- 1 neo4j nogroup     0 Oct 26 18:46 neostore.propertystore.db
-rw-r--r-- 1 neo4j nogroup  8192 Oct 26 18:46 neostore.propertystore.db.arrays
-rw-r--r-- 1 neo4j nogroup     9 Oct 26 19:00 neostore.propertystore.db.arrays.id
-rw-r--r-- 1 neo4j nogroup     9 Oct 26 19:00 neostore.propertystore.db.id
-rw-r--r-- 1 neo4j nogroup     0 Oct 26 18:46 neostore.propertystore.db.index
-rw-r--r-- 1 neo4j nogroup     9 Oct 26 19:00 neostore.propertystore.db.index.id
-rw-r--r-- 1 neo4j nogroup  8192 Oct 26 18:46 neostore.propertystore.db.index.keys
-rw-r--r-- 1 neo4j nogroup     9 Oct 26 19:00 neostore.propertystore.db.index.keys.id
-rw-r--r-- 1 neo4j nogroup  8192 Oct 26 18:46 neostore.propertystore.db.strings
-rw-r--r-- 1 neo4j nogroup     9 Oct 26 19:00 neostore.propertystore.db.strings.id
-rw-r--r-- 1 neo4j nogroup  8192 Oct 26 18:46 neostore.relationshipgroupstore.db
-rw-r--r-- 1 neo4j nogroup     9 Oct 26 19:00 neostore.relationshipgroupstore.db.id
-rw-r--r-- 1 neo4j nogroup     0 Oct 26 18:46 neostore.relationshipstore.db
-rw-r--r-- 1 neo4j nogroup     9 Oct 26 19:00 neostore.relationshipstore.db.id
-rw-r--r-- 1 neo4j nogroup     0 Oct 26 18:46 neostore.relationshiptypestore.db
-rw-r--r-- 1 neo4j nogroup     9 Oct 26 19:00 neostore.relationshiptypestore.db.id
-rw-r--r-- 1 neo4j nogroup  8192 Oct 26 18:46 neostore.relationshiptypestore.db.names
-rw-r--r-- 1 neo4j nogroup     9 Oct 26 19:00 neostore.relationshiptypestore.db.names.id
-rw-r--r-- 1 neo4j nogroup  8192 Oct 26 18:46 neostore.schemastore.db
-rw-r--r-- 1 neo4j nogroup     9 Oct 26 19:00 neostore.schemastore.db.id
-rw-r--r-- 1 neo4j nogroup    34 Oct 26 19:00 neostore.transaction.db.0
drwxr-xr-x 3 neo4j nogroup  4096 Oct 26 18:46 schema/
-rw-r--r-- 1 neo4j nogroup     0 Oct 26 18:46 store_lock

Would it be because of the "nogroup" group ?

Marko Rodriguez

unread,
Oct 26, 2015, 3:25:25 PM10/26/15
to gremli...@googlegroups.com
Hm.. Not sure. Can you point Neo4jGraph.open() to an empty directory and see if it works? E.g.:

Neo4jGraph.open('/tmp/neo4j-test')

Thanks,

Serge Scevenels

unread,
Oct 26, 2015, 4:07:53 PM10/26/15
to Gremlin-users
OK 

It works if i point to an non existing directory in the home user directory, i.e.

gremlin> graph=Neo4jGraph.open('/var/lib/neo4j/data/grem1')
java.io.IOException: Unable to create directory path [/var/lib/neo4j/data/grem1] for Neo4j store.

But it fails if i point to a non existing directory in the neo4j data directory, i.e.

gremlin> graph=Neo4jGraph.open('/var/lib/neo4j/data/grem1')
java.io.IOException: Unable to create directory path [/var/lib/neo4j/data/grem1] for Neo4j store.

the file permission for the data directory are :
drwxr-xr-x  5 neo4j adm

and gremlin console is running as vagrant user

Thanks for your availability,
Serge

Serge Scevenels

unread,
Oct 26, 2015, 4:09:43 PM10/26/15
to Gremlin-users
Sorry for the wrong cut/paste :

this is what i got when the directory is in the vagrant home :
 
gremlin> graph=Neo4jGraph.open('/home/vagrant/grem1')
==>neo4jgraph[EmbeddedGraphDatabase [/home/vagrant/grem1]]

Marko Rodriguez

unread,
Oct 26, 2015, 4:13:32 PM10/26/15
to gremli...@googlegroups.com
Hi,

I don't know. I suspect some permissions issues are happening on your OS. You can chmod and see if that opens things up. ?

e.g. chmod -R 777 .

Marko.
--
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-user...@googlegroups.com.

Serge Scevenels

unread,
Oct 26, 2015, 4:40:53 PM10/26/15
to Gremlin-users
OK,

with chmod -R 777 data,

gremlin can create a graph....

But then I tried to start the Neo4J server to see if the graph created via gremlin can be served... and it fails :(

This is what I did :

chmod -R 777 data

Then

gremlin> graph=Neo4jGraph.open('/var/lib/neo4j/data/grem1')
==>neo4jgraph[EmbeddedGraphDatabase [/var/lib/neo4j/data/grem1]]
gremlin> graph.close()
==>null
gremlin> :q

Then again 

chmod -R 777 data 

Then

I updated the file : neo4j-server.properties :
org.neo4j.server.database.location=data/grem1

Then: 

/etc/neo4j$ sudo service neo4j-service start
WARNING: Max 1024 open files allowed, minimum of 40 000 recommended. See the Neo4j manual.
Starting Neo4j Server...WARNING: not changing user
process [14210]... waiting for server to be ready... Failed to start within 120 seconds.
Neo4j Server may have failed to start, please check the logs.

Here is the output of the logs :

18:46:30.006 [main] DEBUG i.n.u.i.l.InternalLoggerFactory - Using SLF4J as the default logging framework
2015-10-26 18:46:42.778+0000 INFO  Successfully started database
2015-10-26 18:46:42.778+0000 INFO  Successfully started database
2015-10-26 18:46:42.915+0000 INFO  Starting HTTP on port 7474 (1 threads available)
2015-10-26 18:46:43.735+0000 INFO  Enabling HTTPS on port 7473
2015-10-26 18:46:44.159+0000 INFO  Mounting static content at /webadmin
2015-10-26 18:46:44.568+0000 INFO  Mounting static content at /browser
2015-10-26 18:46:49.170+0000 INFO  Remote interface ready and available at http://0.0.0.0:7474/
2015-10-26 18:46:51.905+0000 WARN  Failed authentication attempt for 'neo4j' from 192.168.33.1
2015-10-26 19:00:50.111+0000 INFO  Neo4j Server shutdown initiated by request
2015-10-26 19:00:50.173+0000 INFO  Successfully shutdown Neo4j Server
2015-10-26 19:00:50.274+0000 INFO  Successfully stopped database
2015-10-26 19:00:50.274+0000 INFO  Successfully shutdown database
20:29:55.211 [main] DEBUG i.n.u.i.l.InternalLoggerFactory - Using SLF4J as the default logging framework
2015-10-26 20:29:55.960+0000 INFO  Successfully shutdown Neo4j Server
2015-10-26 20:29:55.966+0000 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@279ad2e3' was successfully initialized, but failed to start. Please see attached cause exception. Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@279ad2e3' was successfully initialized, but failed to start. Please see attached cause exception.
org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@279ad2e3' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.server.exception.ServerStartupErrors.translateToServerStartupError(ServerStartupErrors.java:67)
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:234)
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:100)
at org.neo4j.server.CommunityBootstrapper.start(CommunityBootstrapper.java:48)
at org.neo4j.server.CommunityBootstrapper.main(CommunityBootstrapper.java:35)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.server.database.LifecycleManagingDatabase@279ad2e3' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:538)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:109)
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:194)
... 3 more
Suppressed: java.lang.RuntimeException: java.io.FileNotFoundException: /var/lib/neo4j/data/grem1/messages.log (Permission denied)
at org.neo4j.kernel.impl.factory.PlatformModule.createLogService(PlatformModule.java:259)
at org.neo4j.kernel.impl.factory.PlatformModule.<init>(PlatformModule.java:140)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.createPlatform(GraphDatabaseFacadeFactory.java:181)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:124)
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.server.CommunityNeoServer$1.newGraphDatabase(CommunityNeoServer.java:66)
at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:95)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:528)
... 5 more
Caused by: java.io.FileNotFoundException: /var/lib/neo4j/data/grem1/messages.log (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at org.neo4j.io.fs.DefaultFileSystemAbstraction.openAsOutputStream(DefaultFileSystemAbstraction.java:61)
at org.neo4j.io.file.Files.createOrOpenAsOuputStream(Files.java:47)
at org.neo4j.logging.RotatingFileOutputStreamSupplier.openOutputFile(RotatingFileOutputStreamSupplier.java:248)
at org.neo4j.logging.RotatingFileOutputStreamSupplier.<init>(RotatingFileOutputStreamSupplier.java:132)
at org.neo4j.logging.RotatingFileOutputStreamSupplier.<init>(RotatingFileOutputStreamSupplier.java:119)
at org.neo4j.kernel.impl.logging.StoreLogService.<init>(StoreLogService.java:164)
at org.neo4j.kernel.impl.logging.StoreLogService.<init>(StoreLogService.java:43)
at org.neo4j.kernel.impl.logging.StoreLogService$Builder.toFile(StoreLogService.java:110)
at org.neo4j.kernel.impl.logging.StoreLogService$Builder.inStoreDirectory(StoreLogService.java:105)
at org.neo4j.kernel.impl.factory.PlatformModule.createLogService(PlatformModule.java:250)
... 13 more
[CIRCULAR REFERENCE:java.lang.RuntimeException: java.io.FileNotFoundException: /var/lib/neo4j/data/grem1/messages.log (Permission denied)]
20:31:11.061 [main] DEBUG i.n.u.i.l.InternalLoggerFactory - Using SLF4J as the default logging framework
2015-10-26 20:31:12.593+0000 INFO  Successfully shutdown Neo4j Server
2015-10-26 20:31:12.595+0000 ERROR Neo4j cannot be started, because the database files require upgrading and upgrades are disabled in configuration. Please set 'allow_store_upgrade' to 'true' in your configuration file and try again.o be ready... Failed to start within 120 seconds. 




 
...

Serge Scevenels

unread,
Oct 26, 2015, 4:59:28 PM10/26/15
to Gremlin-users
just another input.... don't know it it is relevant :

- Neo4J version installed is 2.3.0

by running following command in gremlin console :
:install org.apache.tinkerpop neo4j-gremlin 3.0.1-incubating
 
it installs the following directory the following jar file:
/home/vagrant/apache-gremlin-console-3.0.1-incubating/ext/neo4j-gremlin/plugin/neo4j-2.2.2.jar

which means i suppose the database created via gremlin is Neo4j 2.2.2 compliant.

Not knowing on how to install the plugin with neo4j 2.3.0, I tried to downgrade my ubuntu neo4j installation version to 2.2.2. and to repeat the process, but it was neither working 
...

Marko Rodriguez

unread,
Oct 26, 2015, 8:29:34 PM10/26/15
to gremli...@googlegroups.com
Hi,

Do you have Neo4j Server running in parallel and putting a lock on the files?

Marko.
--
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-user...@googlegroups.com.

Serge Scevenels

unread,
Oct 26, 2015, 11:31:43 PM10/26/15
to Gremlin-users
Hi,

No, i took care about stopping the Neo4j Server when I was trying to use the Gremlin console.

Serge
...
Reply all
Reply to author
Forward
0 new messages