Connection Closed error mid-run

Hi all,

I am running and debugging projects from a virtual machine, and during runs I am getting a “Connection Closed” error. This doesn’t seem to stop the process in run mode, it just prevents me from stopping the process from Studio. However when I am in debug mode, the process stops, and if I click Step Into/Step Over then it throws a “foreground process is already running” error, as Executor doesn’t stop running when the Connection Closed error appears.
image

I had seen a few posts about this error occurring for different reasons, but none of them seemed to be occurring mid-run. Is there a reason why this error is coming up, and is there anything to prevent this error from occurring?

Full error message:
One or more errors occurred. (Connection closed.) —> System.IO.IOException: Connection closed. at UiPath.CoreIpc.Connection.RemoteCall(Request request, Stream uploadStream, CancellationToken token)
at UiPath.CoreIpc.ServiceClient1.<>c__DisplayClass21_11.<b__1>d.MoveNext()
— End of stack trace from previous location —
at UiPath.CoreIpc.Helpers.Timeout[TResult](TimeSpan timeout, List1 cancellationTokens, Func2 func, String message, Func2 exceptionHandler) at UiPath.CoreIpc.ServiceClient1.<>c__DisplayClass21_11.<Invoke>b__2(Exception ex) at UiPath.CoreIpc.Helpers.Timeout[TResult](TimeSpan timeout, List1 cancellationTokens, Func2 func, String message, Func2 exceptionHandler)
at UiPath.Executor.Debugger.Client.Services.RobotExecutorProxy.StartJobAsync(ExecutionStartOptionsSlim startOptions)
— End of inner exception stack trace —
at UiPath.CoreIpc.Connection.RemoteCall(Request request, Stream uploadStream, CancellationToken token)
at UiPath.CoreIpc.ServiceClient1.<>c__DisplayClass21_11.<b__1>d.MoveNext()
— End of stack trace from previous location —
at UiPath.CoreIpc.Helpers.Timeout[TResult](TimeSpan timeout, List1 cancellationTokens, Func2 func, String message, Func2 exceptionHandler) at UiPath.CoreIpc.ServiceClient1.<>c__DisplayClass21_11.<Invoke>b__2(Exception ex) at UiPath.CoreIpc.Helpers.Timeout[TResult](TimeSpan timeout, List1 cancellationTokens, Func2 func, String message, Func2 exceptionHandler)
at UiPath.Executor.Debugger.Client.Services.RobotExecutorProxy.StartJobAsync(ExecutionStartOptionsSlim startOptions)

@william.coulson

Are you foing any kill process of all processes or UiPath executor…
Looks like the bot is stopping or getting killed or a nee job is starting while the run is going on…

To investigate further is it occuring at any specific place in the process…try identifying it and check what is happening in the process at that point of time

Cheers

Hi @Anil_G,

All applications used by the process (Excel, Edge, Dynamics NAV) are killed at the beginning of the run, however the Connection Closed error seems to occur completely at random, and across multiple processes. There are two VMs which belong to a client and it occurs on both, but only when running from Studio.

@william.coulson

Please check the event viewer logs if you might get some info from there

Cheers

@william.coulson
Ideally, it occurs when one process is running while another process is initiated.

Kindly check all the running processes.

Hi @devasyasingh,

The issue isn’t so much the foreground process error but the Connection Closed error. The foreground issue is just a side issue.

I installed the latest version of UiPath that I could get (2023.4.4) and that seems to have solved it so far. I will leave this topic open for a few days just in case it comes back…

1 Like

I got a Connection Closed error today after updating the UiPath Studio version yesterday. This again occurred at a completely random point in the code during a run execution, but the process continued running beyond this error appearing.

There are 4 event viewer errors that occurred at around the same time that the error occurred, all with the same message: