JanusGraph / janusgraph

JanusGraph: an open-source, distributed graph database
https://janusgraph.org
Other
5.2k stars 1.16k forks source link

When use gremlin session client will cause Failed to authenticate #4206

Open MiracleDx opened 5 months ago

MiracleDx commented 5 months ago

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

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)
MiracleDx commented 5 months ago

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.

FlorianHockmann commented 3 months ago

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

MiracleDx commented 3 months ago

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?

FlorianHockmann commented 3 months ago

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.

MiracleDx commented 3 months ago

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.

MiracleDx commented 1 month ago

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?

FlorianHockmann commented 1 month ago

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.