Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Weird error calling my grpc server "Stream removed" #138

Closed
neiesc opened this issue Oct 30, 2019 · 6 comments
Closed

Weird error calling my grpc server "Stream removed" #138

neiesc opened this issue Oct 30, 2019 · 6 comments

Comments

@neiesc
Copy link

neiesc commented Oct 30, 2019

I created new server grpc:
dotnet new grpc -o GrpcGreeterServer

ather dotnet run
image

after invoke BloomRPC

image

And i received:

{
  "error": "2 UNKNOWN: Stream removed"
}

dotnet --info

.NET Core SDK (reflecting any global.json):
 Version:   3.0.100     
 Commit:    04339c3a26  

Runtime Environment:    
 OS Name:     Windows   
 OS Version:  10.0.18362
 OS Platform: Windows    RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.0.100\
Host (useful for support):  Version: 3.0.0
  Commit:  7d57652f33
.NET Core SDKs installed:  2.1.202 [C:\Program Files\dotnet\sdk]
  2.1.509 [C:\Program Files\dotnet\sdk]  2.1.802 [C:\Program Files\dotnet\sdk]
  2.2.402 [C:\Program Files\dotnet\sdk]  3.0.100 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]         Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]        
  Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]         Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]        
  Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]        
  Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]  Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download
@sumpubu
Copy link

sumpubu commented Nov 16, 2019

I found a workaround at stack overflow. Basically, don't use https.
https://stackoverflow.com/questions/57277496/how-to-call-a-net-core-3-0-grpc-server-application-with-bloomrpc

Update your launchSettings.json file and change the applicationUrl property.

{
    "profiles": {
        "GrpcGreeter": {
            "commandName": "Project",
            "launchBrowser": false,
            "applicationUrl": "https://localhost:5001;http://localhost:5000",
            "environmentVariables": {
                "ASPNETCORE_ENVIRONMENT": "Development"
            }
        }
    }
}

Then use port 5000 with BloomRPC

@neiesc
Copy link
Author

neiesc commented Nov 18, 2019

Thanks @sumpubu !!

@fenos fenos closed this as completed Jan 21, 2020
@JarrodJ83
Copy link

JarrodJ83 commented Apr 24, 2020

To get the workaround mentioned above to work in my application I had to restrict the protocols on the endpoint to Http2 only:

webBuilder.UseKestrel(options =>
{
     options.ConfigureEndpointDefaults(lo => lo.Protocols = HttpProtocols.Http2);
});

I'm still in proof of concept with my project so I don't know what other ramifications this may have (like if I host a standard webapi in the same project?). Having to do this just to get BloomRPC to work seems less than desirable. I am able to call the endpoint just fine from other clients without making the configuration change above. See below code example:

var httpClientHandler = new HttpClientHandler();
var httpClient = new HttpClient(httpClientHandler);

Log.Logger = new LoggerConfiguration().WriteTo.Console().MinimumLevel.Verbose().CreateLogger();

var channel = GrpcChannel.ForAddress("http://localhost:7000",
	new GrpcChannelOptions { 
	HttpClient = httpClient 
	,LoggerFactory= new Serilog.Extensions.Logging.SerilogLoggerFactory(Log.Logger)
	});

var client = new test.Greeter.GreeterClient(channel);
client.SayHello(new HelloRequest { Name= "Test" }); 

Any idea why I have to make this adjustment to use BloomRPC but not use HttpClient?

@uditsing
Copy link

It's perfect working with 0.0.0.0:5000.
But you have idea why it is not working with 0.0.0.0:5001.
0.0.0.0:5000 is working with HTTP &
0.0.0.0:5001 is working with HTTPS.

@JarrodJ83
Copy link

I'm not sure if @uditsing's reply was to the original post or mine (seems to be toward the original).

My question above still stands. I'm trying to find out why the setting I mention seems to be necessary to work with BloomRPC when it is not needed using the code I posted above. Anyone have any insight here? Should I open a separate issue for this?

@JohnGalt1717
Copy link

@JarrodJ83 The side effect is that gRPC-Web won't work that way. The only way I've been able to get bloomrpc to work on windows is by manually importing the kestrel development certificate into it because it apparently won't use the system certificate store to get it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants