.NET Core 3 fails accepting Java client calls
See original GitHub issueIssue description
We are transitioning our micro-services from .NET Core 2.1 with the old gRPC dotnet nuget, to .NET Core 3.0 with the inbuilt support for gRPC in Kestrel.
One of our clients is Android app. When tried to connect from the Android client:
Failed... :
io.grpc.StatusRuntimeException: INTERNAL: Protocol error
Rst Stream
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:235)
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:216)
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:141)
at io.grpc.examples.helloworld.GreeterGrpc$GreeterBlockingStub.sayHello(GreeterGrpc.java:228)
at io.grpc.helloworldexample.HelloworldActivity$GrpcTask.doInBackground(HelloworldActivity.java:90)
at io.grpc.helloworldexample.HelloworldActivity$GrpcTask.doInBackground(HelloworldActivity.java:72)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Set up is Development, it’s over HTTP, no TLS has been enabled.
Someone reported the same issue on stackoverflow for Kotlin
I want to point out that we tried the same Stubs with different clients like .NET Core 3.0/ Swift and even BlazorRPC and they worked without an issue.
General version information
gRPC: Java uses : 1.23.0 .NET uses: 2.23.2 Windows 10 Docker for Win 19.03.2
Images used for building the docker final image: mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
How to reproduce:
- Download .NET Greeter example: https://github.com/grpc/grpc-dotnet/tree/master/examples/Greeter
- Download Java Greeter for Android: https://github.com/grpc/grpc-java/tree/master/examples/android/helloworld
- Modify proto Greeter file in .NET example by adding these extra options before the package Name:
syntax = "proto3";
option java_multiple_files = true;
option java_package = "io.grpc.examples.helloworld";
option java_outer_classname = "HelloWorldProto";
option objc_class_prefix = "HLW";
package Greet;
- Make sure Java client Uses the modified proto to generate Stubs.
- Run server in Docker
- Get port of container and connect via Local network using IPv4 Address
- Call server from Client
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:14 (8 by maintainers)
Top Results From Across the Web
Net Core Java RMI Calls
I am looking at upgrading a Java server applications UI. The stack the team has decided is Electron with a .NET Core rest...
Read more >Make HTTP requests using IHttpClientFactory in ASP.NET ...
A typed client accepts an HttpClient parameter in its constructor: ... Further external requests are blocked for 30 seconds if 5 failed ......
Read more >CORS issue when angular and web API(.NET core) is used ...
In case of POST request, the browser was sending OPTIONS request first to authenticate with the server but this request will never reach...
Read more >16 Handling Exceptions Using SOAP Faults
This chapter describes how to handle exceptions that occur when a message is being processed using Simple Object Access Protocol (SOAP) faults for...
Read more >Introducing the .NET 6 runtime for AWS Lambda
Error.WriteLine calls are written as error level. The following example shows using info messages for logging the fetched user object.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Interesting suggestion for a solution? Because I could swear I have done it. Maybe I have missed something ? How do you disable TLS on the server explicitly? Currently Java builds the channel like this:
On the server side I use the appsettings.json
As you can notice there is no “Certificate” path provided. @JamesNK thank you for the assistance.
I’ve managed to recreate this. I suspect the issue is in Kestrel’s implementation of HTTP/2. Something about the HTTP/2 request from the Android client is causing Kestrel to reject it.
Kestrel issue: https://github.com/aspnet/AspNetCore/issues/14745