Bot is not able to connect to ‘Orchestrator’ and getting ‘Operation Timed Out’ or ‘UiPath Service Failure’ exception while performing Orchestrator specific activities like ‘Get Transaction Item’, ‘Set Transaction Item’, ‘Get Credential’ etc

The server connection was terminated with an error.

Exception:
System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake.
at System.Net.WebSockets.ManagedWebSocket.ThrowIfEOFUnexpected(Boolean throwOnPrematureClosure)
at System.Net.WebSockets.ManagedWebSocket.EnsureBufferContainsAsync(Int32 minimumRequiredBytes, CancellationToken cancellationToken, Boolean throwOnPrematureClosure)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TResult](Memory1 payloadBuffer, CancellationToken cancellationToken) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport.StartReceiving(WebSocket socket)
at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
at System.IO.Pipelines.Pipe.GetReadAsyncResult()
at Microsoft.AspNetCore.SignalR.Client.HubConnection.ReceiveLoop(ConnectionState connectionState)

Category: Microsoft.AspNetCore.SignalR.Client.HubConnection
EventId: 69

HubConnection reconnecting due to an error.

Exception:
System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake.
at System.Net.WebSockets.ManagedWebSocket.ThrowIfEOFUnexpected(Boolean throwOnPrematureClosure)
at System.Net.WebSockets.ManagedWebSocket.EnsureBufferContainsAsync(Int32 minimumRequiredBytes, CancellationToken cancellationToken, Boolean throwOnPrematureClosure)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TResult](Memory1 payloadBuffer, CancellationToken cancellationToken) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport.StartReceiving(WebSocket socket)
at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
at System.IO.Pipelines.Pipe.GetReadAsyncResult()
at Microsoft.AspNetCore.SignalR.Client.HubConnection.ReceiveLoop(ConnectionState connectionState)

Category: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection
EventId: 11

Failed to start connection. Error starting transport ‘WebSockets’.

Exception:
System.Net.WebSockets.WebSocketException (0x80004005): The server returned status code ‘503’ when status code ‘101’ was expected.
at System.Net.WebSockets.WebSocketHandle.ConnectAsync(Uri uri, CancellationToken cancellationToken, ClientWebSocketOptions options)
at System.Net.WebSockets.ClientWebSocket.ConnectAsyncCore(Uri uri, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport.DefaultWebSocketFactory(WebSocketConnectionContext context, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport.StartAsync(Uri url, TransferFormat transferFormat, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.StartTransport(Uri connectUrl, HttpTransportType transportType, TransferFormat transferFormat, CancellationToken cancellationToken)

UiPath.Service.Host 22.4.3.0
System.TimeoutException: The operation has timed out.
at UiPath.Service.Utils.OrchestratorHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.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.OrchestratorClient.SubmitLogsAsync(IEnumerable1 messages, Guid robotKey, CancellationToken ct)
at UiPath.Service.Orchestrator.OrchestratorController.LogHandler(MessageBatchArguments`1 args, IOrchestratorClient client), HResult -2146233083

UiPath.Executor 22.4.3.0
System.Threading.Tasks.TaskCanceledException: A task was canceled.
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.Http.HttpClient.d__58.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.Orchestrator.Api.OrchestratorVersion.d__8.MoveNext()

UiPath.Service.Host 22.4.3.0
submitHeartbeat: System.TimeoutException: The operation has timed out.
at UiPath.Service.Utils.OrchestratorHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.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, Dictionary2 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.SubmitHeartbeatImpl()
at UiPath.Service.Orchestrator.Notifications.HeartbeatGenerator.<>c__DisplayClass28_0.<g__submitHeartbeat|1>d.MoveNext(), HResult -2146233083

UiPath.Service.Host 22.4.3.0
System.TimeoutException: The operation has timed out.
at UiPath.Service.Utils.OrchestratorHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.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.OrchestratorClient.SubmitLogsAsync(IEnumerable1 messages, Guid robotKey, CancellationToken ct)
at UiPath.Service.Orchestrator.OrchestratorController.LogHandler(MessageBatchArguments`1 args, IOrchestratorClient client), HResult -2146233083

This error occurs multiple times. Could you please suggest a solution for this issue?

Hello @subinoodathil

Is it happening always or sometimes? Also during the execution is the network stable?

As you have confirmed the Robot has properly connected to the Orchestrator it should work fine, unless there is a disruption in the network during the execution.

Thanks

Hello Rahul,

It is happening only at sometimes. How to troubleshoot it further?

Can anyone please provide a solution for this issue?