grpc-dotnet icon indicating copy to clipboard operation
grpc-dotnet copied to clipboard

Message size error in Azure App Service via Web App

Open vivek306 opened this issue 6 years ago • 2 comments

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
            });

vivek306 avatar Mar 03 '20 03:03 vivek306

This is already fixed - https://github.com/grpc/grpc-dotnet/pull/766

Use a nightly build or wait until the next release on NuGet.

JamesNK avatar Mar 03 '20 04:03 JamesNK

Thanks james, it all works with nightly build.

GrpcWebMode.GrpcWebText // Times out and it never reaches the server GrpcWebMode.GrpcWeb // Works perfectly fine

vivek306 avatar Mar 03 '20 05:03 vivek306