How To Troubleshoot the error Robot.ExecutorFailedStart - Could not start executor. Object reference not set to an instance of an object.? It appears when we want to run an unattended job.
Issue Description:
Unattended execution on a robot machine fails with the following error:
System.Exception: Could not start executor. Object reference not set to an instance of an object.
---> System.NullReferenceException: Object reference not set to an instance of an object.
at UiPath.Session.LegalNotice.TrySetIfDifferent(String keyName, String valueName, Object newValue)
at UiPath.Session.LegalNotice.SetLegalNotice(String legalNoticeRootKeyName, Object caption, Object text)
at UiPath.Session.LegalNotice.CaptureAndDisableLegalNotice(String legalNoticeRootKeyName)
at UiPath.Session.LegalNotice.DoCaptureAndDisable()
at UiPath.Session.LegalNotice.CaptureAndDisableLegalNotice()
at UiPath.Session.SessionHandler.ThrowIfLegalNoticeEnabledWhileConnecting(Func`2 connectFunc, CancellationToken ct)
at UiPath.Session.SessionHandler.ConnectRdp(CancellationToken ct)
at UiPath.Session.SessionMonitoringService.<>c__DisplayClass7_0.<<RunMonitored>g__Connect|8>d.MoveNext()
Stack Trace Explanation:
The stack trace shows the call chain that led to the failure. ExecutorProxy.Start() triggers UnattendedProcessStartHelper to launch the unattended process, which calls StartProcessInMonitoredSession to request a session via SessionFactory.GetSession. RunMonitored then attempts the connection with retry logic via ConnectWithRetry, which calls ConnectRdp to establish the RDP session.
During RDP session establishment, ThrowIfLegalNoticeEnabledWhileConnecting is invoked, which calls CaptureAndDisableLegalNotice to check and temporarily disable any Windows Legal Notice configured on the machine. This internally reaches TrySetIfDifferent — the point of failure. The NullReferenceException thrown here propagates back up the entire call chain, causing StartProcessInMonitoredSession to fail and the executor to close with exit code ErroredFromService, ultimately marking the job as Failed.
Root Cause:
When UiPath initiates an unattended RDP session, LegalNotice.CaptureAndDisableLegalNotice is called to read the Windows interactive logon legal notice registry values (legalnoticecaption and legalnoticetext) under:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
If the Policies\System registry key is missing, unattended session initialization fails with a NullReferenceException, preventing the UiPath Executor from starting.
Troubleshooting Steps:
Notice: Administrator rights may be required for this!
Run the following command in PowerShell on both the working and non-working machine to check if the registry key exists and compare the output:
powershell:
reg export "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" "%USERPROFILE%\Desktop\Policies_System_%COMPUTERNAME%.reg" /y
If the command runs successfully, a .reg file will be exported to the Desktop — compare the contents of both files to identify any differences.
If the command fails because the key is missing, the following error would come up:
ERROR: The system was unable to find the specified registry key or value.
This confirms that the Policies\System registry key is missing entirely on the machine. Proceed with the resolution steps below to apply an immediate fix, and engage the IT team in parallel to investigate why the registry key is absent and ensure Group Policy is applying consistently across all machines in the environment.
Resolution:
Note: The steps below require administrative privileges and involve modifying the Windows registry. Coordinate with the IT team to apply the changes.
If all Robot machines are under the same Organization Unit and GPO, the Policies registry key should be identical across machines, making it safe to import the .reg file from a working machine to the affected machine. If any uncertainty exists, verify with the IT team before proceeding.
- On the working machine, open Registry Editor (regedit) and navigate to:Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies
- Right-click on the Policies key and select Export to save a copy of the registry — this exported .reg file will be used to fix the non-working machine.
- Copy the exported .reg file to the non-working machine.
- Before applying any changes on the non-working machine, open Registry Editor and navigate to the same path:Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies
- Right-click on the Policies key and select Export to take a backup of the current registry state on the non-working machine.
- Double-click the .reg file exported from the working machine and click Yes when prompted — this will create the System key and write all the required registry values onto the non-working machine.
- Once complete, reopen Registry Editor and navigate to Policies\System to verify the values legalnoticecaption and legalnoticetext are now present.
- Re-run the UiPath job from Orchestrator and confirm whether the issue is resolved.
If the issue persists after completing the above steps, raise a UiPath Support ticket and include the following:
- Exported .reg files from the working and affected machines
- Diagnostic tool logs from the non-working machine
For steps on how to collect the UiPath Diagnostic tool logs, refer to the following KB article:
