Skip to content

Cannot restart gremlin-server enabled database with preexisting database. #213

@michaelawarren

Description

@michaelawarren

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

First run
image

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

  1. Run the docker command without default first time things will start up and be queryable via gremlin api. But not the arcade db UI. (http://localhost:2480/#)
  2. run docker rm -f graphdb and 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:latest

docker 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions