Why I get this and how to avoid submitHeartbeat: System.Net.Http.HttpRequestException: An error occurred while sending the request

Hi, what can I do to avoid those kind of error messages ? any ideas how to check ?

UiPath.Service.Host 21.10.7.0
submitHeartbeat: System.Net.Http.HttpRequestException: An error occurred while sending the request.
—> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host…
—> System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
— End of inner exception stack trace —
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](TIOAdapter adapter, Memory1 buffer) at System.Net.Http.HttpConnection.<CheckUsabilityOnScavenge>g__ReadAheadWithZeroByteReadAsync|44_0() at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at UiPath.Service.Utils.OrchestratorHttpHandler.SendWithTokenRetryAsync(HttpRequestMessage request, CancellationToken ct) at UiPath.Service.Utils.OrchestratorHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken) at UiPath.Service.Orchestrator.Clients.OrchestratorBaseClient.InternalRequestAsync[T](String baseUrl, String serviceUrl, HttpMethod method, HttpContent content, Func2 parseResponse, TokenFactory tokenFactory, TimeSpan timeout, Dictionary2 headers, CancellationToken ct) at UiPath.Service.Orchestrator.Clients.OrchestratorBaseClient.RequestAsync(String baseUrl, String serviceUrl, HttpMethod method, HttpContent content, TokenFactory tokenFactory, TimeSpan timeout, Dictionary2 headers, CancellationToken ct)
at UiPath.Service.Orchestrator.Clients.OrchestratorBaseClient.RequestAsync[T](String baseUrl, String serviceUrl, HttpMethod method, HttpContent content, TokenFactory tokenFactory, TimeSpan timeout, Dictionary`2 headers, CancellationToken ct)
at UiPath.Service.Orchestrator.Clients.OrchestratorClient.SubmitHeartbeatAsync(HeartbeatPayload payload, CancellationToken ct)
at UiPath.Service.Orchestrator.Clients.OrchestratorClient.SubmitHeartbeatAsync(HeartbeatCommandState heartbeatCommand, CancellationToken ct)
at UiPath.Service.Orchestrator.Notifications.HeartbeatGenerator.SubmitHeartbeat(HeartbeatCommandState commandState)
at UiPath.Service.Orchestrator.Notifications.HeartbeatGenerator.SubmitHeartbeatImpl()

Check this documentation https://docs.uipath.com/robot/standalone/2021.10/user-guide/redirecting-robots-through-a-proxy-server

Dear all,

I am facing the same issue.

@Marcin_Bielak
Could you find the solution to the problem yet?

@marian.platonov
Are you able to elaborate a bit why you reference this documentation to the posed issue?

Thanks you!

Based on the provided information in the thread, we can see that you installed the robot 2021.10.7 in Service Mode and you have this error “System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host…”. This issue usually is caused by not redirecting your robot through your local proxy in the UiPath.config file.

Read the documentation and do the needful.

1 Like