Adven27 / grpc-wiremock

gRPC Mock Server
MIT License
93 stars 40 forks source link

GRPC -bin header unmarshalling #25

Closed stanislavla closed 3 years ago

stanislavla commented 3 years ago

Error processing request headers


ERROR 124 --- [ault-executor-0] io.grpc.internal.SerializingExecutor     : Exception while executing runnable io.grpc.internal.ServerImpl$ServerTransportListenerImpl$1HandleServerCall@494a7ef5

java.lang.IllegalStateException: java.lang.IllegalArgumentException: ASCII header is named grpc-tags-bin.  Only binary headers may end with -bin
    at io.grpc.internal.ServerImpl$ServerTransportListenerImpl$1HandleServerCall.runInternal(ServerImpl.java:619) ~[grpc-core-1.41.0.jar:1.41.0]
    at io.grpc.internal.ServerImpl$ServerTransportListenerImpl$1HandleServerCall.runInContext(ServerImpl.java:603) ~[grpc-core-1.41.0.jar:1.41.0]
    at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.41.0.jar:1.41.0]
    at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133) ~[grpc-core-1.41.0.jar:1.41.0]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
    at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
Caused by: java.lang.IllegalArgumentException: ASCII header is named grpc-tags-bin.  Only binary headers may end with -bin
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:444) ~[guava-30.1-android.jar:na]
    at io.grpc.Metadata$AsciiKey.<init>(Metadata.java:960) ~[grpc-api-1.41.0.jar:1.41.0]
    at io.grpc.Metadata$AsciiKey.<init>(Metadata.java:954) ~[grpc-api-1.41.0.jar:1.41.0]
    at io.grpc.Metadata$Key.of(Metadata.java:705) ~[grpc-api-1.41.0.jar:1.41.0]
    at io.grpc.Metadata$Key.of(Metadata.java:701) ~[grpc-api-1.41.0.jar:1.41.0]
    at io.adven.grpc.wiremock.HeaderPropagationInterceptor.lambda$asMap$0(HeaderPropagationInterceptor.java:31) ~[main/:na]
    at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:178) ~[na:na]
    at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169) ~[na:na]
    at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1603) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na]
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[na:na]
    at io.adven.grpc.wiremock.HeaderPropagationInterceptor.asMap(HeaderPropagationInterceptor.java:31) ~[main/:na]
    at io.adven.grpc.wiremock.HeaderPropagationInterceptor.interceptCall(HeaderPropagationInterceptor.java:23) ~[main/:na]
    at io.grpc.ServerInterceptors$InterceptCallHandler.startCall(ServerInterceptors.java:244) ~[grpc-api-1.41.0.jar:1.41.0]
    at io.adven.grpc.wiremock.ExceptionHandler.interceptCall(ExceptionHandler.java:22) ~[main/:na]
    at io.grpc.ServerInterceptors$InterceptCallHandler.startCall(ServerInterceptors.java:244) ~[grpc-api-1.41.0.jar:1.41.0]
    at io.grpc.internal.ServerImpl$ServerTransportListenerImpl.startWrappedCall(ServerImpl.java:703) ~[grpc-core-1.41.0.jar:1.41.0]
    at io.grpc.internal.ServerImpl$ServerTransportListenerImpl.access$2200(ServerImpl.java:406) ~[grpc-core-1.41.0.jar:1.41.0]
    at io.grpc.internal.ServerImpl$ServerTransportListenerImpl$1HandleServerCall.runInternal(ServerImpl.java:615) ~[grpc-core-1.41.0.jar:1.41.0]
    ... 6 common frames omitted

Steps to reproduce the behavior:

  1. Reproduced on release including and after 1.2.1
  2. GRPC microservice send request with commonly used header grpc-tags-bin
  3. Error in logs grpc-wiremock: ASCII header is named grpc-tags-bin. Only binary headers may end with -bin

Expected behavior Processing request including headers like grpc-tags-bin