Skip to content

Bug: [grpc] WithBodyAsProtoBuf exception on match #1442

@Stepami

Description

@Stepami

Describe the bug

Getting a Request MatchResult failed for WireMockServer with mappings for different ProtoDefinions.
There are two types of exceptions i got from ProtoBufJsonConverter.Utils.SerializeUtils.ConvertProtoBufToObject method:

  1. Exception: System.IO.EndOfStreamException: Attempted to read past the end of the stream.
  2. Exception: ProtoBuf.ProtoException: Invalid wire-type; this usually means you have over-written a file without truncating or setting the length; see https://stackoverflow.com/q/2152978/23354

Expected behavior:

No errors during getting a Request MatchResult

Test to reproduce

I prepared repro repository which can be found here:

C# code Here is how i setup my grpc mocks:
using AutoFixture;
using Catalog.API.Grpc;
using Catalog.Contracts.Grpc;
using CustomerSegmentation.API.Grpc.CustomerSegmentation;
using Grpc.Net.Client;
using Layout.API;
using WireMock.Logging;
using WireMock.RequestBuilders;
using WireMock.ResponseBuilders;
using WireMock.Server;
using WireMock.Settings;

var fixture = new Fixture();
var wireMockServer = WireMockServer.Start(
    new WireMockServerSettings
    {
        Urls = ["grpc://localhost:54321"],
        UseSSL = false,
        Logger = new WireMockConsoleLogger(),
    });
wireMockServer
    .AddProtoDefinition(
        nameof(LayoutServiceGrpc),
        File.ReadAllText(Path.Combine("protoDefinitions", "layoutApi", "layout.proto")))
    .AddProtoDefinition(
        nameof(CustomerSegmentationService),
        File.ReadAllText(Path.Combine("protoDefinitions", "customerSegmentation", "api.proto")))
    .AddProtoDefinition(
        nameof(CatalogCategoryService),
        [
            ProtoHelper.GetWireMockProtoDefinition(
                "// catalogCategoryService.proto",
                Path.Combine("catalog-api", "catalogCategoryService.proto")),
            ProtoHelper.GetWireMockProtoDefinition(
                "// protoDefinitions/catalog/catalogLayouts.proto",
                Path.Combine("catalog", "catalogLayouts.proto")),
            ProtoHelper.GetWireMockProtoDefinition(
                "// protoDefinitions/catalog/catalogBreadcrumb.proto",
                Path.Combine("catalog", "catalogBreadcrumb.proto")),
            ProtoHelper.GetWireMockProtoDefinition(
                "// protoDefinitions/catalog/catalogCategory.proto",
                Path.Combine("catalog", "catalogCategory.proto"))
        ]);

var getNavigationResponseGrpc = new GetNavigationResponseGrpc
{
    General = { fixture.CreateMany<CatalogCategoryGrpc>() }
};
wireMockServer
    .Given(
        Request.Create()
            .UsingPost()
            .WithHttpVersion("2")
            .WithPath("/catalog.CatalogCategoryService/GetNavigation")
            .WithBodyAsProtoBuf(typeof(GetNavigationRequestGrpc).FullName!))
    .WithProtoDefinition(nameof(CatalogCategoryService))
    .RespondWith(
        Response.Create()
            .WithHeader("Content-Type", "application/grpc")
            .WithTrailingHeader("grpc-status", "0")
            .WithBodyAsProtoBuf(
                typeof(GetNavigationResponseGrpc).FullName!,
                getNavigationResponseGrpc)
            .WithTransformer());

var getCustomerSegmentsResponseGrpc = new GetCustomerSegmentsResponse
{
    Segments = { fixture.CreateMany<string>() }
};
wireMockServer
    .Given(
        Request.Create()
            .UsingPost()
            .WithHttpVersion("2")
            .WithPath("/customerSegmentation.CustomerSegmentationService/GetCustomerSegments")
            .WithBodyAsProtoBuf(typeof(GetCustomerSegmentsRequest).FullName!))
    .WithProtoDefinition(nameof(CustomerSegmentationService))
    .RespondWith(
        Response.Create()
            .WithHeader("Content-Type", "application/grpc")
            .WithTrailingHeader("grpc-status", "0")
            .WithBodyAsProtoBuf(
                typeof(GetCustomerSegmentsResponse).FullName!,
                getCustomerSegmentsResponseGrpc)
            .WithTransformer());

