Job stopped with an unexpected exit code: 0x40010004 - KB

What is the reason for the job faulted with the message "Job-stopped-with-an-unexpected-exit-code-0x40010004" ?

On the theoretical side it could be  due to many reasons, since TerminateProcess has an exit code parameter. Practically it could have happened due to a failure in the target application it self. If UiPath is trying to access any application and the application itself is failing, in that case UiPath won’t be able to interact with the application and the issue might occur.

Apart from this, the same error may be encountered but with different code if the executor or robot.exe was killed or terminated while the job was running.

Scenario #1:: Below are the scenarios in which the issue may occur:
1. User was logged off:
If the job is still running and user was logged off manually, the job will be faulted with same error code.
2. System Shutdown:
If the system experienced a restart or shutdown while the job was running.

Scenario #2:: This error generally occurs when there a drop of the WCF communication channel between executor and service due to exceeded wcf message size.
If the workflow is exchanging messages larger than the noted value (e.g. logs, arguments, assets, excel ) then a workaround is to increase the maxReceivedMessageSize in the UiPath.Service.Host.exe.config file:
Refer to the below link to know more about this:


- Update the highlighted value to i.e. maxRecievedMessageSize attribute to 2147483647
- Restart Robot Service.