KeiStory

728x90
반응형

C# grpc 에러 : "HttpRequestException: Unable to get subchannel from HttpRequestMessage."

 

일부 사용자에게 아래와 같은 에러가 발생되었습니다.

"HttpRequestException: Unable to get subchannel from HttpRequestMessage."

위 에러는 아래와 같이 Client 쪽에 코딩되어있었는데

using var channel = GrpcChannel.ForAddress("http://localhost:5253");

 위 코드를 아래처럼 GrpcChannelOptions 의 HttpHandler 를 지정하면 에러가 해결됩니다.

using var channel = GrpcChannel.ForAddress("http://localhost:5253", new GrpcChannelOptions { HttpHandler = new HttpClientHandler() });

 

위 수정으로 해결이 안된다면 사용자가  proxy  관련 프로그램 Proxyman 등을 사용하고 있는 경우

동일한 오류가 발생됩니다.

이런 경우 설정 > 고급시스템 설정 > 시스템속성 의 고급 탭의 환경변수를 선택하여

사용자 변수에  HTTP_PROXY, HTTPS_PROXY 값이 있는지 확인하고 있다면 삭제해야합니다.

 

참고

https://github.com/grpc/grpc-dotnet/issues/2116

 

Getting error "HttpRequestException: Unable to get subchannel from HttpRequestMessage." after upgrading from .NET Core 3.1 to .N

What version of gRPC and what language are you using? Grpc.Net.Client : 2.51.0 C# What operating system (Linux, Windows,...) and version? Windows What runtime / compiler are you using (e.g. .NET Co...

github.com

728x90
반응형

공유하기

facebook twitter kakaoTalk kakaostory naver band