Skip to content

bug: Grpc requests go via proxy on Grpc.NET.Client >= 2.44 #218

@zinal

Description

@zinal

Bug Report

YDB dotnet SDK version: 0.8.0

Environment

Linux

Current behavior:

If:

  • using Grpc.NET.Client >= 2.44
  • proxy settings are defined for internet access
  • with the current version of YDB SDK for .Net
Grpc.Core.RpcException
HResult=0x80131500
Message=Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: Unable to get subchannel from HttpRequestMessage. ([proxyserver.net:8080](http://proxyserver.net:8080/)) InvalidOperationException: Unable to get subchannel from HttpRequestMessage.", DebugException="System.Net.Http.HttpRequestException: Unable to get subchannel from HttpRequestMessage. ([proxyserver.net:8080](http://proxyserver.net:8080/))")
Source=Grpc.Net.Client
StackTrace:
at Grpc.Net.Client.Internal.GrpcCall`2.d72.MoveNext()
at Ydb.Sdk.Driver.d13.MoveNext()
at Ydb.Sdk.Driver.d10.MoveNext()
at Program.<

$>d0.MoveNext() in ...Program.cs:line 13
at Program.
(String[] args)
This exception was originally thrown at this call stack:
Grpc.Net.Client.Balancer.Internal.BalancerHttpHandler.OnConnect(System.Net.Http.SocketsHttpConnectionContext, System.Threading.CancellationToken)
System.Threading.Tasks.ValueTask.Result.get() in ValueTask.cs
System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(string, int, System.Net.Http.HttpRequestMessage, bool, System.Threading.CancellationToken) in HttpConnectionPool.cs

Inner Exception 1:
HttpRequestException: Unable to get subchannel from HttpRequestMessage. ([proxyserver.net:8080](http://proxyserver.net:8080/))

Inner Exception 2:
InvalidOperationException: Unable to get subchannel from HttpRequestMessage.

Expected behavior:

Program works, instead of failing

Steps to reproduce:

Run the console application with the current YDB SDK and Grpc.NET.Client >= 2.44, as specified below.

Related code:

using Ydb.Sdk;
using Ydb.Sdk.Auth;

var config = new DriverConfig(endpoint: "grpcs://ydb.serverless.yandexcloud.net:2135",
database: "/ru-central1/aaa/bbb",
credentials: new TokenProvider("…."));

using var driver = new Driver(config: config);

await driver.Initialize();

Other information:

grpc/grpc-dotnet#2254

grpc/grpc-dotnet#2312 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions