grpc-dotnet
grpc-dotnet copied to clipboard
Message size error in Azure App Service via Web App
Error: Status(StatusCode=Internal, Detail="Error starting gRPC call: An error occurred while sending the request.")
Proto Model
message DataToConvertRequest {
string data64 = 1;
}
I seem to get the above error when I set the data64 string to over ~4000 bytes on the server but it works perfectly fine offline.
Here is my client channel options
var handler = new GrpcWebHandler(GrpcWebMode.GrpcWebText, HttpVersion.Version11, new HttpClientHandler());
grpcChannel = GrpcChannel.ForAddress(MeVitaeClientDataServicesLibrary.Helpers.StaticFields.DATACONVERTERSERVICES_API,
new GrpcChannelOptions
{
MaxReceiveMessageSize = 3 * 1024 * 1024, // 3 MB
MaxSendMessageSize = 3 * 1024 * 1024, // 3 MB
HttpClient = new HttpClient(handler)
});
and Server channel options
services.AddGrpc(options =>
{
options.ResponseCompressionLevel = CompressionLevel.Optimal;
options.ResponseCompressionAlgorithm = "gzip";
options.MaxReceiveMessageSize = 3 * 1024 * 1024; // 3 MB
options.MaxSendMessageSize = 3 * 1024 * 1024; // 3 MB
});
This is already fixed - https://github.com/grpc/grpc-dotnet/pull/766
Use a nightly build or wait until the next release on NuGet.
Thanks james, it all works with nightly build.
GrpcWebMode.GrpcWebText // Times out and it never reaches the server GrpcWebMode.GrpcWeb // Works perfectly fine