CA WA job failing with Job failed. Exit code 2
search cancel

CA WA job failing with Job failed. Exit code 2

book

Article ID: 142535

calendar_today

Updated On:

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 CA Workload Automation DE - System Agent (dSeries)

Issue/Introduction

The command or script jobs fail on CA WA Agent.

Job failed. Exit code 2, Status: "The system cannot find the file specified."

 

Environment

Release : 11.3.6

Component : CA Workload Automation AE / CA Workload Automation DE / CA Workload Automation Agent

Cause

The CA WA Agent was not able to find the command or script in the PATH.

Resolution

Check the PATH and make sure it includes the directory / folder to the command / script to be executed.

In Windows, login as the user defined in the job and in command prompt (CMD) enter:

echo %PATH%

Linux/UNIX, login as the user of the job and enter this command to check the path:

echo $PATH

If PATH cannot be updated, then put the entire path of command/script in the job.

Windows: C:\Some_Dir\mycommand.exe

Linux/UNIX :  /mydir/myscipt.sh

 

Additional Information

Tip: It is always a good idea to enter the full path of the command in the job.  Use Manager / Scheduler level variables if the path can change or is relative.  The manager will resolve the variables to the path and then send the job to the WA Agent.