[Satellite 6] Why the repositories are in Never Synced status.

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.3
  • Red Hat Satellite 6.2

Issue

  • Not able to see the last sync date of the repositories synced recently.
  • Repository sync status always shows Never Synced.

Resolution

Don't delete all tasks before a new sync is launched, as tasks are used to determine if a repository has been synced or not.

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

Root Cause

Satellite uses completed tasks to check if repository sync have been done or not. If past tasks are being deleted by cleanup job before a new sync happens, Satellite will show all repositories as Never Synced.

If Satellite cleanup has been enabled with --foreman-plugin-tasks-automatic-cleanup true, it will configure a cronjob that cleans tasks that are 30 days or older. This cronjob can be modified to change the amount of days of tasks it should keep. Cleanup options are described in another article.

Default job:

45 19 * * *    foreman    /usr/sbin/foreman-rake foreman_tasks:cleanup >>/var/log/foreman/cron.log 2>&1

Modified job example:

0 0 * * * foreman-rake foreman_tasks:cleanup TASK_SEARCH='label ~ *' AFTER='3d' VERBOSE=true

# another example

ForemanTasks::Task.where(:state => :stopped).where(:result => :success).destroy_all

Diagnostic Steps

Check if a cleanup task exists in a cron file like /etc/cron.d/foreman-tasks, /etc/cron.d/foreman, /etc/crontab, /var/spool/cron/root or /var/spool/cron/foreman.

SBR
Product(s)
Components
Category
Tags

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.