Foreman-maintain tries do update delete sync plan

Problem:
Offline backups fail because foreman-maintain tries do update deleted sync plan.
We had some issues with the “original” sync plan, so we removed it using hammer sync-plan delete … and a new one was created.
We double checked and no product has the old sync plan id on it’s configuration.

The backup works just fine if we whitelist the sync-plans-enable

# foreman-maintain backup offline --skip-pulp-content --assumeyes --plaintext /backups
(...)
re-enabling sync plans                                                [FAIL]
Could not update the sync plan:
  Could not find sync_plan resource with id 4. Potential missing permissions: edit_sync_plans
  
(...)

Expected outcome:

Foreman and Proxy versions:

  • foreman: 3.5.2

Foreman and Proxy plugin versions:

  • foreman-tasks: 7.1.1
  • foreman_ansible: 10.4.1
  • foreman_openscap: 6.0.0
  • foreman_puppet: 5.0.0
  • foreman_remote_execution: 8.2.0
  • katello: 4.7.4

Distribution and version:
Rocky Linux release 8.7 (Green Obsidian)

Other relevant data:

This is fixed in Foreman Maintain 1.2.6 (Bug #36024: sync-plans not in sync with foreman-maintan data.yml - Foreman Maintain - Foreman) which will be released as part of Foreman 3.5.3 release process

@evgeni Thank you for the feedback.

After editing the file /var/lib/foreman-maintain/data.yml and remove the line for the old sync_plan the offline backup works.

Thank you for your help.