Troubleshooting 'Run Program' Activity Errors in UiPath Orchestrator
Symptoms¶
When executing the Run Program activity within System Center Orchestrator, you might encounter a situation where the activity fails, resulting in an error status. The detailed error message, typically found in the Error Summary Text published data, will indicate:
Process creation failed on <computer> - The system cannot find the file specified. (code 2)
This error is particularly perplexing because it can occur even after you have diligently verified that the path to the program being executed is indeed valid and accessible on the designated target computer. Furthermore, this issue persists even when the user account configured for the Orchestrator Runbook Service, or explicitly specified within the Security tab of the Run Program activity, has been confirmed to be a member of the local Administrators group on the target machine. This scenario suggests that the problem lies beyond simple file path errors or user permission issues, pointing towards a deeper system-level configuration concern. The consistency of the error, despite seemingly correct configurations, necessitates a closer examination of the underlying service responsible for executing the program.
Cause¶
The root cause of this error lies in the insufficient privileges of the Orchestrator Run Program service (orunprogram) on the target computer. This service is specifically designed to execute the programs or commands that you configure within the Run Program activity. The issue arises because the service, in its default configuration, might not possess the necessary permissions to create processes in the manner required by the Run Program activity. This limitation is often attributed to the service on the target computer not utilizing the LocalSystem user account for process creation.
The LocalSystem account is a highly privileged built-in Windows account that has extensive access to local system resources. It operates with higher permissions than standard user accounts, even those with administrator privileges. When the Orchestrator Run Program service is not running under the LocalSystem account, it may lack a specific user right that is crucial for the successful execution of the Run Program activity, leading to the “file not found” error despite the file’s presence. This discrepancy in required privileges and actual service configuration is the fundamental reason behind the encountered error.
Resolution¶
To resolve this issue, it is essential to ensure that the service responsible for creating processes on the target computer, which is the Orchestrator Run Program service (orunprogram), is configured correctly. By default, this service is designed to utilize the LocalSystem account as its logon credentials. LocalSystem possesses a unique and critical user right, Act as part of the operating system, which is not automatically granted to members of the local Administrators group.
This specific user right, Act as part of the operating system, is crucial because it empowers the user account to create processes using the security credentials of another user. This capability is a fundamental requirement for the Run Program activity to function correctly and execute programs under the desired context. Therefore, ensuring the Orchestrator Run Program service operates under the LocalSystem account is paramount for resolving the “Process creation failed” error. There are two primary resolution options available to achieve this, each addressing the service configuration in a slightly different manner.
Resolution 1: Automatic Service Reinstallation¶
This resolution method leverages the automatic service management capabilities of System Center Orchestrator. It involves stopping and then deleting the existing Orchestrator Run Program service (orunprogram) from the target computer. By removing the service, you allow System Center Orchestrator to automatically reinstall it the next time the Run Program activity is executed. This reinstallation process ensures that the service is set up with the default configuration, which includes using the LocalSystem user account.
To implement this resolution, you will need to execute the following commands using an elevated Command Prompt on the computer designated as the target of the Run Program activity. An elevated Command Prompt is necessary to have the required administrative privileges to stop and delete Windows services.
sc stop orunprogram
sc delete orunprogram
The first command, sc stop orunprogram, instructs the Service Control Manager to stop the Orchestrator Run Program service. If the service is running, it will be gracefully stopped. The second command, sc delete orunprogram, removes the service registration from the system. After executing these commands, the next time the Run Program activity is triggered targeting this computer, Orchestrator will detect the absence of the service and automatically reinstall it, configured to run under the LocalSystem account. This approach is straightforward and relies on the built-in service management features of Orchestrator.
Resolution 2: Manual Service Account Configuration¶
This resolution provides a more direct approach by manually configuring the Orchestrator Run Program service (orunprogram) to use the LocalSystem account. This method involves stopping the service, modifying its logon account to LocalSystem, and then restarting the service. This ensures that the service operates under the correct account without requiring a full service reinstallation.
Similar to Resolution 1, you will need to use an elevated Command Prompt on the target computer to execute the necessary commands. These commands will interact with the Service Control Manager to modify the service configuration.
sc config orunprogram obj= LocalSystem password= ""
sc stop orunprogram
sc start orunprogram
The command sc config orunprogram obj= LocalSystem password= "" is the core of this resolution. It utilizes the sc config command to modify the configuration of the orunprogram service. The obj= LocalSystem parameter specifically sets the service’s logon account to the LocalSystem account. The password= "" parameter is required but left empty because the LocalSystem account does not have a password.
Following the configuration change, sc stop orunprogram stops the service to ensure the new configuration is applied. Finally, sc start orunprogram restarts the service, now running under the LocalSystem account. This manual configuration method directly addresses the service account setting and ensures the service has the required privileges to execute the Run Program activity successfully. It is a more targeted approach compared to service reinstallation and can be preferable when you want more control over the configuration process.
By implementing either Resolution 1 or Resolution 2, you should effectively resolve the “Process creation failed” error when using the Run Program activity in UiPath Orchestrator. Both methods ensure that the Orchestrator Run Program service operates with the necessary LocalSystem privileges, allowing it to create processes correctly and execute programs as intended.
Feel free to share your experiences or ask any further questions in the comments below!
Post a Comment