Repository navigation
Cannot restart gremlin-server enabled database with preexisting database. #213
Copy link
Copy link
Closed
Milestone
Description
ArcadeDB Version: ArcadeDB Server v21.11.1-SNAPSHOT (build 494adfa/1637138916067/main)
JDK Version: ?? What ever is on the docker image
OS: Whatever is on the docker image
Expected behavior
Server to start up normally
Actual behavior
second run or with defaults server startup logs
[main] WARN org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager - Graph [graph] configured at [../config/gremlin-server.properties] could not be instantiated and will not be available in Gremlin Server. GraphFactory message: GraphFactory could not instantiate this Graph implementation [class org.apache.tinkerpop.gremlin.arcadedb.structure.ArcadeGraph]
java.lang.RuntimeException: GraphFactory could not instantiate this Graph implementation [class org.apache.tinkerpop.gremlin.arcadedb.structure.ArcadeGraph]
at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:84)
at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:72)
at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:106)
at org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager.addGraph(DefaultGraphManager.java:63)
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
at org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager.<init>(DefaultGraphManager.java:58)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.<init>(ServerGremlinExecutor.java:84)
at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServer.java:124)
at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServer.java:87)
at com.arcadedb.server.gremlin.GremlinServerPlugin.startService(GremlinServerPlugin.java:77)
at com.arcadedb.server.ArcadeDBServer.registerPlugins(ArcadeDBServer.java:187)
at com.arcadedb.server.ArcadeDBServer.start(ArcadeDBServer.java:132)
at com.arcadedb.server.ArcadeDBServer.main(ArcadeDBServer.java:89)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:80)
... 16 more
Caused by: com.arcadedb.exception.DatabaseOperationException: Error on creating new database instance
at com.arcadedb.database.EmbeddedDatabase.openInternal(EmbeddedDatabase.java:1647)
at com.arcadedb.database.EmbeddedDatabase.open(EmbeddedDatabase.java:184)
at com.arcadedb.database.DatabaseFactory.open(DatabaseFactory.java:73)
at com.arcadedb.database.DatabaseFactory.open(DatabaseFactory.java:65)
at org.apache.tinkerpop.gremlin.arcadedb.structure.ArcadeGraph.<init>(ArcadeGraph.java:91)
at org.apache.tinkerpop.gremlin.arcadedb.structure.ArcadeGraph.open(ArcadeGraph.java:118)
... 21 more
Caused by: com.arcadedb.utility.LockException: Database 'graph' is locked by another process (path=/home/arcadedb/databases/graph)
at com.arcadedb.database.EmbeddedDatabase.lockDatabase(EmbeddedDatabase.java:1493)
at com.arcadedb.database.EmbeddedDatabase.checkForRecovery(EmbeddedDatabase.java:1586)
at com.arcadedb.database.EmbeddedDatabase.openInternal(EmbeddedDatabase.java:1625)
... 26 more
Caused by: java.nio.channels.OverlappingFileLockException
at java.base/sun.nio.ch.FileLockTable.checkList(FileLockTable.java:229)
at java.base/sun.nio.ch.FileLockTable.add(FileLockTable.java:123)
at java.base/sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1154)
at java.base/java.nio.channels.FileChannel.tryLock(FileChannel.java:1165)
at com.arcadedb.database.EmbeddedDatabase.lockDatabase(EmbeddedDatabase.java:1474)
... 28 more
Steps to reproduce
- Run the
docker command without defaultfirst time things will start up and be queryable via gremlin api. But not the arcade db UI. (http://localhost:2480/#) - run
docker rm -f graphdband then the docker command below. Stack trace mentioned above will show. The database graph will be available via the UI but not gremlin api.
if ran with -e "arcadedb.server.defaultDatabases=graph[root]" the graph will return the above stacktrace but the database graph will be available in the ui.
docker command without default
# powershell
docker run -d --name graphdb `
-p 2424:2424 -p 2480:2480 -p 8182:8182 `
-v $PWD/config:/home/arcadedb/config `
-v $PWD/data:/home/arcadedb/databases `
-e "arcadedb.server.rootPassword=playwithdata" `
-e arcadedb.server.plugins=GremlinServer:com.arcadedb.server.gremlin.GremlinServerPlugin `
arcadedata/arcadedb:latestdocker logs
docker logs --tail 1000 -f graphdb
gremlin-server.groovy
import org.apache.tinkerpop.gremlin.server.util.LifeCycleHook
def globals = [:]
// defines a sample LifeCycleHook that prints some output to the Gremlin Server console.
// note that the name of the key in the "global" map is unimportant.
globals << [hook : [
onStartUp: { ctx ->
ctx.logger.info("Executed once at startup of Gremlin Server.")
},
onShutDown: { ctx ->
ctx.logger.info("Executed once at shutdown of Gremlin Server.")
}
] as LifeCycleHook]
// define the default TraversalSource to bind queries to - this one will be named "g".
globals << [graph : graph.traversal()]
gremlin-server.properties
gremlin.graph=org.apache.tinkerpop.gremlin.arcadedb.structure.ArcadeGraph
gremlin.arcadedb.directory=/home/arcadedb/databases/graph
Reactions are currently unavailable

Activity
lvca commentedon Nov 18, 2021
Thanks for opening this issue. First of all, I just realized the new
gremlin-server.*files are not included in the distribution (and therefore docker), but they should provide a basic standard cfg, so I've just added them as b45821f. About the database I guess the issue with the server is that it demands to have the database under the server'sdatabasesdirectory, but I'm not sure the graph is created there from the Gremlin Server. I'm gonna test this more.michaelawarren commentedon Dec 1, 2021
Is there any update on this?
lvca commentedon Dec 1, 2021
Hi @michaelawarren, I had lost track of this issue, but I pushed a bunch of fixes for the Gremlin Server that should have resolved the problem. Please let me know if you can find further issues with the Gremlin Server.
michaelawarren commentedon Dec 1, 2021
This problem still persists as described.
lvca commentedon Dec 2, 2021
@michaelawarren thanks, checking it right now.
lvca commentedon Dec 2, 2021
Reproduced.
Fixed issue with Gremlin Server and default database
lvca commentedon Dec 3, 2021
Hi,
The default path of server-gremlin.yaml contained the wrong path for both groovy and properties file.
Please use the latest docker image and start it with:
michaelawarren commentedon Dec 7, 2021
@lvca looks like the gremlin server is now working without errors with the instructions you have given me using the latest docker image. I'm still seeing some odd behavior though.
g.V()lvca commentedon Dec 14, 2021
Reproduced. The Gremlin API creates a
graphdatabase under the directorybin/databasesof the container. Working on a fix.Fixed Gremlin Server database path
lvca commentedon Dec 14, 2021
The issue was with the default
gremlin-server.properties. I replacedwith
Pushed the changes, please wait for the docker image to be regenerated.
lvca commentedon Dec 14, 2021
The image is public on Docker Hub. Please fetch the latest and let us know. I tested and now work in all the cases.
chore(deps): bump org.codehaus.mojo:build-helper-maven-plugin from 3.…
chore(deps): bump org.apache.maven.plugins:maven-assembly-plugin from…
chore(studio-deps-dev)(deps-dev): bump webpack-sources from 3.4.0 to …
Fixed issue with Gremlin Server and default database
Fixed Gremlin Server database path
chore(deps): bump org.codehaus.mojo:build-helper-maven-plugin from 3.…
chore(deps): bump org.apache.maven.plugins:maven-assembly-plugin from…
chore(studio-deps-dev)(deps-dev): bump webpack-sources from 3.4.0 to …