Satellite Job Invocations randomly disappear over the time

Solution Verified - Updated

Environment

Red Hat Satellite 6

Issue

  • We run many Job Invocations on a daily basis. Before and after a (bulk of) Job Invocations, we check the number of executed Jobs.

  • Here, we noticed the count of overall Job Invocations sometimes drops.

  • Why and when it happens?

Resolution

  • This is a direct consequence of foreman tasks cleanup.

  • To alter the automatic tasks cleanup, please follow this solution.

  • To modify the cleanup config, edit the /etc/foreman/plugins/foreman-tasks.yaml file.

For more KB articles/solutions related to Red Hat Satellite 6.x Satellite Tasking System Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Satellite Tasking System Issues.

Root Cause

By default, Satellite cleans successful tasks older than 30 days, and all tasks older than one year. See its config per foreman-rake foreman_tasks:cleanup:config output, or directly in /etc/foreman/plugins/foreman-tasks.yaml config.

The tasks are cleaned on daily basis via cronjob in /etc/cron.d/foreman-tasks:

# Clean up expired tasks from the database
45 19 * * *    foreman    /usr/sbin/foreman-rake foreman_tasks:cleanup >>/var/log/foreman/cron.log 2>&1

Alongside with tasks cleanup, Job Invocations that become orphaned are cleaned as well. i.e. when a task is cleaned, the Job Invocation backed by the deleted task is removed as well.

SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.