Job not starting next run time due to box_success logic - AutoSys
search cancel

Job not starting next run time due to box_success logic - AutoSys

book

Article ID: 446324

calendar_today

Updated On:

Products

Autosys Workload Automation

Issue/Introduction

An AutoSys box job configured with interval scheduling (e.g., start_mins) fails to calculate its next run time and remains in a RUNNING state. This prevents the box from cycling automatically. Manual intervention, such as a force start, is required to trigger the next execution. This behavior typically occurs when the box_success attribute is used in a way that creates circular logic or depends on a child job that has failed.

Specific symptoms include:

  • Box job remains in RUNNING status after child jobs finish.
  • autorep output for the box does not show a "Next Run Time."
  • The job does not start at the next scheduled interval.
  • A child job within the box is in FAILURE or TERMINATED status.
  • You must manually force start the job.

/* ----------------- <BOX_NAME>----------------- */

insert_job: <BOX_NAME>   job_type: BOX
box_name: <PARENT_BOX_NAME>
owner: ####
permission:
date_conditions: 1
days_of_week: all
start_mins: 00,05,10,15,20,25,30,35,40,45,50,55
box_success: s(<SAP_JOB_NAME>)
n_retrys: 2
alarm_if_fail: 1
alarm_if_terminated: 1

 /* ----------------- <SAP_JOB_NAME> ----------------- */

 insert_job: <SAP_JOB_NAME>   job_type: SAP
 box_name: <BOX_NAME>_RESTART
 machine: ####
 owner: ####
 permission:
 date_conditions: 0
 description: "GET Staging Table Records"
 max_run_alarm: 120
 alarm_if_fail: 1
 alarm_if_terminated: 1
 send_notification: 1
 notification_template: "SAP_NOTIFICATION"
 sap_job_name: "####"
 sap_client: ####
 sap_rfc_dest: ####
 sap_mon_child: N
 sap_office: N
 sap_release_option: A
 sap_step_parms: abap_name="####",step_user="####",variant="####",banner_page=N,release=N,print_imm=N,new_spool=Y,footer=N


 /* ----------------- <SLEEP_JOB_NAME> ----------------- */

 insert_job: <SLEEP_JOB_NAME>   job_type: CMD
 box_name: <BOX_NAME>_RESTART
 command: sleep 120
 machine: ####
 owner: ####
 permission:
 date_conditions: 0
 condition: f(<SAP_JOB_NAME>)
 alarm_if_fail: 1
 alarm_if_terminated: 1

Environment

Product: AutoSys Workload Automation
Component: AE Scheduler
Release: All Supported Versions

Cause

By design, if a box_success attribute is defined, the box only transitions to a SUCCESS state when that specific condition is met. If the condition is s(job_name) and that job fails, the box remains in RUNNING status because it has not yet succeeded. Because the box never reaches a completion state (SUCCESS or FAILURE), the Scheduler does not calculate the next start time for interval-based scheduling.

Resolution

To ensure the box cycles and schedules its next run time regardless of the individual success of child jobs, use one of the following methods:

  1. Method 1: Use the done() condition: Modify the box_success attribute to use done(job_name) instead of s(job_name). This allows the box to succeed when the job finishes with any status (Success or Failure).

    update_job: box_name
    box_success: done(child_job_name)


  2. Method 2: Remove the box_success attribute: If the box should succeed based on default behavior (all jobs finishing), remove the attribute entirely. The box will then transition to a terminal state based on the exit codes of its children.

    update_job: box_name
    box_success:

Note: Avoid referencing a job inside the box within its own box_success criteria if circular logic could prevent the box from completing during retries.

Additional Information

For more details on attribute evaluation, refer to the AutoSys Documentation on box_success.

To speak with a customer representative or a Support Engineer see Contact Support. Scroll to the bottom of the page and click on the respective region.