Error on a windows job in interactive mode : CAWA_E_20020
search cancel

Error on a windows job in interactive mode : CAWA_E_20020

book

Article ID: 140069

calendar_today

Updated On: 04-25-2025

Products

CA Workload Automation AE - Business Agents (AutoSys) CA Workload Automation AE - System Agent (AutoSys) CA Workload Automation AE - Scheduler (AutoSys) Workload Automation Agent Autosys Workload Automation

Issue/Introduction

Why do we have this error msg below while we indicated the paremeter "interactive: 1" in the job:

Error msg : " CAWA_E_20020 Logon failed for DOMAIN1\USER1 due to: Unable to locate interactive logon session.Error code: 20013" 


Definition of the job : 

 insert_job: Job1
 command: execute.cmd
 machine: win2k16
 owner: user1@domain1
 std_out_file: "%AUTOUSER%\out\%AUTO_JOB_NAME%-%AUTORUN%"
 std_err_file: "%AUTOUSER%\out\%AUTO_JOB_NAME%-%AUTORUN%"
 alarm_if_fail: 1
 alarm_if_terminated: 1
 interactive: 1

 

Environment

Product(s): Workload Automation System Agent
OS: Windows OS

 

Cause

This issue stems from programs that launch dialog windows, open application windows while performing tasks, and then close. 

When a program requires user interaction (such as a dialog box, prompt, or application window), WA  Agent must run it within an active user session as per Microsoft policy. If the user defined in the job does not have an active RDP session, the OS will deny the WA Agent to run the job and will return an error indicating that no user session is available.

Resolution

Historically, these types of programs ran in Session 0 — an isolated session invisible to users. However, Microsoft has restricted access to Session 0 for background services.
 
There are two options for resolving this problem. They are:
  1. User Login Approach:
    Have a user login via RDP each time the job needs to run or find a way to keep an RDP session open for that user (often considered a security risk); or
  2. Non-Interactive Solution:
    Redesign or modify the job so that it no longer requires user interaction, allowing it to run entirely in the background.

MSDN articles that discuss interactive programs in Session 0:

 

For option #1, the user must now be logged in via RDP for WA Agent to be able to run interactive jobs. Set following parameter in the agentparm.txt

oscomponent.interactive=true