Orchestrator: API version exception: ServiceUnavailable

We are getting API version error randomly through orchestrator and need to know the reasons. Assuming, verify expression activity is throwing this error randomly.

Errors are:

Exception: Error retrieving API version: HttpOperationException : Operation returned an invalid status code ServiceUnavailable

Can anyone please support here?

can anyone help please?

@pushkar.singh1

Are you getting this in the test cases?

What version of robot and orchestrator you are on?

Did you happen to check the event viewer logs when this error occured?

Cheers

Yes, While executing test cases through orchestrator, we are getting it randomly.
Robot version: 21.10
Orch version: 2021.10.11

RemoteException wrapping System.ApplicationException: Error retrieving API version: HttpOperationException : Operation returned an invalid status code ServiceUnavailable —> RemoteException wrapping Microsoft.Rest.HttpOperationException: Operation returned an invalid status code ServiceUnavailable
at UiPath.Orchestrator.Client.Util.UiPathWebApiExtensions.d__0.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.Client.OrchestratorClientFactory.<>c__DisplayClass8_0.<b__0>d.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.Client.Util.ExceptionsHandler.d__11.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.Client.OrchestratorClientFactory.<SetOrchestratorServerVersion>d__8.MoveNext() --- End of inner exception stack trace --- at UiPath.Orchestrator.Client.OrchestratorClientFactory.<SetOrchestratorServerVersion>d__8.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.Client.OrchestratorClientFactory.<BuildAsync>d__4.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.Testing.Activities.OrchestratorService.<InitializeOrchestratorClientAsync>d__28.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at UiPath.Testing.Activities.OrchestratorService.<ExecuteOrchestratorRequestAsync>d__231.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.Testing.Activities.OrchestratorService.d__22.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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at UiPath.Testing.Activities.AssertionActivity.d__35.MoveNext()
— End of stack trace from previous location where exception was thrown —
at UiPath.Shared.Activities.AsyncTaskNativeImplementation.BookmarkResumptionCallback(NativeActivityContext context, Object value)
at UiPath.Testing.Activities.AsyncTaskNativeWithTelemetryActivity.BookmarkResumptionCallback(NativeActivityContext context, Bookmark bookmark, Object value)
at System.Activities.Runtime.BookmarkCallbackWrapper.Invoke(NativeActivityContext context, Bookmark bookmark, Object value)
at System.Activities.Runtime.BookmarkWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at UiPath.Executor.BaseRunner.EndExecute(IAsyncResult result)
at UiPath.Executor.InProcessRunner.EndExecute(IAsyncResult result)
at UiPath.Core.Activities.ExecutorInvokeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

UiPath.Service.Host 21.10.10.0
[Http Status 503][Orchestrator Error Code Unknown]UiPath.Service.Orchestrator.Clients.OrchestratorHttpException: Service Unavailable
at UiPath.Service.Orchestrator.OrchestratorClientExtensions.EnsureOrchestratorStatusCodeAsync(HttpResponseMessage response)
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 -2146233088

UiPath.Service.Host 21.10.10.0
[Http Status 503][Orchestrator Error Code Unknown]UiPath.Service.Orchestrator.Clients.OrchestratorHttpException: Service Unavailable
at UiPath.Service.Orchestrator.OrchestratorClientExtensions.EnsureOrchestratorStatusCodeAsync(HttpResponseMessage response)
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 -2146233088

@pushkar.singh1

looks like an intermittent connection issue from the message…try using a retry scope around the activity and give a small delay before retry

cheers