Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

System.InvalidOperationException running .net48 #123

Open
jenssc opened this issue May 26, 2021 · 2 comments
Open

System.InvalidOperationException running .net48 #123

jenssc opened this issue May 26, 2021 · 2 comments
Assignees

Comments

@jenssc
Copy link

jenssc commented May 26, 2021

Describe the bug
Running the secure-with-tls sample in .net 48 I constantly get this exception:

System.InvalidOperationException
  HResult=0x80131509
  Message=Status(StatusCode="Unavailable", Detail="failed to connect to all addresses", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1622060341.251000000","description":"Failed to pick subchannel","file":"T:\src\github\grpc\workspace_csharp_ext_windows_x86\src\core\ext\filters\client_channel\client_channel.cc","file_line":4166,"referenced_errors":[{"created":"@1622060341.246000000","description":"failed to connect to all addresses","file":"T:\src\github\grpc\workspace_csharp_ext_windows_x86\src\core\ext\filters\client_channel\lb_policy\pick_first\pick_first.cc","file_line":398,"grpc_status":14}]}")
  Source=EventStore.Client
  StackTrace:
   at EventStore.Client.Interceptors.TypedExceptionInterceptor.<AsyncClientStreamingCall>b__5_0[TRequest,TResponse](Task`1 t) in c:\Temp\EventStore-Client-Dotnet\src\EventStore.Client\Interceptors\TypedExceptionInterceptor.cs:line 54
   at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()

Inner Exception 1:
RpcException: Status(StatusCode="Unavailable", Detail="failed to connect to all addresses", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1622060341.251000000","description":"Failed to pick subchannel","file":"T:\src\github\grpc\workspace_csharp_ext_windows_x86\src\core\ext\filters\client_channel\client_channel.cc","file_line":4166,"referenced_errors":[{"created":"@1622060341.246000000","description":"failed to connect to all addresses","file":"T:\src\github\grpc\workspace_csharp_ext_windows_x86\src\core\ext\filters\client_channel\lb_policy\pick_first\pick_first.cc","file_line":398,"grpc_status":14}]}")

What am I doing wrong?

To Reproduce
Steps to reproduce the behavior:

  1. Connectionstring - esdb://admin:changeit@localhost:2113?Tls=true&TlsVerifyCert=false
  2. Run the project

Config/Logs/Screenshots

I0526 22:25:44.373920 0 T:\src\github\grpc\workspace_csharp_ext_windows_x86\src\core\ext\filters\client_channel\subchannel.cc:1073: Connect failed: {"created":"@1622060744.374000000","description":"OS Error","file":"T:\src\github\grpc\workspace_csharp_ext_windows_x86\src\core\lib\iomgr\tcp_client_windows.cc","file_line":106,"os_error":"No connection could be made because the target machine actively refused it.\r\n","syscall":"ConnectEx","wsa_error":10061}
I0526 22:25:44.375881 0 T:\src\github\grpc\workspace_csharp_ext_windows_x86\src\core\ext\filters\client_channel\client_channel.cc:1083: chand=05896B48: connectivity change for subchannel wrapper 00F54B58 subchannel 00F40248; hopping into work_serializer
I0526 22:25:44.375881 0 T:\src\github\grpc\workspace_csharp_ext_windows_x86\src\core\ext\filters\client_channel\client_channel.cc:1116: chand=05896B48: processing connectivity change in work serializer for subchannel wrapper 00F54B58 subchannel 00F40248 watcher=058A0068
I0526 22:25:44.376881 0 T:\src\github\grpc\workspace_csharp_ext_windows_x86\src/core/ext/filters/client_channel/lb_policy/subchannel_list.h:241: [pick_first 05861CC0] subchannel list 00F4EBF8 index 0 of 2 (subchannel 00F54B58): connectivity changed: state=TRANSIENT_FAILURE, shutting_down=0, pending_watcher=058A0068
I0526 22:25:44.376881 0 T:\src\github\grpc\workspace_csharp_ext_windows_x86\src/core/ext/filters/client_channel/lb_policy/subchannel_list.h:328: [pick_first 05861CC0] subchannel list 00F4EBF8 index 0 of 2 (subchannel 00F54B58): canceling connectivity watch (connection attempt failed)
I0526 22:25:44.376881 0 T:\src\github\grpc\workspace_csharp_ext_windows_x86\src/core/ext/filters/client_channel/lb_policy/subchannel_list.h:308: [pick_first 05861CC0] subchannel list 00F4EBF8 index 1 of 2 (subchannel 00F54848): starting watch (from IDLE)

EventStore details

  • EventStore server version: 21.2.0.0

  • Operating system: Microsoft Windows NT 10.0.18363.0

@jenssc
Copy link
Author

jenssc commented May 26, 2021

Actually only working for net5.0!
Tried to run the code for all targets (net48, net5.0 and netcoreapp3.1) and only net5.0 is working:
secure-with-tls.exe Connecting to EventStoreDB at: esdb://admin:changeit@localhost:2113?Tls=true&TlsVerifyCert=true SUCCESS! Append result: C:12529/P:12529

@rmfaheem
Copy link

this can be worked around on .NET 3.1 by initializing the channel credentials on the client settings

var settings = EventStoreClientSettings.Create("esdb://user:password@domain:port");
settings.ChannelCredentials = new SslCredentials();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants