Skip to content

Remote connection with Apache Gremlin TinkerPop ignores credentials and database choice settings #461

@svok

Description

@svok

ArcadeDB Version: ArcadeDB Server v22.1.3-SNAPSHOT (build d38e26a/1642118408201/main) - Docker version from Docker Hub

JDK Version: OpenJDK 17.0.2

OS: Ubuntu 20.04

I am using Apache Gremlin TinkerPop interface for remote connection. Sorry, remote connections are not cleanly described in ArcadeDb documentation and the tests in the code work only with one graph database.

Expected behavior

Remote connection with Apache Gremlin TinkerPop must use credentials and database choice settings. graph database must not be available since it is not configured on server.

Actual behavior

Remote connection with Apache Gremlin TinkerPop ignores credentials and database choice settings on client. The work is performed with default graph database with no restrictions.

Steps to reproduce

        val cluster = Cluster.build()
            .addContactPoints("localhost")
            .port(8182)
//            No credentials, no DB is chosen in spite of all they are set in the ArcadeDb Docker container
            .create()
        val g = traversal().withRemote(DriverRemoteConnection.using(cluster))
        g.addV("Test").next()        // Success!

The database graph is created on the server and it is accessible in the same way with all other requests ignoring security settings (username and password) of the ArcadeDb server.

