Closed rayshow9527 closed 3 months ago
We were unable to reproduce this issue. It's possible that the type definition may differ between the client and server.
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days.
I'm trying to return a model in response but get below exception, can someone help look into this issue?
server side code:
client side code:
Exception message: Grpc.Core.RpcException: Status(StatusCode="Internal", Detail="Error starting gRPC call. MessagePackSerializationException: Failed to deserialize System.Int32 value. MessagePackSerializationException: Unexpected msgpack code 146 (fixarray) encountered.", DebugException="MessagePack.MessagePackSerializationException: Failed to deserialize System.Int32 value. ---> MessagePack.MessagePackSerializationException: Unexpected msgpack code 146 (fixarray) encountered. at MessagePack.MessagePackReader.ThrowInvalidCode(Byte code) at MessagePack.MessagePackReader.ReadInt32() at MessagePack.MessagePackSerializer.Deserialize[T](MessagePackReader& reader, MessagePackSerializerOptions options) --- End of inner exception stack trace --- at MessagePack.MessagePackSerializer.Deserialize[T](MessagePackReader& reader, MessagePackSerializerOptions options) at MessagePack.MessagePackSerializer.Deserialize[T](ReadOnlySequenceg Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.gAwaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
1& byteSequence, MessagePackSerializerOptions options, CancellationToken cancellationToken) at MagicOnion.Serialization.MessagePackMagicOnionSerializerProvider.MessagePackMagicOnionSerializer.MagicOnion.Serialization.IMagicOnionSerializer.Deserialize[T](ReadOnlySequence
1& bytes) at MagicOnion.GrpcMethodHelper.<>cDisplayClass9_01.<CreateBoxedMarshaller>b__1(DeserializationContext ctx) at Grpc.Net.Client.StreamExtensions.ReadMessageAsync[TResponse](Stream responseStream, GrpcCall call, Func
2 deserializer, String grpcEncoding, Boolean singleMessage, CancellationToken cancellationToken) at Grpc.Net.Client.Internal.GrpcCall2.RunCall(HttpRequestMessage request, Nullable
1 timeout)") at MagicOnion.Client.ResponseContextRaw2.FromRawResponseToResponseAsync() at MagicOnion.UnaryResult
1.UnwrapResponse() at BenchmarkWebClientTest.Controllers.BenchmarkController.TestLog() in C:\SourceCode\others\MagicOnionClientTest\BenchmarkWebClientTest\Controllers\BenchmarkController.cs:line 76 at lambda_method5(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.