[Satellite6] satellite-maintain content prepare fails with " Katello::Errors::Pulp3Error: Missing repositories found, please run 'COMMIT=true foreman-rake katello:correct_repositories'"

Solution Verified - Updated -

Issue

satellite-maintain content prepare is failing

 Content migration starting. These steps may take a while to complete. Refer to foreman-maintain content migration-stats for an estimate.Migration failed, You will want to investigate: https://test-satellite-latest.sysmgmt.lan/foreman_tasks/tasks/5e3ad857-d36f-4681-bcfd-b9c0664b3813
rake aborted!
ForemanTasks::TaskError: Task 5e3ad857-d36f-4681-bcfd-b9c0664b3813: Katello::Errors::Pulp3Error: Missing repositories found, please run 'COMMIT=true foreman-rake katello:correct_repositories'.  Original error: Validation failed: resources missing {'repositories_missing_distributors': ['1-CV_RHEL7_Prod-QA-5af4eaef-3507-45c0-b6f7-83d38b6bde78', '1-CV_RHEL7_Prod-QA-78cc62b4-0470-4c2c-9ded-cd83f36fa3a8', '1-CV_RHEL7_Prod-QA-f0e82b7e-6da9-4868-9672-5a4aa8fc60a6', '1-CV_RHEL7_DEV_QA-QA-bea8e8ce-4764-461e-8872-fc88fb5f2cf5', '1-CV_RHEL7_Prod-QA-55c7a98d-6fda-4b91-88be-71ceb04aa50e', '1-CV_RHEL7_Prod-QA-9c3cf575-306d-4339-a2cd-793b10edc412', '1-CV_RHEL7_Prod-QA-2894c3a7-906d-40d6-86d4-2293dcc02aef', '1-CV_RHEL7_DEV_QA-QA-867e5d40-fb7c-466a-891c-438afd8aee39', '1-CV_RHEL7_DEV_QA-QA-115feb22-acd7-4565-a038-9437e75ffb7f', '1-CV_RHEL6_DEV_QA-QA-90156c1c-e82e-4642-a047-e744849ad9d3', '1-CV_RHEL7_Prod-QA-115feb22-acd7-4565-a038-9437e75ffb7f', '1-CV_RHEL7_Prod-QA-56b5172a-26d3-40b1-baa1-e9da1141aff9', '1-CV_RHEL7_Prod-QA-867e5d40-fb7c-466a-891c-438afd8aee39', '1-CV_RHEL7_Prod-QA-39d86ca1-19a8-4cf9-abf1-bffee0976494', '1-CV_RHEL7_DEV_QA-QA-56b5172a-26d3-40b1-baa1-e9da1141aff9', '1-CV_RHEL6_DEV_QA-QA-8ea45dcd-1f32-4eeb-b412-38fb110975f3', '1-CV_RHEL7_DEV_QA-QA-7fb4fd4d-4ca1-43f5-bcc0-9f0b09ca0543', '1-CV_RHEL7_DEV_QA-QA-f0e82b7e-6da9-4868-9672-5a4aa8fc60a6', '1-CV_RHEL7_DEV_QA-QA-b41d382d-0bb2-451c-bb3f-767e601185aa', '1-CV_RHEL7_Prod-QA-b41d382d-0bb2-451c-bb3f-767e601185aa', '1-CV_RHEL6_DEV_QA-QA-54daf0dc-75df-4926-8a48-0e30a7360b9c', '1-CV_RHEL6_DEV_QA-QA-2f6f886e-84c7-4f35-8599-47ae892b3389', '1-CV_RHEL6_DEV_QA-QA-d77d6042-593b-441f-a51a-097170876efd', '1-CV_RHEL7_DEV_QA-QA-9c3cf575-306d-4339-a2cd-793b10edc412', '1-CV_RHEL7_Prod-QA-bea8e8ce-4764-461e-8872-fc88fb5f2cf5', '1-CV_RHEL7_DEV_QA-QA-2894c3a7-906d-40d6-86d4-2293dcc02aef', '1-CV_RHEL7_Prod-QA-81a1de65-8d3b-4789-93d9-772abc6a1d73', '1-CV_RHEL7_DEV_QA-QA-55c7a98d-6fda-4b91-88be-71ceb04aa50e', '1-CV_RHEL7_DEV_QA-QA-16e572e3-e2fe-454c-bba9-ef1098b83646', '1-CV_RHEL7_Prod-QA-7fb4fd4d-4ca1-43f5-bcc0-9f0b09ca0543', '1-CV_RHEL6_DEV_QA-QA-61071fc8-88fb-45c7-a2da-a12e31af6002', '1-CV_RHEL7_Prod-QA-16e572e3-e2fe-454c-bba9-ef1098b83646']}
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.53/lib/katello/tasks/pulp3_migration.rake:43:in block (2 levels) in <top (required)>' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/exe/rake:27:in <top (required)>'
Tasks: TOP => katello:pulp3_migration
(See full trace by running task with --trace)
                                                                      [FAIL]
Failed executing preserve_output=true foreman-rake katello:pulp3_migration, exit status 1

As suggested by error message, when executing

#foreman-rake katello:correct_repositories COMMIT=true

Is failing on

ForemanTasks::TaskError: Task 4c894944-72e2-441f-91eb-bdd2b872a422: Katello::Errors::CandlepinError: Environment with id 42874e5dfdf4a32935c25ea92bf0c5aa could not be found.
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-3.0.6/lib/foreman_tasks.rb:59:in block in sync_task' /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-3.0.6/lib/foreman_tasks.rb:58:in tap'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-3.0.6/lib/foreman_tasks.rb:58:in sync_task' /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.53/lib/katello/tasks/repository.rake:163:in handle_missing_repo'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.53/lib/katello/tasks/repository.rake:65:in block (3 levels) in <top (required)>' /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/relation/batches.rb:70:in block (2 levels) in find_each'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/relation/batches.rb:70:in each' /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/relation/batches.rb:70:in block in find_each'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/relation/batches.rb:136:in block in find_in_batches' /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/relation/batches.rb:238:in block in in_batches'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/relation/batches.rb:222:in loop' /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/relation/batches.rb:222:in in_batches'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/relation/batches.rb:135:in find_in_batches' /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/relation/batches.rb:69:in find_each'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.53/lib/katello/tasks/repository.rake:62:in with_index' /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.53/lib/katello/tasks/repository.rake:62:in block (2 levels) in <top (required)>'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
Tasks: TOP => katello:correct_repositories
(See full trace by running task with --trace)

Environment

Satellite 6.9

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content