Extracting the bug report discussed by @paul-k-civitas on #883
Hey @dpitera, a project I'm working on will need this feature, so I'm developing against a locally-built snapshot based off of the latest commit of master (commit 1fabde7e04f798f33a5b3fb6f45a12a20b6c68ff). I'm trying to verify that I can use the GraphTraversalSource.withRemote() functionality against a graph that was created dynamically in a previous client connection. I'm running the distributed Gremlin Server locally, and testing things via the Gremlin Console; I've done everything that the documentation suggests, and it appears to work fine. However, once the remote traversal source is created, if I try to actually execute a query against it, I get an exception thrown; the following script (executed on the Gremlin Console against a locally-running, clean Gremlin Server) illustrates what's happening:
gremlin> :remote connect tinkerpop.server conf/remote.yaml session
==>Configured localhost/127.0.0.1:8182-[d2601483-b7d4-4268-880f-ff681a42e246]
gremlin> :remote console
==>All scripts will now be sent to Gremlin Server - [localhost/127.0.0.1:8182]-[d2601483-b7d4-4268-880f-ff681a42e246] - type ':remote console' to return to local mode
gremlin>
gremlin> map = new HashMap<String, Object>()
gremlin> map.put("storage.backend", "cql")
==>null
gremlin> map.put("storage.hostname", "127.0.0.1")
==>null
gremlin> ConfiguredGraphFactory.createTemplateConfiguration(new MapConfiguration(map))
==>null
gremlin>
gremlin> graphName = "janus3"
==>janus3
gremlin> ConfiguredGraphFactory.create(graphName)
==>standardjanusgraph[cql:[127.0.0.1]]
gremlin>
gremlin> :remote close
==>Removed - Gremlin Server - [localhost/127.0.0.1:8182]-[d2601483-b7d4-4268-880f-ff681a42e246]
gremlin> Thread.sleep(25000)
==>null
gremlin> :remote connect tinkerpop.server conf/remote.yaml
==>Configured localhost/127.0.0.1:8182
gremlin> :remote console
==>All scripts will now be sent to Gremlin Server - [localhost/127.0.0.1:8182] - type ':remote console' to return to local mode
gremlin>
gremlin> ConfiguredGraphFactory.getGraphNames()
==>janus3
gremlin> janus3
==>standardjanusgraph[cql:[127.0.0.1]]
gremlin> janus3_traversal
==>graphtraversalsource[standardjanusgraph[cql:[127.0.0.1]], standard]
gremlin>
gremlin> cluster = org.apache.tinkerpop.gremlin.driver.Cluster.open('conf/remote-objects.yaml'); \
......1> graphObj = EmptyGraph.instance(); \
......2> traversalObj = graphObj.traversal().withRemote(org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection.using(cluster, "janus3_traversal")); \
......3> traversalObj.V().count();
The traversal source [janus3_traversal] for alias [g] is not configured on the server.
Type ':help' or ':h' for help.
Display stack trace? [yN]y
org.apache.tinkerpop.gremlin.jsr223.console.RemoteException: The traversal source [janus3_traversal] for alias [g] is not configured on the server.
at org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:178)
at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:99)
at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122)
at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:95)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:130)
at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:59)
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:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:89)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:146)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:453)
I'm also trying to connect to a dynamically-created graph using the Java API, and I get this error thrown, which may have a similar cause:
Client client = Cluster.open().connect().alias("janus3_traversal");
client.submit("g.V().count()").one().getLong();
Causes the following error on the server (a similar one is thrown in the Java client application code):
84672 [gremlin-server-worker-1] WARN org.apache.tinkerpop.gremlin.server.handler.OpSelectorHandler - The traversal source [janus3_traversal] for alias [g] is not configured on the server.
org.apache.tinkerpop.gremlin.server.op.OpProcessorException: The traversal source [janus3_traversal] for alias [g] is not configured on the server.
at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.validateTraversalSourceAlias(TraversalOpProcessor.java:233)
at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.select(TraversalOpProcessor.java:159)
at org.apache.tinkerpop.gremlin.server.handler.OpSelectorHandler.decode(OpSelectorHandler.java:88)
at org.apache.tinkerpop.gremlin.server.handler.OpSelectorHandler.decode(OpSelectorHandler.java:48)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler$1.channelRead(WebSocketServerProtocolHandler.java:159)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:312)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:286)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1304)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:921)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:135)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:646)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:581)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:498)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:460)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131)
at java.lang.Thread.run(Thread.java:745)
I tried modifying the script to execute cluster = org.apache.tinkerpop.gremlin.driver.Cluster.open('conf/remote.yaml'); instead, and encounter the same error. The file contains the following:
hosts: [localhost]
port: 8182
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
Hey @pluradj, thanks for creating this new issue. I see 0.3.0 just went out; is it definitively too late to shoe-horn the fix for this into the 0.3.0 release? We were hoping to use this functionality ASAP, and would rather not publish a snapshot version of JanusGraph to our internal repository. If not, is there a target release date for 0.3.1?
Yes, it's too late for 0.3.0. We've been trying to get it out since April.
I put a tentative date of mid-September for 0.3.1. It is possible that we could move up the date.
Hey @pluradj, now that the PR has been merged, should we close this ticket?
Yes. Tip for future PRs, if you make sure your commit comment has something like "Fixes #1200" in it, GitHub automatically closes the issue when the PR is merged.
Most helpful comment
Yes. Tip for future PRs, if you make sure your commit comment has something like "Fixes #1200" in it, GitHub automatically closes the issue when the PR is merged.