JanusGraph / janusgraph

JanusGraph: an open-source, distributed graph database

Home Page:https://janusgraph.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When use gremlin session client will cause Failed to authenticate

MiracleDx opened this issue · comments

I used session client to query, but it will cause Failed to authenticate in some times. I makesure username and password is right. I used it like

Cluster cluster = Cluster.open(filepath);
String uuid = UUID.randomUUID().toString();
Client client = cluster.connect(uuid);
client.submit("g.tx().open()"); 
client.submit(""); // this line is query something
...
client.submit("g.tx().commit()");

It will be throw Exception about "org.apache.tinkerpop.gremlin.driver.exception.ResponseException: Failed to authenticate". But when I request next, it will return sucess.

My Janusgraph is

  • Version: 1.0.0

  • Storage Backend: hbase

  • Mixed Index Backend: elasticsearch

  • Expected Behavior:

  • Current Behavior:

  • Steps to Reproduce:

Stack Trace

org.apache.tinkerpop.gremlin.driver.exception.ResponseException: Failed to authenticate
	at org.apache.tinkerpop.gremlin.driver.Handler$GremlinResponseHandler.channelRead0(Handler.java:246)
	at org.apache.tinkerpop.gremlin.driver.Handler$GremlinResponseHandler.channelRead0(Handler.java:201)
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at org.apache.tinkerpop.gremlin.driver.Handler$GremlinSaslAuthenticationHandler.channelRead0(Handler.java:127)
	at org.apache.tinkerpop.gremlin.driver.Handler$GremlinSaslAuthenticationHandler.channelRead0(Handler.java:69)
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93)
	at io.netty.handler.codec.http.websocketx.Utf8FrameValidator.channelRead(Utf8FrameValidator.java:82)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at java.lang.Thread.run(Thread.java:748)

I did some verification

client.submit("g.tx().open()"); 
Thread.sleep(300)
client.submit(""); // this line is query something
client.submit("g.tx().commit()");

or

client.submit(""); // this line is submit something
client.submit("g.tx().rollback()");

Those two ways didn't throw exception.

I wonder whether this is simply a variation of this TinkerPop issue: https://issues.apache.org/jira/browse/TINKERPOP-2132

issues.apache.org/jira/browse/TINKERPOP-2132

I wonder whether this is simply a variation of this TinkerPop issue: issues.apache.org/jira/browse/TINKERPOP-2132
Yes,I think so. I was used Gremlin 3.7.0,Is there a solution?

Not yet, but there is an open PR which should fix this problem: apache/tinkerpop#2525.
It will probably be released with TinkerPop 3.7.2 at the beginning of April. JanusGraph will then get the fix as soon as it upgrades to that version.

Not yet, but there is an open PR which should fix this problem: apache/tinkerpop#2525. It will probably be released with TinkerPop 3.7.2 at the beginning of April. JanusGraph will then get the fix as soon as it upgrades to that version.

Thanks. I will keep attention it.

Not yet, but there is an open PR which should fix this problem: apache/tinkerpop#2525. It will probably be released with TinkerPop 3.7.2 at the beginning of April. JanusGraph will then get the fix as soon as it upgrades to that version.

Hi, I already upgraded gremlin-client to 3.7.2, but it didn't work. Janusgraph has a upgrades plans to that version?

JanusGraph already supports TinkerPop 3.7.2 on master: #4404. So you could use a snapshot release to already get this fix instead of having to wait for the next official release.
If you decide to try that out, then it would of course be great if you could let us know here whether it solved the issue or not. So we know whether we can close this as fixed or whether we need to investiage this some more.