Skip to content
CCPEDIAby Unity Nodes
App Development

Sandbox header size grpc error

9 posts1,081 views8 likesLast activity Jul 2020

  1. SnehaOP 1

    Hi Team,

    When i am trying to call one of the choice in DAML, i face below error. Can someone help me in root cause of the issue.

    WARNING: Stream Error
    io.netty.handler.codec.http2.Http2Exception$HeaderListSizeException: Header size exceeded max allowed size (8192)
            at io.netty.handler.codec.http2.Http2Exception.headerListSizeError(Http2Exception.java:189)
            at io.netty.handler.codec.http2.Http2CodecUtil.headerListSizeExceeded(Http2CodecUtil.java:233)
            at io.netty.handler.codec.http2.HpackEncoder.encodeHeadersEnforceMaxHeaderListSize(HpackEncoder.java:133)
            at io.netty.handler.codec.http2.HpackEncoder.encodeHeaders(HpackEncoder.java:117)
            at io.netty.handler.codec.http2.DefaultHttp2HeadersEncoder.encodeHeaders(DefaultHttp2HeadersEncoder.java:74)
            at io.netty.handler.codec.http2.DefaultHttp2FrameWriter.writeHeadersInternal(DefaultHttp2FrameWriter.java:501)
            at io.netty.handler.codec.http2.DefaultHttp2FrameWriter.writeHeaders(DefaultHttp2FrameWriter.java:260)
            at io.netty.handler.codec.http2.Http2OutboundFrameLogger.writeHeaders(Http2OutboundFrameLogger.java:51)
            at io.netty.handler.codec.http2.DecoratingHttp2FrameWriter.writeHeaders(DecoratingHttp2FrameWriter.java:45)
            at io.grpc.netty.NettyServerHandler$WriteMonitoringFrameWriter.writeHeaders(NettyServerHandler.java:1015)
            at io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder.sendHeaders(DefaultHttp2ConnectionEncoder.java:184)
            at io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder.writeHeaders0(DefaultHttp2ConnectionEncoder.java:233)
            at io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder.writeHeaders(DefaultHttp2ConnectionEncoder.java:151)
            at io.netty.handler.codec.http2.DecoratingHttp2FrameWriter.writeHeaders(DecoratingHttp2FrameWriter.java:45)
            at io.grpc.netty.NettyServerHandler.sendResponseHeaders(NettyServerHandler.java:690)
            at io.grpc.netty.NettyServerHandler.write(NettyServerHandler.java:609)
            at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717)
            at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:709)
            at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:792)
            at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:702)
            at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:1015)
            at io.netty.channel.AbstractChannel.write(AbstractChannel.java:289)
            at io.grpc.netty.WriteQueue$AbstractQueuedCommand.run(WriteQueue.java:200)
            at io.grpc.netty.WriteQueue.flush(WriteQueue.java:115)
            at io.grpc.netty.WriteQueue.access$000(WriteQueue.java:34)
            at io.grpc.netty.WriteQueue$1.run(WriteQueue.java:46)
            at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
            at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
            at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
            at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
            at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
            at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
            at java.lang.Thread.run(Unknown Source)
    
  2. Sneha 1

    One more error for reference

    20:24:32.301 [http-json-ledger-api-akka.actor.default-dispatcher-13] ERROR com.daml.http.CommandService - 'exercise failure
    io.grpc.StatusRuntimeException: INTERNAL: HTTP/2 error code: PROTOCOL_ERROR
    Received Rst Stream
            at io.grpc.Status.asRuntimeException(Status.java:533)
            at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:501)
            at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
            at io.grpc.internal.ClientCallImpl.access$500(ClientCallImpl.java:66)
            at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:689)
            at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$900(ClientCallImpl.java:577)
            at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:751)
            at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:740)
            at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
            at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at java.lang.Thread.run(Unknown Source)
    
  3. cocreature 1

    Hi @Sneha, this looks like the same issue that Georg was hitting in Sandbox error: Header size exceeded max allowed size (8192). Try increasing the debug level of sandbox and see if you can spot the error.

  4. Sneha 2

    Yeah sure will increase the size and see.

    Thank you @cocreature

  5. Sneha

    Hi @cocreature

    After increasing the size i see the actual error. But i see one wierd issue that the error of fromSome None is coming only in JSON API.
    In scenario its working fine and there is no error in sandbox terminal to. Could you help that is this any signature issue.

    io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Command interpretation error in LF-DAMLe: Interpretation error: Error: User abort: fromSome: None. Details: Last location: [DA.Optional:23], partial transaction: root node NodeId(4):
    at io.grpc.Status.asRuntimeException(Status.java:533)
    at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:501)
    at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
    at io.grpc.internal.ClientCallImpl.access$500(ClientCallImpl.java:66)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:689)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$900(ClientCallImpl.java:577)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:751)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:740)
    at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
    at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

  6. cocreature

    fromSome: None means that you called fromSome somewhere in your code on a value that was None. Without seeing the code, it’s hard to say what is going wrong.

    I would generally recommend to use fromSomeNote : Text -> Option a -> a instead of fromSome. The note (the text passed as the first argument) will show up in the error which allows you to track down where the error came from and provide additional context.

  7. Sneha

    Yeah fromSomeNote is a good idea, i will try that.

    Thank you.

  8. Luciano 1
    cocreature:

    The note (the text passed as the first argument) will show up in the error which allows you to track down where the error came from and provide additional context.

    We should probably mention this in the documentation …

  9. Gary_Verhaegen 2
    Luciano:

    We should probably mention this in the documentation …

    @cocreature has an open merged a PR to add that. Given our release cycles, though, that won’t make it to the landing docs site until 1.4.