var getLayoutsResponseGrpc = new GetLayoutsResponseGrpc
{
    Layouts =
    {
        new LayoutGrpc
        {
            Id = Guid.NewGuid().ToString(),
            EntityIds = { fixture.CreateMany<string>() },
            EntityType = EntityTypeGrpc.CatalogNavigation,
            Widgets = { fixture.CreateMany<WidgetV2Grpc>() }
        }
    }
};
wireMockServer
    .Given(
        Request.Create()
            .UsingPost()
            .WithHttpVersion("2")
            .WithPath("/layout.LayoutServiceGrpc/GetLayouts")
            .WithBodyAsProtoBuf(typeof(GetLayoutsRequestGrpc).FullName!))
    .WithProtoDefinition(nameof(LayoutServiceGrpc))
    .RespondWith(
        Response.Create()
            .WithHeader("Content-Type", "application/grpc")
            .WithTrailingHeader("grpc-status", "0")
            .WithBodyAsProtoBuf(
                typeof(GetLayoutsResponseGrpc).FullName!,
                getLayoutsResponseGrpc)
            .WithTransformer());

var channel = GrpcChannel.ForAddress(wireMockServer.Url ?? throw new Exception("Grpc channel null"));

var catalogCategoryServiceClient = new CatalogCategoryService.CatalogCategoryServiceClient(channel);
_ = await catalogCategoryServiceClient.GetNavigationAsync(
    new()
    {
        Platform = "mini",
        LanguageId = "ru_RU",
    });
var customerSegmentationServiceClient = new CustomerSegmentationService.CustomerSegmentationServiceClient(channel);
_ = await customerSegmentationServiceClient.GetCustomerSegmentsAsync(
    new()
    {
        Platform = "mini",
    });
var layoutServiceGrpcClient = new LayoutServiceGrpc.LayoutServiceGrpcClient(channel);
_ = await layoutServiceGrpcClient.GetLayoutsAsync(
    new GetLayoutsRequestGrpc
    {
        ByLayoutType = new()
        {
            LayoutType = LayoutTypeGrpc.CatalogNavigation,
            EntityIds = { fixture.CreateMany<string>() }
        },
        Segments = { fixture.CreateMany<string>() },
        Platform = "mini",
        Version = "5.0.0",
    });

wireMockServer.Stop();

internal static class ProtoHelper
{
    /// <summary>
    /// https://wiremock.org/dotnet/request-matching-protobuf/#multiple-proto-definition-files
    /// </summary>
    public static string GetWireMockProtoDefinition(
        string comment,
        string path) =>
        string.Concat(comment, Environment.NewLine, File.ReadAllText(Path.Combine("protoDefinitions", path)));
}

Other related info

Package Versions:

  • Google.Protobuf 3.34.1
  • Grpc.Net.Client 2.76.0
  • Grpc.Tools 2.80.0
  • WireMock.Net 2.2.0
Logs

Here are logs with errors and full exception stacktraces

