Skip to content

Define Schema and Indexes with Gremlin Server Plugin #1143

Closed

Description

@David-N-Perkins

ArcadeDB Version:

23.2.1
Was getting ClassNotFound errors same as #869 with all newer releases.

OS and JDK Version:

Running ArcadeDB using the docker image, arcadedata/arcadedb. Running local Gremlin client on MacOS with Zulu JDK 17.

Expected behavior

Able to define schemas and create indexes.

Actual behavior

I'm trying to use ArcadeDB with the Gremlin Server plugin and having trouble figuring out how to create indexes. I can connect with a Gremlin remote traversal and insert data without any issues. My issue is that all the ArcadeDB tools are unable to access the default 'graph' database. In the Studio UI, the graph database isn't listed, so I can't connect to it and run any commands. If I exec onto the container and run bin/console.sh, I get this error when I try to connect.

> connect graph

ERROR:
com.arcadedb.console.ConsoleException: Database appears locked by server
    at com.arcadedb.console.Console.checkDatabaseIsLocked(Console.java:831)
    at com.arcadedb.console.Console.executeConnect(Console.java:410)
    at com.arcadedb.console.Console.execute(Console.java:249)
    at com.arcadedb.console.Console.parse(Console.java:727)
    at com.arcadedb.console.Console.interactiveMode(Console.java:129)
    at com.arcadedb.console.Console.execute(Console.java:179)
    at com.arcadedb.console.Console.main(Console.java:142)

Then I tried using the Rest API, but it says the graph database doesn't exist.

$ curl -X GET --user root:playwithdata http://localhost:2480/api/v1/exists/graph

{ "result" : false}%

I can't find anything in the docs about modifying the schema or creating indexes with using the Gremlin server plugin.

Steps to reproduce

Run the ArcadeDB docker image:

docker run --rm --name arcadedb -p 2424:2424 -p 2480:2480 -p 8182:8182 \
       --env JAVA_OPTS="-Darcadedb.server.rootPassword=playwithdata -Darcadedb.server.plugins=GremlinServer:com.arcadedb.server.gremlin.GremlinServerPlugin" \
            arcadedata/arcadedb:23.2.1

Exec into the container and run the console:
docker exec -it arcadedb bin/console.sh

Attempt to connect to the graph database:
connect graph