[gremlin-driver-worker-2] INFO org.apache.tinkerpop.gremlin.driver.Connection - Created new connection for ws://localhost:8182/gremlin
[gremlin-driver-worker-1] INFO org.apache.tinkerpop.gremlin.driver.Connection - Created new connection for ws://localhost:8182/gremlin
[gremlin-driver-initializer] INFO org.apache.tinkerpop.gremlin.driver.ConnectionPool - Opening connection pool on Host{address=localhost/127.0.0.1:8182, hostUri=ws://localhost:8182/gremlin} with core size of 2

The following query also works properly:

        val db = RemoteDatabase("localhost", 2480, "mkpl", "root", "root_root")
        val z = db.command("gremlin", "g.V()")
        println("RESULTS: ${z.stream().map { it.toJSON() }.asSequence().joinToString("\n")}")

But as I change my database to the custom, it fails:

        val cluster = Cluster.build()
            .addContactPoints("localhost")
            .port(8182)
            .credentials("root", "root_root")
            .create()
        val g = traversal().withRemote(DriverRemoteConnection.using(cluster, "mkpl"))
        g.addV("Test").next()        // Failure!
2022-07-24 08:45:07.521 INFO  [ArcadeDBServer] <ArcadeDB_0> ArcadeDB Server v22.1.3-SNAPSHOT (build d38e26aa6978b19d0d69999919b5c076fc994d37/1642118408201/main) is starting up...
2022-07-24T08:45:07.546571025Z 2022-07-24 08:45:07.522 INFO  [ArcadeDBServer] <ArcadeDB_0> Starting ArcadeDB Server with plugins [GremlinServer] ...
2022-07-24T08:45:07.742206110Z 2022-07-24 08:45:07.546 INFO  [ArcadeDBServer] <ArcadeDB_0> - JMX Metrics Started...
2022-07-24T08:45:07.743363765Z 2022-07-24 08:45:07.741 WARNI [EmbeddedDatabase] <ArcadeDB_0> Database 'mkpl' was not closed properly last time
2022-07-24T08:45:07.754240716Z 2022-07-24 08:45:07.743 WARNI [TransactionManager] <ArcadeDB_0> Started recovery of database 'mkpl'
2022-07-24T08:45:07.763871267Z 2022-07-24 08:45:07.753 WARNI [TransactionManager] <ArcadeDB_0> Recovery of database 'mkpl' completed
2022-07-24T08:45:07.764320285Z 2022-07-24 08:45:07.763 WARNI [EmbeddedDatabase] <ArcadeDB_0> Database 'test' was not closed properly last time
2022-07-24T08:45:07.767699978Z 2022-07-24 08:45:07.764 WARNI [TransactionManager] <ArcadeDB_0> Started recovery of database 'test'
2022-07-24T08:45:07.775501717Z 2022-07-24 08:45:07.767 WARNI [TransactionManager] <ArcadeDB_0> Recovery of database 'test' completed
2022-07-24T08:45:07.775713047Z 2022-07-24 08:45:07.775 WARNI [EmbeddedDatabase] <ArcadeDB_0> Database 'mkpl1' was not closed properly last time
2022-07-24T08:45:07.778601684Z 2022-07-24 08:45:07.775 WARNI [TransactionManager] <ArcadeDB_0> Started recovery of database 'mkpl1'
2022-07-24T08:45:07.823217408Z 2022-07-24 08:45:07.778 WARNI [TransactionManager] <ArcadeDB_0> Recovery of database 'mkpl1' completed
2022-07-24T08:45:08.580369379Z 2022-07-24 08:45:07.822 INFO  [ServerSecurity] <ArcadeDB_0> Creating root user with the provided password[main] INFO org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager - Graph [graph] was successfully configured via [../config/gremlin-server.properties].
2022-07-24T08:45:08.580565531Z [main] INFO org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor - Initialized Gremlin thread pool.  Threads in pool named with pattern gremlin-*
2022-07-24T08:45:08.601334459Z [main] INFO org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor - Initialized GremlinExecutor and preparing GremlinScriptEngines instances.
2022-07-24T08:45:08.757776848Z WARNING: An illegal reflective access operation has occurred
2022-07-24T08:45:08.757812344Z WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/home/arcadedb/lib/arcadedb-gremlin-22.1.3-SNAPSHOT.jar) to method java.lang.Object.finalize()
2022-07-24T08:45:08.757820719Z WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
2022-07-24T08:45:08.757827682Z WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
2022-07-24T08:45:08.757834324Z WARNING: All illegal access operations will be denied in a future release
2022-07-24T08:45:10.082734768Z [main] INFO org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor - Initialized gremlin-groovy GremlinScriptEngine and registered metrics
2022-07-24T08:45:10.086002972Z [main] INFO org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor - A GraphTraversalSource is now bound to [g] with graphtraversalsource[arcadegraph[graph], standard]
2022-07-24T08:45:10.086054397Z [main] INFO org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor - A GraphTraversalSource is now bound to [graph] with graphtraversalsource[arcadegraph[graph], standard]
2022-07-24T08:45:10.096761085Z [main] INFO org.apache.tinkerpop.gremlin.server.op.OpLoader - Adding the standard OpProcessor.
2022-07-24T08:45:10.309743444Z [main] INFO org.apache.tinkerpop.gremlin.server.op.OpLoader - Adding the session OpProcessor.
2022-07-24T08:45:10.314063951Z [main] INFO org.apache.tinkerpop.gremlin.server.op.OpLoader - Adding the traversal OpProcessor.
2022-07-24T08:45:10.350586803Z [main] INFO org.apache.tinkerpop.gremlin.server.GremlinServer - Executing start up LifeCycleHook
2022-07-24T08:45:10.362440108Z [main] INFO org.apache.tinkerpop.gremlin.server.GremlinServer - Executed once at startup of Gremlin Server.
2022-07-24T08:45:10.369513087Z [main] INFO org.apache.tinkerpop.gremlin.server.GremlinServer - idleConnectionTimeout was set to 0 which resolves to 0 seconds when configuring this value - this feature will be disabled
2022-07-24T08:45:10.369551908Z [main] INFO org.apache.tinkerpop.gremlin.server.GremlinServer - keepAliveInterval was set to 0 which resolves to 0 seconds when configuring this value - this feature will be disabled
2022-07-24T08:45:10.409890756Z [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.graphbinary-v1.0 with org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1
2022-07-24T08:45:10.430904163Z [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v3.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
2022-07-24T08:45:10.430977308Z [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
2022-07-24T08:45:10.436190162Z [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v2.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0
2022-07-24T08:45:10.436230186Z [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - application/json already has org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0 configured - it will not be replaced by org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0, change order of serialization configuration if this is not desired.
2022-07-24T08:45:10.495719311Z 
2022-07-24T08:45:10.496104742Z 2022-07-24 08:45:10.495 INFO  [ArcadeDBServer] <ArcadeDB_0> - GremlinServer plugin started
2022-07-24T08:45:10.502313295Z 2022-07-24 08:45:10.495 INFO  [HttpServer] <ArcadeDB_0> - Starting HTTP Server (host=0.0.0.0 port=2480-2489)...[gremlin-server-boss-1] INFO org.apache.tinkerpop.gremlin.server.GremlinServer - Gremlin Server configured with worker thread pool of 1, gremlin pool of 8 and boss thread pool of 1.
2022-07-24T08:45:10.502499659Z [gremlin-server-boss-1] INFO org.apache.tinkerpop.gremlin.server.GremlinServer - Channel started at port 8182.
2022-07-24T08:45:10.543587831Z 
2022-07-24T08:45:10.554269211Z 2022-07-24 08:45:10.543 INFO  [undertow] starting server: Undertow - 2.2.14.Final
2022-07-24T08:45:10.568263258Z 2022-07-24 08:45:10.553 INFO  [xnio] XNIO version 3.8.4.Final
2022-07-24T08:45:10.599636924Z 2022-07-24 08:45:10.568 INFO  [nio] XNIO NIO Implementation Version 3.8.4.Final
2022-07-24T08:45:10.652502609Z 2022-07-24 08:45:10.599 INFO  [threads] JBoss Threads version 3.1.0.Final
2022-07-24T08:45:10.656498738Z 2022-07-24 08:45:10.652 INFO  [HttpServer] <ArcadeDB_0> - HTTP Server started (host=0.0.0.0 port=2480)
2022-07-24T08:45:10.657742935Z 2022-07-24 08:45:10.656 INFO  [ArcadeDBServer] <ArcadeDB_0> Available query languages: [mongo, gremlin, cypher, graphql, sql]
2022-07-24T08:45:10.657828092Z 2022-07-24 08:45:10.657 INFO  [ArcadeDBServer] <ArcadeDB_0> ArcadeDB Server started (CPUs=8 MAXRAM=2.00GB)
2022-07-24T08:46:02.187502002Z 2022-07-24 08:45:10.657 INFO  [ArcadeDBServer] <ArcadeDB_0> Studio web tool available at http://localhost:2480 [gremlin-server-worker-1] WARN org.apache.tinkerpop.gremlin.server.handler.OpSelectorHandler - The traversal source [mkpl] for alias [g] is not configured on the server.
2022-07-24T08:46:02.188461802Z org.apache.tinkerpop.gremlin.server.op.OpProcessorException: The traversal source [mkpl] for alias [g] is not configured on the server.
2022-07-24T08:46:02.189466675Z 	at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.validateTraversalSourceAlias(TraversalOpProcessor.java:124)
2022-07-24T08:46:02.189506700Z 	at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.select(TraversalOpProcessor.java:106)
2022-07-24T08:46:02.189518753Z 	at org.apache.tinkerpop.gremlin.server.handler.OpSelectorHandler.decode(OpSelectorHandler.java:79)
2022-07-24T08:46:02.189694613Z 	at org.apache.tinkerpop.gremlin.server.handler.OpSelectorHandler.decode(OpSelectorHandler.java:48)
2022-07-24T08:46:02.189719880Z 	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88)
2022-07-24T08:46:02.189729187Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
2022-07-24T08:46:02.189737884Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
2022-07-24T08:46:02.189745318Z 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
2022-07-24T08:46:02.189752130Z 	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
2022-07-24T08:46:02.189769553Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
2022-07-24T08:46:02.189778309Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
2022-07-24T08:46:02.189797636Z 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
2022-07-24T08:46:02.189968115Z 	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
2022-07-24T08:46:02.189986329Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
2022-07-24T08:46:02.189994094Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
2022-07-24T08:46:02.190035882Z 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
2022-07-24T08:46:02.190054437Z 	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
2022-07-24T08:46:02.190148273Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
2022-07-24T08:46:02.190166136Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
2022-07-24T08:46:02.190172689Z 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
2022-07-24T08:46:02.190291642Z 	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
2022-07-24T08:46:02.190309846Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
2022-07-24T08:46:02.190316659Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
2022-07-24T08:46:02.190324283Z 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
2022-07-24T08:46:02.190361443Z 	at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93)
2022-07-24T08:46:02.190462662Z 	at io.netty.handler.codec.http.websocketx.Utf8FrameValidator.channelRead(Utf8FrameValidator.java:82)
2022-07-24T08:46:02.190490745Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
2022-07-24T08:46:02.190498339Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
2022-07-24T08:46:02.190931962Z 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
2022-07-24T08:46:02.190962750Z 	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
2022-07-24T08:46:02.190972097Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
2022-07-24T08:46:02.190980162Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
2022-07-24T08:46:02.190987105Z 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
2022-07-24T08:46:02.190993207Z 	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
2022-07-24T08:46:02.190999338Z 	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
2022-07-24T08:46:02.191005720Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
2022-07-24T08:46:02.191012363Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
2022-07-24T08:46:02.191018695Z 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
2022-07-24T08:46:02.191029214Z 	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
2022-07-24T08:46:02.191036228Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
2022-07-24T08:46:02.191054903Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
2022-07-24T08:46:02.191097252Z 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
2022-07-24T08:46:02.191133400Z 	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
2022-07-24T08:46:02.191226945Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
2022-07-24T08:46:02.191238116Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
2022-07-24T08:46:02.191279123Z 	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
2022-07-24T08:46:02.191302306Z 	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
2022-07-24T08:46:02.191390622Z 	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
2022-07-24T08:46:02.191412653Z 	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
2022-07-24T08:46:02.191434294Z 	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
2022-07-24T08:46:02.191469329Z 	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
2022-07-24T08:46:02.191560260Z 	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
2022-07-24T08:46:02.191572503Z 	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
2022-07-24T08:46:02.191577963Z 	at java.base/java.lang.Thread.run(Thread.java:829)

If I set wrong password it also works:

        val cluster = Cluster.build()
            .addContactPoints("localhost")
            .port(8182)
            .credentials("root", "root_root_1")
            .create()
        val g = traversal().withRemote(DriverRemoteConnection.using(cluster, "graph"))
        g.addV("Test").next()        // Faulty Success!
[gremlin-driver-worker-2] INFO org.apache.tinkerpop.gremlin.driver.Connection - Created new connection for ws://localhost:8182/gremlin
[gremlin-driver-worker-1] INFO org.apache.tinkerpop.gremlin.driver.Connection - Created new connection for ws://localhost:8182/gremlin
[gremlin-driver-initializer] INFO org.apache.tinkerpop.gremlin.driver.ConnectionPool - Opening connection pool on Host{address=localhost/127.0.0.1:8182, hostUri=ws://localhost:8182/gremlin} with core size of 2
[Test worker] INFO org.apache.tinkerpop.gremlin.driver.ConnectionPool - Signalled closing of connection pool on Host{address=localhost/127.0.0.1:8182, hostUri=ws://localhost:8182/gremlin} with core size of 2

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions