EventStore / EventStore-Client-Dotnet

Dotnet Client SDK for the Event Store gRPC Client API written in C#
Other
138 stars 38 forks source link

EventStoreClientSettings.Create is not correctly populating the created settings #266

Closed GrantJMiles closed 10 months ago

GrantJMiles commented 10 months ago

Describe the bug When following the simple guide on the event store docs to create a client I am getting persistent errors when trying to AppendToStreamAsync with the error below:

"Status(StatusCode=\"Internal\", Detail=\"Error starting gRPC call. HttpRequestException: Requesting HTTP version 2.0 with version policy RequestVersionOrHigher while unable to establish HTTP/2 connection.\", DebugException=\"System.Net.Http.HttpRequestException: Requesting HTTP version 2.0 with version policy RequestVersionOrHigher while unable to establish HTTP/2 connection.\n   at System.Net.Http.HttpConnectionPool.ThrowGetVersionException(HttpRequestMessage request, Int32 desiredVersion, Exception inner)\n   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)\n   at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)\n   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)\n   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)\n   at Grpc.Net.Client.Internal.GrpcCall`2.RunCall(HttpRequestMessage request, Nullable`1 timeout)\")"

On inspection of the settings that get created it would seem that the connection string is not being parsed correctly

image

To Reproduce Steps to reproduce the behaviour:

  1. Create EventStoreClientSettings passing in a valid connection string
  2. Pause debugger and inspect the created object

Expected behaviour I would expect to be able to see the host that I am actually targeting, not the default localhost settings

Actual behavior An object that is remarkable similar to what is created when calling EventStoreClientSettings.Default

EventStore details

volumes: eventstore-volume-data: eventstore-volume-logs:



**Additional context**
Client is created in a webapi project using .NET 8 rc1
I have tried using IP address and exposed port with same results
timothycoleman commented 10 months ago

Hi @GrantJMiles, when using esdb+discovery it looks like the endpoints appear in ConnectivitySetttings.DnsGossipSeeds rather than Address, so hopefully it is connecting to the correct endpoint.

That doesn't help you with your error though. are you using windows 7 by any chance?

GrantJMiles commented 10 months ago

I can see the values are being set in DnsGissipSettings. I am developing on an Ubuntu 22.04 machine using the net 7 remote container (with 8 rc1 manually installed).

Do I need to do something to the configuration of ES to enable HTTP/2

GrantJMiles commented 10 months ago

Proxy issue!

timothycoleman commented 10 months ago

:+1: