Rerun a Failed Job in Oracle OS Management Hub Tutorial

Introduction

If a job fails, you can rerun the failed job instead of manually creating a new job to retry the failed action. You can rerun a failed job immediately or schedule it to run at a future date and time. Let’s review a failed job, examine the error logs, address the issue, and then rerun the failed job.

Objectives

In this tutorial, you’ll learn how to:

Prerequisites

Access to an Oracle Cloud Infrastructure tenancy with:

Run an Install Package Job on a Standalone Instance

  1. Open the navigation menu and click Observability & Management. Under OS Management Hub, click Instances.

  2. Under List scope, select the compartment that contains the instance.

  3. Click the name of the instance to navigate to the instance’s details page.

  4. Under Resources, click Packages and then click the Available packages tab.

  5. Enter the following in the search bar on the Available packages table.

    R-4.4.1-1.0.1.el8.x86_64
    
  6. Select the package.

  7. Click Install.

    add_pkg_1

  8. Enter the install package job details.

    • Name: Keep the default job name.
    • Description: (Optional) Enter a description for the job.
    • Schedule: Choose Run immediately.
  9. Click Install.

View Job Status

The install package job will become visible on the Jobs resource on the instance details page.

  1. Click Jobs under resource.

  2. Click on the In-progress jobs tab.

  3. Find the install R-4.4.1-1.0.1.el8.x86_64 job.

    add_pkg_job_1

    After the installation has completed or failed, the job will move to the Completed jobs tab.

  4. Click the Completed jobs tab.

    After a few minutes, refresh the page.

    add_pkg_job_2

The Job is now listed on the Completed jobs tab and has a Failed Status.

Examine Error Logs of Failed Job

You can use error logs and log messages to troubleshoot issues with jobs. To view a Job’s log messages and error log, navigate to the job’s details page.

  1. on the Completed jobs tab, click on the install R-4.4.1-1.0.1.el8.x86_64 job to view the job details page.

  2. Click Error messages under Resources.

    failed_job_1

  3. On the right side of the error message entry, click the down arrow to expand the message.

    The error log provides details on how the job failed. In this case, the error log provided the following output:

    Problem: package R-4.4.1-1.0.1.el8.x86_64 from ol8_addons requires R-devel = 4.4.1-1.0.1.el8, but none of the providers can be installed
    conflicting requests nothing provides texinfo-tex needed by R-devel-4.4.1-1.0.1.el8.x86_64 from ol8_addons 
    Nothing to do.
    

    The output indicates that the install job is missing a provider for a dependent package.

Some Oracle Linux packages have dependencies on many vendor software sources. Let’s examine which vendor software sources are attached to the instance and then identify which software sources might be missing that provide the dependent packages.

View Attached Software Sources

  1. Open the navigation menu and click Observability & Management. Under OS Management Hub, click Instances.

  2. Under List scope, select the compartment that contains the instance.

  3. Click the name of the instance.

  4. Under Resources, click Software sources.

    attach_ss_1

  5. Review the list of software sources for any missing repositories.

    The package requires the Codeready_Builder vendor software source for some of its package dependencies.

Attach Vendor Software Sources

  1. Click Attach.

  2. Enter the details for the attach software source job.

    • Name: Keep the default name.
    • Description: (Optional) Enter a description for the job.
  3. Select the compartment under List scope.

  4. Select the ol8_codeready_builder-x86_64 software source to attach to the instance.

    • Name: Keep the default job name.
    • Description: (Optional) Enter a description for the job.
    • Schedule: Choose Run immediately.
  5. Click attach.

Rerun the failed Job

After attaching the missing vendor software source; rerun the failed job.

  1. Return to the Jobs resource on the Instance’s details page.

  2. Select the failed job in the Completed jobs tab.

  3. Click Rerun failed job.

    failed_job_2

    Alternatively, the rerun job can be created from the failed job’s details page. To rerun the failed job on the job’s details page, click the name of the failed job and then click Rerun.

    failed_job_3

  4. Enter the details for the rerun job.

    • Name: Keep the default job name.
    • Description: (Optional) Enter a description for the job.
    • Schedule: Choose Run immediately.
  5. Click Create.

A rerun creates a new job of the same action. The original job and its status remain as-is for auditing and historical purposes.

Next Steps

The rerun job will complete the same action of installing the package along with its dependencies that the initial install job failed at completing. Rerunning failed jobs can also be helpful when managing groups of instances. You can rerun a failed parent job at the group level or rerun an individual, failed child job with the rerun failed jobs service feature in OS Management Hub.

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.