System.Runtime.InteropServices.COMException (0x80070520) A specified logon session does not exist 0x80070520 - Troubleshoot Steps

Issue Description

Executor start process failed, reason System.Runtime.InteropServices.COMException (0x80070520): A specified logon session does not exist. It may already have been terminated. (Exception from HRESULT: 0x80070520)

Please follow the below 4 guideline and make the changes.

a) Config RDP timeout to create user session
If UiPath_SESSION_TIMEOUT is not defined , define the value and set it to 120.

Steps defined in the above link (In case the link doesn’t work )
Description: The UiPath_SESSION_TIMEOUT environment variable should be defined on Windows system variable and represent the seconds to wait for a user session. If is not defined, default timeout (30 seconds) will be used. After set the UiPath_SESSION_TIMEOUT environment variable, an restart of UiRobot service must be performed.

Steps:

  1. In windows open Run and execute: SystemPropertiesAdvanced
  2. Click on Environment Variables

image

  1. In the System variables section add new variable


image.png650x594 4.92 KB

  1. Restart the UiRobot SVC

b) Verify if the Robot user and the everyone is added to the below policies. In case not please add it. (Screenshot for reference)
-Access this computer from the network
-Allow log on locally
-Allow log on through Remote Desktop Services.
-Log on as a batch job

c) Navigate to system properties and verify if the below options are selected for the system

d) Screen resolution configuration

  • Verify the value of logintoconsole if set to “false” ? This is essential when you are executing process in unattended mode.
  • Also make sure the proper resolution setting has been defined i.e. height, width & depth.

e) The RDP port need to be opened for successfully creating RDP session

Summary
The RDP port should be opened. After enabling the port, the process should start executing without any issue.

RDP port : what-port-should-i-open-to-allow-remote-desktop

How To Change PortNumber :

Note : Every single steps is equally important. After setting up all the configuration , you can leverage the functionality of HD.

1 Like

Hi, I followed the 4 steps described and we are still getting the same “A specified logon session does not exist. It may already have been terminated” Error.

Hi Diego.
For a single robot running on the machine (meaning the Operating System of the robot machine is Windows Desktop - i.e. Windows 7, windows 8, windows 10) you don’t need Login To Console to be set to false. It’s even advised to set it to true.
What is the most important: you should sign out all the users from that machine. No active session should exist. If you do this, you increase the chances for the “UiPath Robot” Windows Service to be able to create a console session.
By the way, I assume you don’t use the community edition of UiPath Studio/Robot, where there is no windows service “UiPath Robot”. Only the service can create the session if started from Orchestrator.
Please find attached screenshots from a PPT guide that explains what to check.
There is no need to add “Everyone” for the right “Access this computer from the network” as long as the group “Users” is still there. All users are members of the group Users.
There is no need for “Logon as a batch job”.


2)

3)

4) The next picture was obtained by running UiRobot.exe --EnableLowLevel, followed by opening the .etl file in SawBuck.
You can see that the Service could not create the session for the user srvsysrobott01 because another user cph075009 was logged in and the robot machine is a Windows Desktop OS, does not support two sessions at the same time.

4 Likes

3 posts were split to a new topic: Excel, Message: Exception from HRESULT: 0x800A03EC