16.04.2026 13:50:40 [Info] : By Stef Heyenrath (https://github.com/wiremock/WireMock.Net)
16.04.2026 13:50:40 [Debug] : Server settings {
  "Port": null,
  "UseSSL": false,
  "HostingScheme": null,
  "UseHttp2": null,
  "StartAdminInterface": null,
  "ReadStaticMappings": null,
  "WatchStaticMappings": null,
  "WatchStaticMappingsInSubdirectories": null,
  "ProxyAndRecordSettings": null,
  "Urls": [
    "grpc://localhost:54321"
  ],
  "StartTimeout": 10000,
  "AllowPartialMapping": null,
  "AdminUsername": null,
  "AdminPassword": null,
  "AdminAzureADTenant": null,
  "AdminAzureADAudience": null,
  "RequestLogExpirationDuration": null,
  "MaxRequestLogCount": null,
  "CorsPolicyOptions": null,
  "AllowCSharpCodeMatcher": null,
  "AllowBodyForAllHttpMethods": null,
  "AllowOnlyDefinedHttpStatusCodeInResponse": null,
  "DisableJsonBodyParsing": null,
  "DisableRequestBodyDecompressing": null,
  "DisableDeserializeFormUrlEncoded": null,
  "HandleRequestsSynchronously": null,
  "CertificateSettings": null,
  "CustomCertificateDefined": false,
  "ClientCertificateMode": 0,
  "AcceptAnyClientCertificate": false,
  "WebhookSettings": null,
  "UseRegexExtended": true,
  "SaveUnmatchedRequests": null,
  "DoNotSaveDynamicResponseInLogEntry": null,
  "QueryParameterMultipleValueSupport": null,
  "ProtoDefinitions": null,
  "GraphQLSchemas": null,
  "AdminPath": null,
  "HandlebarsSettings": null,
  "ActivityTracingOptions": null,
  "DefaultJsonSerializer": {},
  "WebSocketSettings": null
}
16.04.2026 13:50:41 [Info] : Server using .NET 8.0
16.04.2026 13:50:43 [Error] : Getting a Request MatchResult for Mapping 'e4601a45-5ba3-4777-9e8f-f69c2465be93' failed. This mapping will not be evaluated. Exception: System.IO.EndOfStreamException: Attempted to read past the end of the stream.
   at ProtoBuf.ProtoReader.State.ThrowEoF() in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 809
   at ProtoBuf.ProtoReader.StreamProtoReader.Ensure(State& state, Int32 count, Boolean strict) in /_/src/protobuf-net.Core/ProtoReader.Stream.cs:line 395
   at ProtoBuf.ProtoReader.StreamProtoReader.ImplSkipBytes(State& state, Int64 count) in /_/src/protobuf-net.Core/ProtoReader.Stream.cs:line 403
   at ProtoBuf.ProtoReader.State.ReadWrapped[T](SerializerFeatures features, T value, ISerializer`1 serializer) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 1092
   at proto_4(State&, GetCustomerSegmentsRequest)
   at ProtoBuf.Internal.Serializers.SimpleCompiledSerializer`1.ProtoBuf.Serializers.ISerializer<T>.Read(State& state, T value) in /_/src/protobuf-net/Internal/Serializers/CompiledSerializer.cs:line 107
   at ProtoBuf.ProtoReader.State.ReadAsRoot[T](T value, ISerializer`1 serializer) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 1157
   at ProtoBuf.ProtoReader.State.DeserializeRoot[T](T value, ISerializer`1 serializer) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 1137
   at ProtoBuf.Internal.DynamicStub.ConcreteStub`1.TryDeserializeRoot(TypeModel model, State& state, Object& value, Boolean autoCreate) in /_/src/protobuf-net.Core/Internal/DynamicStub.cs:line 211
   at ProtoBuf.Meta.TypeModel.DeserializeRootAny(State& state, Type type, Object value, Boolean autoCreate) in /_/src/protobuf-net.Core/Meta/TypeModel.cs:line 1083
   at ProtoBuf.ProtoReader.State.DeserializeRootFallback(Object value, Type type) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 1247
   at ProtoBuf.Serializer.Deserialize(Type type, Stream source) in /_/src/protobuf-net/Serializer.Deserialize.cs:line 55
   at ProtoBufJsonConverter.Utils.SerializeUtils.ConvertProtoBufToObject(Assembly assembly, String inputTypeFullName, Byte[] protoBufBytes, Boolean skipGrpcHeader)
   at ProtoBufJsonConverter.Converter.ConvertAsync(ConvertToObjectRequest request, CancellationToken cancellationToken)
   at WireMock.Matchers.ProtoBufMatcher.DecodeAsync(Byte[] input, Boolean throwException, CancellationToken cancellationToken)
   at WireMock.Matchers.ProtoBufMatcher.IsMatchAsync(Byte[] input, CancellationToken cancellationToken)
16.04.2026 13:50:43 [Error] : Getting a Request MatchResult for Mapping 'ae3f6d3d-fa1c-4c06-bd12-c2958aa1cfc9' failed. This mapping will not be evaluated. Exception: ProtoBuf.ProtoException: Invalid wire-type (String); this usually means you have over-written a file without truncating or setting the length; see https://stackoverflow.com/q/2152978/23354
   at ProtoBuf.ProtoReader.State.ThrowProtoException(String message) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 803
   at ProtoBuf.ProtoReader.State.ThrowWireTypeException() in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 797
   at proto_8(State&, ByLayoutTypeGrpc)
   at ProtoBuf.Internal.Serializers.SimpleCompiledSerializer`1.ProtoBuf.Serializers.ISerializer<T>.Read(State& state, T value) in /_/src/protobuf-net/Internal/Serializers/CompiledSerializer.cs:line 107
   at ProtoBuf.ProtoReader.State.ReadMessage[TSerializer,T](SerializerFeatures features, T value, TSerializer& serializer) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 1022
   at proto_6(State&, GetLayoutsRequestGrpc)
   at ProtoBuf.Internal.Serializers.SimpleCompiledSerializer`1.ProtoBuf.Serializers.ISerializer<T>.Read(State& state, T value) in /_/src/protobuf-net/Internal/Serializers/CompiledSerializer.cs:line 107
   at ProtoBuf.ProtoReader.State.ReadAsRoot[T](T value, ISerializer`1 serializer) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 1157
   at ProtoBuf.ProtoReader.State.DeserializeRoot[T](T value, ISerializer`1 serializer) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 1137
   at ProtoBuf.Internal.DynamicStub.ConcreteStub`1.TryDeserializeRoot(TypeModel model, State& state, Object& value, Boolean autoCreate) in /_/src/protobuf-net.Core/Internal/DynamicStub.cs:line 211
   at ProtoBuf.Meta.TypeModel.DeserializeRootAny(State& state, Type type, Object value, Boolean autoCreate) in /_/src/protobuf-net.Core/Meta/TypeModel.cs:line 1083
   at ProtoBuf.ProtoReader.State.DeserializeRootFallback(Object value, Type type) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 1247
   at ProtoBuf.Serializer.Deserialize(Type type, Stream source) in /_/src/protobuf-net/Serializer.Deserialize.cs:line 55
   at ProtoBufJsonConverter.Utils.SerializeUtils.ConvertProtoBufToObject(Assembly assembly, String inputTypeFullName, Byte[] protoBufBytes, Boolean skipGrpcHeader)
   at ProtoBufJsonConverter.Converter.ConvertAsync(ConvertToObjectRequest request, CancellationToken cancellationToken)
   at WireMock.Matchers.ProtoBufMatcher.DecodeAsync(Byte[] input, Boolean throwException, CancellationToken cancellationToken)
   at WireMock.Matchers.ProtoBufMatcher.IsMatchAsync(Byte[] input, CancellationToken cancellationToken)
16.04.2026 13:50:43 [DebugRequestResponse] : Admin[False] {
  "Guid": "6bf00b2e-f9a7-4e61-b077-cd066b496719",
  "Request": {
    "ClientIP": "::1",
    "DateTime": "2026-04-16T13:50:41.8051632Z",
    "Path": "/catalog.CatalogCategoryService/GetNavigation",
    "AbsolutePath": "/catalog.CatalogCategoryService/GetNavigation",
    "Url": "http://localhost:54321/catalog.CatalogCategoryService/GetNavigation",
    "AbsoluteUrl": "http://localhost:54321/catalog.CatalogCategoryService/GetNavigation",
    "Query": {},
    "Method": "POST",
    "HttpVersion": "2",
    "Headers": {
      "Host": [
        "localhost:54321"
      ],
      "User-Agent": [
        "grpc-dotnet/2.76.0 (.NET 8.0.24; CLR 8.0.24; net8.0; windows; x64)"
      ],
      "Content-Type": [
        "application/grpc"
      ],
      "Grpc-Accept-Encoding": [
        "identity,gzip,deflate"
      ],
      "TE": [
        "trailers"
      ]
    },
    "Cookies": {},
    "BodyAsBytes": "AAAAAA8KBwoFcnVfUlUSBG1pbmk=",
    "DetectedBodyType": "Bytes",
    "DetectedBodyTypeFromContentType": "ProtoBuf"
  },
  "Response": {
    "Headers": {
      "Content-Type": [
        "application/grpc"
      ]
    },
    "DetectedBodyType": "ProtoBuf",
    "DateTime": "0001-01-01T00:00:00"
  },
  "MappingGuid": "4c8d6627-ef29-4a13-b76f-2f49c714e01f",
  "RequestMatchResult": {
    "TotalScore": 4.0,
    "TotalNumber": 4,
    "IsPerfectMatch": true,
    "AverageTotalScore": 1.0,
    "MatchDetails": [
      {
        "MatcherType": "RequestMessageMethodMatcher",
        "Name": "MethodMatcher",
        "Score": 1.0
      },
      {
        "MatcherType": "RequestMessageHttpVersionMatcher",
        "Name": "HttpVersionMatcher",
        "Score": 1.0
      },
      {
        "MatcherType": "MatchResult",
        "Name": "WildcardMatcher",
        "Score": 1.0
      },
      {
        "MatcherType": "RequestMessageProtoBufMatcher",
        "Name": "ProtoBufMatcher",
        "Score": 1.0
      }
    ]
  },
  "PartialMappingGuid": "4c8d6627-ef29-4a13-b76f-2f49c714e01f",
  "PartialRequestMatchResult": {
    "TotalScore": 4.0,
    "TotalNumber": 4,
    "IsPerfectMatch": true,
    "AverageTotalScore": 1.0,
    "MatchDetails": [
      {
        "MatcherType": "RequestMessageMethodMatcher",
        "Name": "MethodMatcher",
        "Score": 1.0
      },
      {
        "MatcherType": "RequestMessageHttpVersionMatcher",
        "Name": "HttpVersionMatcher",
        "Score": 1.0
      },
      {
        "MatcherType": "MatchResult",
        "Name": "WildcardMatcher",
        "Score": 1.0
      },
      {
        "MatcherType": "RequestMessageProtoBufMatcher",
        "Name": "ProtoBufMatcher",
        "Score": 1.0
      }
    ]
  }
}
16.04.2026 13:50:44 [DebugRequestResponse] : Admin[False] {
  "Guid": "f6c77f95-ce36-4826-bfa7-4f7f3b0b3a37",
  "Request": {
    "ClientIP": "::1",
    "DateTime": "2026-04-16T13:50:44.0626248Z",
    "Path": "/customerSegmentation.CustomerSegmentationService/GetCustomerSegments",
    "AbsolutePath": "/customerSegmentation.CustomerSegmentationService/GetCustomerSegments",
    "Url": "http://localhost:54321/customerSegmentation.CustomerSegmentationService/GetCustomerSegments",
    "AbsoluteUrl": "http://localhost:54321/customerSegmentation.CustomerSegmentationService/GetCustomerSegments",
    "Query": {},
    "Method": "POST",
    "HttpVersion": "2",
    "Headers": {
      "Host": [
        "localhost:54321"
      ],
      "User-Agent": [
        "grpc-dotnet/2.76.0 (.NET 8.0.24; CLR 8.0.24; net8.0; windows; x64)"
      ],
      "Content-Type": [
        "application/grpc"
      ],
      "Grpc-Accept-Encoding": [
        "identity,gzip,deflate"
      ],
      "TE": [
        "trailers"
      ]
    },
    "Cookies": {},
    "BodyAsBytes": "AAAAAAgaBgoEbWluaQ==",
    "DetectedBodyType": "Bytes",
    "DetectedBodyTypeFromContentType": "ProtoBuf"
  },
  "Response": {
    "Headers": {
      "Content-Type": [
        "application/grpc"
      ]
    },
    "DetectedBodyType": "ProtoBuf",
    "DateTime": "0001-01-01T00:00:00"
  },
  "MappingGuid": "e4601a45-5ba3-4777-9e8f-f69c2465be93",
  "RequestMatchResult": {
    "TotalScore": 4.0,
    "TotalNumber": 4,
    "IsPerfectMatch": true,
    "AverageTotalScore": 1.0,
    "MatchDetails": [
      {
        "MatcherType": "RequestMessageMethodMatcher",
        "Name": "MethodMatcher",
        "Score": 1.0
      },
      {
        "MatcherType": "RequestMessageHttpVersionMatcher",
        "Name": "HttpVersionMatcher",
        "Score": 1.0
      },
      {
        "MatcherType": "MatchResult",
        "Name": "WildcardMatcher",
        "Score": 1.0
      },
      {
        "MatcherType": "RequestMessageProtoBufMatcher",
        "Name": "ProtoBufMatcher",
        "Score": 1.0
      }
    ]
  },
  "PartialMappingGuid": "e4601a45-5ba3-4777-9e8f-f69c2465be93",
  "PartialRequestMatchResult": {
    "TotalScore": 4.0,
    "TotalNumber": 4,
    "IsPerfectMatch": true,
    "AverageTotalScore": 1.0,
    "MatchDetails": [
      {
        "MatcherType": "RequestMessageMethodMatcher",
        "Name": "MethodMatcher",
        "Score": 1.0
      },
      {
        "MatcherType": "RequestMessageHttpVersionMatcher",
        "Name": "HttpVersionMatcher",
        "Score": 1.0
      },
      {
        "MatcherType": "MatchResult",
        "Name": "WildcardMatcher",
        "Score": 1.0
      },
      {
        "MatcherType": "RequestMessageProtoBufMatcher",
        "Name": "ProtoBufMatcher",
        "Score": 1.0
      }
    ]
  }
}
16.04.2026 13:50:44 [Error] : Getting a Request MatchResult for Mapping '4c8d6627-ef29-4a13-b76f-2f49c714e01f' failed. This mapping will not be evaluated. Exception: ProtoBuf.ProtoException: Invalid wire-type (Variant); this usually means you have over-written a file without truncating or setting the length; see https://stackoverflow.com/q/2152978/23354
   at ProtoBuf.ProtoReader.State.ThrowProtoException(String message) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 803
   at ProtoBuf.ProtoReader.State.ThrowWireTypeException() in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 797
   at ProtoBuf.Internal.PrimaryTypeProvider.ProtoBuf.Serializers.ISerializer<System.String>.Read(State& state, String value) in /_/src/protobuf-net.Core/Internal/PrimaryTypeProvider.Primitives.cs:line 84
   at ProtoBuf.ProtoReader.State.ReadWrapped[T](SerializerFeatures features, T value, ISerializer`1 serializer) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 1089
   at proto_2(State&, GetNavigationRequestGrpc)
   at ProtoBuf.Internal.Serializers.SimpleCompiledSerializer`1.ProtoBuf.Serializers.ISerializer<T>.Read(State& state, T value) in /_/src/protobuf-net/Internal/Serializers/CompiledSerializer.cs:line 107
   at ProtoBuf.ProtoReader.State.ReadAsRoot[T](T value, ISerializer`1 serializer) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 1157
   at ProtoBuf.ProtoReader.State.DeserializeRoot[T](T value, ISerializer`1 serializer) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 1137
   at ProtoBuf.Internal.DynamicStub.ConcreteStub`1.TryDeserializeRoot(TypeModel model, State& state, Object& value, Boolean autoCreate) in /_/src/protobuf-net.Core/Internal/DynamicStub.cs:line 211
   at ProtoBuf.Meta.TypeModel.DeserializeRootAny(State& state, Type type, Object value, Boolean autoCreate) in /_/src/protobuf-net.Core/Meta/TypeModel.cs:line 1083
   at ProtoBuf.ProtoReader.State.DeserializeRootFallback(Object value, Type type) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 1247
   at ProtoBuf.Serializer.Deserialize(Type type, Stream source) in /_/src/protobuf-net/Serializer.Deserialize.cs:line 55
   at ProtoBufJsonConverter.Utils.SerializeUtils.ConvertProtoBufToObject(Assembly assembly, String inputTypeFullName, Byte[] protoBufBytes, Boolean skipGrpcHeader)
   at ProtoBufJsonConverter.Converter.ConvertAsync(ConvertToObjectRequest request, CancellationToken cancellationToken)
   at WireMock.Matchers.ProtoBufMatcher.DecodeAsync(Byte[] input, Boolean throwException, CancellationToken cancellationToken)
   at WireMock.Matchers.ProtoBufMatcher.IsMatchAsync(Byte[] input, CancellationToken cancellationToken)
16.04.2026 13:50:44 [Error] : Getting a Request MatchResult for Mapping 'e4601a45-5ba3-4777-9e8f-f69c2465be93' failed. This mapping will not be evaluated. Exception: ProtoBuf.ProtoException: Invalid wire-type (Variant); this usually means you have over-written a file without truncating or setting the length; see https://stackoverflow.com/q/2152978/23354
   at ProtoBuf.ProtoReader.State.ThrowProtoException(String message) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 803
   at ProtoBuf.ProtoReader.State.ThrowWireTypeException() in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 797
   at ProtoBuf.Internal.PrimaryTypeProvider.ProtoBuf.Serializers.ISerializer<System.String>.Read(State& state, String value) in /_/src/protobuf-net.Core/Internal/PrimaryTypeProvider.Primitives.cs:line 84
   at ProtoBuf.ProtoReader.State.ReadWrapped[T](SerializerFeatures features, T value, ISerializer`1 serializer) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 1089
   at proto_4(State&, GetCustomerSegmentsRequest)
   at ProtoBuf.Internal.Serializers.SimpleCompiledSerializer`1.ProtoBuf.Serializers.ISerializer<T>.Read(State& state, T value) in /_/src/protobuf-net/Internal/Serializers/CompiledSerializer.cs:line 107
   at ProtoBuf.ProtoReader.State.ReadAsRoot[T](T value, ISerializer`1 serializer) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 1157
   at ProtoBuf.ProtoReader.State.DeserializeRoot[T](T value, ISerializer`1 serializer) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 1137
   at ProtoBuf.Internal.DynamicStub.ConcreteStub`1.TryDeserializeRoot(TypeModel model, State& state, Object& value, Boolean autoCreate) in /_/src/protobuf-net.Core/Internal/DynamicStub.cs:line 211
   at ProtoBuf.Meta.TypeModel.DeserializeRootAny(State& state, Type type, Object value, Boolean autoCreate) in /_/src/protobuf-net.Core/Meta/TypeModel.cs:line 1083
   at ProtoBuf.ProtoReader.State.DeserializeRootFallback(Object value, Type type) in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 1247
   at ProtoBuf.Serializer.Deserialize(Type type, Stream source) in /_/src/protobuf-net/Serializer.Deserialize.cs:line 55
   at ProtoBufJsonConverter.Utils.SerializeUtils.ConvertProtoBufToObject(Assembly assembly, String inputTypeFullName, Byte[] protoBufBytes, Boolean skipGrpcHeader)
   at ProtoBufJsonConverter.Converter.ConvertAsync(ConvertToObjectRequest request, CancellationToken cancellationToken)
   at WireMock.Matchers.ProtoBufMatcher.DecodeAsync(Byte[] input, Boolean throwException, CancellationToken cancellationToken)
   at WireMock.Matchers.ProtoBufMatcher.IsMatchAsync(Byte[] input, CancellationToken cancellationToken)
16.04.2026 13:50:44 [DebugRequestResponse] : Admin[False] {
  "Guid": "8f9bce83-33a6-46b9-b02c-26018d65abe1",
  "Request": {
    "ClientIP": "::1",
    "DateTime": "2026-04-16T13:50:44.1098244Z",
    "Path": "/layout.LayoutServiceGrpc/GetLayouts",
    "AbsolutePath": "/layout.LayoutServiceGrpc/GetLayouts",
    "Url": "http://localhost:54321/layout.LayoutServiceGrpc/GetLayouts",
    "AbsoluteUrl": "http://localhost:54321/layout.LayoutServiceGrpc/GetLayouts",
    "Query": {},
    "Method": "POST",
    "HttpVersion": "2",
    "Headers": {
      "Host": [
        "localhost:54321"
      ],
      "User-Agent": [
        "grpc-dotnet/2.76.0 (.NET 8.0.24; CLR 8.0.24; net8.0; windows; x64)"
      ],
      "Content-Type": [
        "application/grpc"
      ],
      "Grpc-Accept-Encoding": [
        "identity,gzip,deflate"
      ],
      "TE": [
        "trailers"
      ]
    },
    "Cookies": {},
    "BodyAsBytes": "AAAAAPsKeggDEiYKJDI2OTI0NDZhLWFiZWYtNDJiNS1iZWQ5LThkZWY2NzhmOWU3ZBImCiQwYWM2NGYyOS1iNGRkLTRiYjMtOWM5Ny1mNzIzN2MyNTNkZjgSJgokODdiNGJiYzAtMWQzYi00NmRiLThiZTQtOTM5NGJhOTEzOTQ1EiQ5YTM4MWI3Yy04ZjcwLTQzMWMtOTlhNC03M2MxMTIxNjRkNjASJGIzYzk0ZTUwLTIwNGYtNGViYi1iNjQ3LTFjMWU4YTUzOWRhMBIkZGYwNTNmOGYtNTVmMi00YWI2LWIxNjgtMzkxOTZhM2UxNmVmGgRtaW5pIgU1LjAuMA==",
    "DetectedBodyType": "Bytes",
    "DetectedBodyTypeFromContentType": "ProtoBuf"
  },
  "Response": {
    "Headers": {
      "Content-Type": [
        "application/grpc"
      ]
    },
    "DetectedBodyType": "ProtoBuf",
    "DateTime": "0001-01-01T00:00:00"
  },
  "MappingGuid": "ae3f6d3d-fa1c-4c06-bd12-c2958aa1cfc9",
  "RequestMatchResult": {
    "TotalScore": 4.0,
    "TotalNumber": 4,
    "IsPerfectMatch": true,
    "AverageTotalScore": 1.0,
    "MatchDetails": [
      {
        "MatcherType": "RequestMessageMethodMatcher",
        "Name": "MethodMatcher",
        "Score": 1.0
      },
      {
        "MatcherType": "RequestMessageHttpVersionMatcher",
        "Name": "HttpVersionMatcher",
        "Score": 1.0
      },
      {
        "MatcherType": "MatchResult",
        "Name": "WildcardMatcher",
        "Score": 1.0
      },
      {
        "MatcherType": "RequestMessageProtoBufMatcher",
        "Name": "ProtoBufMatcher",
        "Score": 1.0
      }
    ]
  },
  "PartialMappingGuid": "ae3f6d3d-fa1c-4c06-bd12-c2958aa1cfc9",
  "PartialRequestMatchResult": {
    "TotalScore": 4.0,
    "TotalNumber": 4,
    "IsPerfectMatch": true,
    "AverageTotalScore": 1.0,
    "MatchDetails": [
      {
        "MatcherType": "RequestMessageMethodMatcher",
        "Name": "MethodMatcher",
        "Score": 1.0
      },
      {
        "MatcherType": "RequestMessageHttpVersionMatcher",
        "Name": "HttpVersionMatcher",
        "Score": 1.0
      },
      {
        "MatcherType": "MatchResult",
        "Name": "WildcardMatcher",
        "Score": 1.0
      },
      {
        "MatcherType": "RequestMessageProtoBufMatcher",
        "Name": "ProtoBufMatcher",
        "Score": 1.0
      }
    ]
  }
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions