run:
foreman-rake console
Then inside the console run:
if Katello::Resources::Candlepin::Owner.all
Katello::Content.all.each do |c|
::Katello::Resources::Candlepin::Content.get(c.organization.label, c.cp_content_id)
rescue RestClient::NotFound
puts "Will Delete #{c.label}"
end && []
end
This will print out the 'content' sets that will be deleted, for example:
Will Delete my-missing-repo
=> []
If this output looks okay, then run this to actually delete them:
if Katello::Resources::Candlepin::Owner.all
Katello::Content.all.each do |c|
::Katello::Resources::Candlepin::Content.get(c.organization.label, c.cp_content_id)
rescue RestClient::NotFound
puts "Deleting #{c.label}"
c.delete
end && []
end
Finally, re-run:
foreman-rake katello:correct_repositories