GRPC Exception - unable to connect to socket
- Dominant language
- C#
- Stars
- 1.2k
- Forks
- 378
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 6
Description
Hi all,
Firstly thank you for a fabulous project and all your hard work.
I am really struggling with the GRPC example and indeed any GRPC over c# using Dapr.
I have added dapr/d to the security whitelist and am sure that this is not Windows firewall related. I hope!
Dapr.Client.InvocationException
HResult=0x80131500
Message=An exception occurred while invoking method: 'deposit' on app-id: 'grpcsample'
Source=Dapr.Client
StackTrace:
at Dapr.Client.DaprClientGrpc.d__31`2.MoveNext() in C:\Users\fig\Downloads\dotnet-sdk-master\src\Dapr.Client\DaprClientGrpc.cs:line 513
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Samples.Client.InvokeServiceGrpcExample.d__2.MoveNext() in C:\Users\fig\Downloads\dotnet-sdk-master\examples\Client\ServiceInvocation\InvokeServiceGrpcExample.cs:line 25
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Samples.Client.Program.d__1.MoveNext() in C:\Users\fig\Downloads\dotnet-sdk-master\examples\Client\ServiceInvocation\Program.cs:line 28
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Samples.Client.Program.(String[] args)
Inner Exception 1:
RpcException: Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: No connection could be made because the target machine actively refused it. SocketException: No connection could be made because the target machine actively refused it.", DebugException="System.Net.Http.HttpRequestException: No connection could be made because the target machine actively refused it.
---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.GetHttp2ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at Grpc.Net.Client.Internal.GrpcCall`2.RunCall(HttpRequestMessage request, Nullable`1 timeout)")
I would really appreciate any thoughts or suggestions please.
Many thanks
Fig
Contributor guide
Research direction
Run the GRPC example and start at examples/Client/ServiceInvocation/InvokeServiceGrpcExample.cs line 25, then trace the call into src/Dapr.Client/DaprClientGrpc.cs line 513. Check the connection details involved in the refused socket and use the stack trace to identify why the grpcsample invocation cannot connect. Done means the example connects successfully or the missing prerequisite and failure are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, grpc
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100