How to Resolve RDP Connection Failed with Error Message: 'The connection failed.' Last Error Code: 131078
Unattended jobs fail to start on the Robot machine, and the error presented is 'RDP connection failed: Message: The connection failed., Last error: 131078'.
Error message observed in the Robot logs:
UiPath.Service.Host 23.10.0.0
System.Runtime.InteropServices.COMException (0x80004005): Rdp connection failed: Message: The connection failed., Last error: 131078
at UiPath.Rdp.NativeInterface.RdpLogon(ConnectOptions rdpOptions, String& releaseObjectName)
at UiPath.Rdp.FreeRdpClient.<>c__DisplayClass5_0.b__1()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
at UiPath.Rdp.FreeRdpClient.Connect(RdpConnectionSettings connectionSettings)
at UiPath.Session.Internals.WtsApi.ConnectRdp(RdpConnectionSettings connectionSettings, CancellationToken ct)
at UiPath.Session.Internals.WtsApiExtension.ConnectRdp(SessionOptions sessionOptions, CancellationToken ct)
at UiPath.Session.SessionHandler.ConnectRdp(CancellationToken ct)
at UiPath.Session.SessionMonitoringService.<>c__DisplayClass6_0.<g__Connect|6>d.MoveNext()
--- End of stack trace from previous location ---
at UiPath.Session.SessionMonitoringService.RunMonitored(SessionOptions sessionOptions, CancellationToken startCancellationToken)
at UiPath.Session.Internals.SessionFactory.GetSession(SessionOptions sessionOptions, CancellationToken startCancellationToken)
at UiPath.Session.SessionProcessLauncher.<>c__DisplayClass10_0.<g__WithTimeoutMessage|2>d`1.MoveNext()
--- End of stack trace from previous location ---
at UiPath.Session.SessionProcessLauncher.<>c__DisplayClass10_0.<g__Run|1>d.MoveNext()
--- End of stack trace from previous location ---
at UiPath.Session.SessionProcessLauncher.<>c__DisplayClass10_0.<g__RunGuarded|0>d.MoveNext()
--- End of stack trace from previous location ---
at UiPath.Service.Impl.UnattendedProcessStartHelperCsharp.StartUsingSessionLibraryCsharp(String executable, String arguments, CancellationToken ct)
at UiPath.Service.Impl.UnattendedProcessStartHelperCsharp.Start(String executable, String arguments, CancellationToken ct)
at UiPath.Service.Impl.ExecutorProxy.Start(), HResult -2147467259
Error message observed in Orchestrator:
Cause:
Something on the Robot machine blocks the Robot Service from starting a new session, usually an antivirus, firewall, or a security system.
The issue is occurring because the Robot Service is initiating an RDP connection to the same machine (a loopback session), which necessitates additional configuration on the Robot machine. Further information can be found in the relevant Microsoft documentation linked here .
Solution:
-
Try initiating an RDP session from the Robot machine to itself to confirm that the RDP session cannot be established outside of the UiPath environment.
-
Temporarily disable any antivirus, firewall, or security software (such as Trellix, Bitdefender, Windows Firewall, etc.) and then retry the operation.
-
Configure an exception for the robot service or IP address of the machine in the software that is blocking the Robot service from starting the RDP session.