Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

grpc service gives error "Bad gRPC response. Expected HTTP status code 200. Got status code: 426" when deployed on Azure where works fine locally when run on IIS Express #578

Closed
rupeshtech opened this issue Oct 3, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@rupeshtech
Copy link

rupeshtech commented Oct 3, 2019

I have created a gRPC service..
Using gRPC service by using Client, which has gRPC Service reference.

Created a console app to test the service. When service is running locally (https://localhost:5001) and called from console app, works fine.

When service is deploy on Azure as Appservice, gives error: Bad gRPC response. Expected HTTP status code 200. Got status code: 426 when being called from console app

ErrorMessage: Bad gRPC response. Expected HTTP status code 200. Got status code: 426

What version of gRPC and what language are you using?

Grpc.AspNetCore Version="2.23.1"

What operating system (Linux, Windows,...) and version?

Azure Appservice for windows

netcoreapp3.0
xxxxxxxxxxxxxxxxxxxxxxxxx

.NET Core SDK

.NET core 3.0

What did you do?

Create a sample gRPC .NET Core 3.0 application using visual studio.
create a client to consume the service.
Deploy gRPC service to Azure as Appservice (windows).
Consume the service from a console app.

How gRPC is being called?

Using service via client
var channel = GrpcChannel.ForAddress("https://xxxx.azurewebsites.net"); var client = new RequestorClient(channel); var response = SubmitRequest(client,request)

in above code , it works fine when url is https://localhost:5001

Publish setting

image

What did you expect to see?

Successfull call to service, HTTP status code 200

ErrorMessage

Bad gRPC response. Expected HTTP status code 200. Got status code: 426

Stacktrace

" at Grpc.Net.Client.Internal.GrpcCall2.<GetResponseAsync>d__63.MoveNext()\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()\r\n"

@rupeshtech rupeshtech added the bug Something isn't working label Oct 3, 2019
@rupeshtech
Copy link
Author

rupeshtech commented Oct 3, 2019

saw this comment from other github issue on same topic

Can't host gRPC in IIS/Azure App Service.The HTTP/2 implementation of Http.Sys does not support HTTP response trailing headers which gRPC relies on.

Comment link: dotnet/aspnetcore#9020 (comment)

Issue link : dotnet/aspnetcore#9020

So the conclusion is, Azure Appservice (Linux or windows) doesnt hosting of support gRPC service. (reason can be found in the link of other issue)
And solution is to deploy it on Kubernetes.

Some Open Qs still remain: Will it work on Web Apps for Container? (@shirhatti any answer?)

@shirhatti : do you have anything to add?
Thanks in advance..

@JamesNK
Copy link
Member

JamesNK commented Oct 3, 2019

Hi

Please keep discussion about gRPC + Azure at dotnet/aspnetcore#9020. Repost your questions there.

Multiple issues discussing this will create confusion.

@JamesNK JamesNK closed this as completed Oct 3, 2019
@rupeshtech
Copy link
Author

I have created step by step guide to create test and deploy grpc service using .NET Core 3.0
https://github.com/rupeshtech/k8s-grpc-dotntecore

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants