Getting started with .net core

I tried for quite some time to get EventStoreDb running, but always run into issues. I have found the getting started in the repo and it has a docker compose file which loads EventStoreDb nicely. But it has no connection string. If I use the connection string from the reading events example I always get the following error (.net 5, mac):

Unhandled exception. System.InvalidOperationException: Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: The SSL connection could not be established, see inner exception. IOException: Cannot determine the frame size or a corrupted frame was received.", DebugException="System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
     ---> System.IO.IOException: Cannot determine the frame size or a corrupted frame was received.
       at System.Net.Security.SslStream.ReceiveBlobAsync[TIOAdapter](TIOAdapter adapter)
       at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)
       at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
       --- End of inner exception stack trace ---
       at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.GetHttp2ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
       at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
       at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken)
       at Grpc.Net.Client.Internal.GrpcCall`2.GetResponseHeadersCoreAsync()")
     ---> Grpc.Core.RpcException: Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: The SSL connection could not be established, see inner exception. IOException: Cannot determine the frame size or a corrupted frame was received.", DebugException="System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
     ---> System.IO.IOException: Cannot determine the frame size or a corrupted frame was received.
       at System.Net.Security.SslStream.ReceiveBlobAsync[TIOAdapter](TIOAdapter adapter)
       at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)
       at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
       --- End of inner exception stack trace ---
       at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.GetHttp2ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
       at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
       at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken)
       at Grpc.Net.Client.Internal.GrpcCall`2.GetResponseHeadersCoreAsync()")
       --- End of inner exception stack trace ---
       at EventStore.Client.Interceptors.TypedExceptionInterceptor.<AsyncClientStreamingCall>b__5_0[TRequest,TResponse](Task`1 t) in /Users/andi/repos/EventStore-Client-Dotnet/src/EventStore.Client/Interceptors/TypedExceptionInterceptor.cs:line 54
       at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
       at System.Threading.Tasks.Task.<>c.<.cctor>b__277_0(Object obj)
       at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
    --- End of stack trace from previous location ---
       at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
    --- End of stack trace from previous location ---
       at EventStore.Client.EventStoreClient.AppendToStreamInternal(AppendReq header, IEnumerable`1 eventData, EventStoreClientOperationOptions operationOptions, UserCredentials userCredentials, CancellationToken cancellationToken) in /Users/andi/repos/EventStore-Client-Dotnet/src/EventStore.Client.Streams/EventStoreClient.Append.cs:line 125
       at reading_events.Program.Main(String[] args) in /Users/andi/repos/EventStore-Client-Dotnet/samples/reading-events/Program.cs:line 22
       at reading_events.Program.<Main>(String[] args)

Did you ever get this resolved? Running into the same issues.

Yeah, but I cannot tell you anymore exactly what it was. You may look here: https://github.com/AndiRudi/EventSourcedBookingSample

Thank you, will have a look. I think I have found my issue, which might be unrelated.

Someone accidently upgraded our client side packages to the latest release but our servers are running version 20.10.0. Seems to be a version conflict that caused it.

I think in other cases it might be related to the server and the client not being able to decide on a specific TLS protocol.

I have seen the on Elasticsearch as well.

Also note I was testing the from a Windows 11 machine, which has TLS 1.3 by default enabled, for anyone in the future, this might be something to look into as a start.

@andreas, my guess is that’s something around getting the configuration around secure/insecure stuff. It has to be aligned both for clients and servers. If you could provide more details on the failing scenario, then we could suggest some improvements.

For samples, better would be to have a look here: https://github.com/EventStore/samples

For the secure connection, check here: https://github.com/EventStore/EventStore-Client-Dotnet/tree/master/samples/secure-with-tls