Search code examples
gremlin

CorruptedFrameException: on multiple addV() gremlin query in remote client


Tool Set: DB Server: TinkerPop/TinkerGraph v 3.3.3 (Stanalone - using a conf/gremlin-server.yaml) (channelizer: org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer)

Client : Gremlin client from Java.

Issue: When I call the client.submitAsync() multiple times I receive an Exception. The repeat count until exception is thrown differs if I change the query content. This indicates to me that it has something to be done at the client side configuration!

2018-11-07 09:57:59.418 ERROR 20672 --- [n-driver-loop-2] o.a.t.g.d.Handler$GremlinResponseHandler : Could not process the response io.netty.handler.codec.CorruptedFrameException: Max frame length of 65536 has been exceeded. at io.netty.handler.codec.http.websocketx.WebSocket08FrameDecoder.protocolViolation(WebSocket08FrameDecoder.java:412) ~[netty-all-4.1.24.Final.jar:4.1.24.Final] at io.netty.handler.codec.http.websocketx.WebSocket08FrameDecoder.decode(WebSocket08FrameDecoder.java:277) ~[netty-all-4.1.24.Final.jar:4.1.24.Final] at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489) ~[netty-all-4.1.24.Final.jar:4.1.24.Final] at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428) ~[netty-all-4.1.24.Final.jar:4.1.24.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265) ~[netty-all-4.1.24.Final.jar:4.1.24.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-all-4.1.24.Final.jar:4.1.24.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-all-4.1.24.Final.jar:4.1.24.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-all-4.1.24.Final.jar:4.1.24.Final] at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) [netty-all-4.1.24.Final.jar:4.1.24.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-all-4.1.24.Final.jar:4.1.24.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-all-4.1.24.Final.jar:4.1.24.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) [netty-all-4.1.24.Final.jar:4.1.24.Final] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [netty-all-4.1.24.Final.jar:4.1.24.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645) [netty-all-4.1.24.Final.jar:4.1.24.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580) [netty-all-4.1.24.Final.jar:4.1.24.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497) [netty-all-4.1.24.Final.jar:4.1.24.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459) [netty-all-4.1.24.Final.jar:4.1.24.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) [netty-all-4.1.24.Final.jar:4.1.24.Final] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]


Solution

  • Increase the connectionPool.maxContentLength on the driver and maxContentLength in Gremlin Server beyond 65536. Ideally the two sizes should match on client and server, but I suppose it doesn't have to.

    I assume you are submitting a very large script to the server based on this question. Take care with that. Large scripts, especially those that are not parameterized, can cause different problems to manifest in the behavior of your application.