Activity

  1. lvca commented on Jun 20, 2023

    @lvca
    Member

    @David-N-Perkins the issue of using "graph" database from Studio should have been resolved a couple of months ago. I suggest upgrading to the latest and trying again.

  2. lvca commented on Jun 20, 2023

    @lvca
    Member

    Please comment this issue if you find out that the issue is still there with the latest version.

  3. self-assigned this
    on Jun 20, 2023
  4. added
    wontfixThis will not be worked on
    invalidThis doesn't seem right
    on Jun 20, 2023
  5. added this to the 23.6.1 milestone on Jun 20, 2023
  6. David-N-Perkins commented on Jun 21, 2023

    @David-N-Perkins
    Author

    I tried the latest release, 23.5.1, and get the same exception when attempting to connect to the graph database from the console.

    > connect graph
    
    ERROR:
    com.arcadedb.console.ConsoleException: Database appears locked by server
    	at com.arcadedb.console.Console.checkDatabaseIsLocked(Console.java:894)
    	at com.arcadedb.console.Console.executeConnect(Console.java:410)
    	at com.arcadedb.console.Console.execute(Console.java:249)
    	at com.arcadedb.console.Console.parse(Console.java:731)
    	at com.arcadedb.console.Console.interactiveMode(Console.java:129)
    	at com.arcadedb.console.Console.execute(Console.java:179)
    	at com.arcadedb.console.Console.main(Console.java:142)
    

    Also, I cannot connect to the database via a Gremlin remote connection. The client gets this root exception: java.lang.RuntimeException: WebSocket channel=[3f6cea6e] closed before the handshake could complete. Server logs could contain the reason for abrupt connection disconnect or the server might not be reachable from the client anymore.
    ArcadeDB has this in the logs:

    Failed to initialize a channel. Closing: [id: 0x9ee09d7b, L:/172.17.0.2:8182 - R:/172.17.0.1:43922]
    java.lang.NoSuchMethodError: 'void io.netty.handler.codec.DefaultHeadersImpl.<init>(io.netty.util.HashingStrategy, io.netty.handler.codec.ValueConverter, io.netty.handler.codec.DefaultHeaders$NameValidator, int, io.netty.handler.codec.DefaultHeaders$ValueValidator)'
    	at io.netty.handler.codec.http.DefaultHttpHeaders.<init>(DefaultHttpHeaders.java:86)
    	at io.netty.handler.codec.http.DefaultHttpHeaders.<init>(DefaultHttpHeaders.java:77)
    	at io.netty.handler.codec.http.DefaultHttpMessage.<init>(DefaultHttpMessage.java:41)
    	at io.netty.handler.codec.http.DefaultHttpResponse.<init>(DefaultHttpResponse.java:64)
    	at io.netty.handler.codec.http.DefaultFullHttpResponse.<init>(DefaultFullHttpResponse.java:62)
    	at io.netty.handler.codec.http.DefaultFullHttpResponse.<init>(DefaultFullHttpResponse.java:57)
    	at io.netty.handler.codec.http.DefaultFullHttpResponse.<init>(DefaultFullHttpResponse.java:43)
    	at io.netty.handler.codec.http.HttpObjectAggregator.<clinit>(HttpObjectAggregator.java:89)
    	at org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer.configure(WebSocketChannelizer.java:100)
    	at org.apache.tinkerpop.gremlin.server.AbstractChannelizer.initChannel(AbstractChannelizer.java:176)
    	at org.apache.tinkerpop.gremlin.server.AbstractChannelizer.initChannel(AbstractChannelizer.java:80)
    	at io.netty.channel.ChannelInitializer.initChannel(ChannelInitializer.java:129)
    	at io.netty.channel.ChannelInitializer.handlerAdded(ChannelInitializer.java:112)
    	at io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:1114)
    	at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:609)
    	at io.netty.channel.DefaultChannelPipeline.access$100(DefaultChannelPipeline.java:46)
    	at io.netty.channel.DefaultChannelPipeline$PendingHandlerAddedTask.execute(DefaultChannelPipeline.java:1463)
    	at io.netty.channel.DefaultChannelPipeline.callHandlerAddedForAllHandlers(DefaultChannelPipeline.java:1115)
    	at io.netty.channel.DefaultChannelPipeline.invokeHandlerAddedIfNeeded(DefaultChannelPipeline.java:650)
    	at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:514)
    	at io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:429)
    	at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:486)
    	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
    	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
    	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
    	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
    	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
    	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    	at java.base/java.lang.Thread.run(Thread.java:829)
    

    I believe this is the same problem as #869

  7. lvca commented on Jun 21, 2023

    @lvca
    Member

    I agree, it looks like the same issue to me as #869. From running an mvn dependency:tree in the arcadedb directory, I can see the right version of Netty is used: 4.1.86.Final. But also the MongoDB plugin is using an older version that shouldn't create issues, but just for testing, what happens if you delete the file lib/arcadedb-mongodbw-23.5.1.jar?

  8. lvca commented on Jun 21, 2023

    @lvca
    Member

    About the issue with the connect, this is expected: if you're using the database in a server, the only way to connect is by using a remote connection. You can try from Studio or from the console you need to connect by using connect remote:localhost:2480/graph root <password>

    The database is locked to prevent concurrent updates that bypass the server.

  9. reopened this on Jun 21, 2023
  10. David-N-Perkins commented on Jun 21, 2023

    @David-N-Perkins
    Author

    Ah, that worked! I wasn't able to find that in the documentation.

    That's enough for me to make progress with the older 23.2.1 version. Thank you.

  11. lvca commented on Jun 21, 2023

    @lvca
    Member

    Did you remove the mongodb jar too?

  12. David-N-Perkins commented on Jun 21, 2023

    @David-N-Perkins
    Author

    I haven't tried removing the MongoDB jar on the latest version. I'll give that a try when I have some time.

  13. David-N-Perkins commented on Jun 21, 2023

    @David-N-Perkins
    Author

    Yes, deleting lib/arcadedb-mongodbw-23.5.1.jar on the 23.5.1 release resolves the NoSuchMethodError exceptions.

  14. lvca commented on Jun 21, 2023

    @lvca
    Member

    Thanks for confirming it. I'm going to add this to issue #869 for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

invalidThis doesn't seem rightwontfixThis will not be worked on

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions