question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GPRC server/client test.

See original GitHub issue

Hi

I was following tutorials on microsoft documentation pages, everything worked except making the call itself, the error states :

Grpc.Core.RpcException: 'Status(StatusCode=Cancelled, Detail="Bad gRPC response. Expected HTTP status code 200. Got status code: 426")'

I guess this has something to do with the HTTP2.0 protocol ? I have created a repository with my example code at : https://github.com/christophedemey/gprc

Any help is greatly appreciated. Kind regards Christophe.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JamesNKcommented, Sep 30, 2019

Or do you have a proxy running on your computer?

1reaction
christophedemeycommented, Sep 30, 2019

Hi @JamesNK

The server output

info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
      User profile is available. Using 'C:\Users\christophe.de.mey\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
dbug: Grpc.AspNetCore.Server.Model.Internal.ServiceRouteBuilder[2]
      Discovering gRPC methods for WebApplication45.GreeterService.
dbug: Grpc.AspNetCore.Server.Model.Internal.ServiceRouteBuilder[1]
      Added gRPC method 'SayHello' to service 'Greet.Greeter'. Method type: 'Unary', route pattern: '/Greet.Greeter/SayHello'.
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: C:\Users\christophe.de.mey\Desktop\gprc\WebApplication45\WebApplication45
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 POST https://localhost:5001/Greet.Greeter/SayHello application/grpc
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
      Executing endpoint 'gRPC - /Greet.Greeter/SayHello'
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
      Executed endpoint 'gRPC - /Greet.Greeter/SayHello'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 75.9953ms 426

The client

Unhandled exception. Grpc.Core.RpcException: Status(StatusCode=Cancelled, Detail="Bad gRPC response. Expected HTTP status code 200. Got status code: 426")
   at Grpc.Net.Client.Internal.GrpcCall`2.GetResponseAsync()
   at ConsoleApp1.Program.Main(String[] args) in C:\Users\christophe.de.mey\Desktop\gprc\WebApplication45\ConsoleApp1\Program.cs:line 16
   at ConsoleApp1.Program.<Main>(String[] args)

The code used https://github.com/christophedemey/gprc

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test gRPC services with Postman or gRPCurl in ASP.NET ...
Enter the gRPC server's hostname and port in the server URL. For example, localhost:5000 . Don't include the http or https scheme in...
Read more >
go - Testing a gRPC service
Case #2: I want to manually test the API of my live service over the wire · Start your gRPC server · Use...
Read more >
Testing gRPC APIs with Postman
Testing gRPC APIs ensures that they consistently deliver the necessary functionality, performance, reliability, and security.
Read more >
How to Test gRPC Servers in Go
We will use the bufconn package to start the gRPC server so that tests are interacting with actual network behaviors. ... We will...
Read more >
Quick comparison of gRPC testing tools
What tools are there for gRPC? · Postman · Insomnia · Kreya.app · BloomRPC ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found