Bug #34436
closedGetting "404 not found" when publishing a content view
Description
Description of problem:
Getting the following error when publishing a content view:
-----------------------------------------
9: Actions::Pulp3::Repository::SaveVersion (error) [ 3352.43s / 0.74s ] Skip
Error:
PulpRpmClient::ApiError
Error message: the server returns an error HTTP status code: 404 Response headers: {"Date"=>"XXXXXXX", "Server"=>"gunicorn", "Content-Type"=>"application/json", "Vary"=>"Accept,Cookie", "Allow"=>"GET, PUT, PATCH, DELETE, HEAD, OPTIONS", ...<snip>} Response body: {"detail":"Not found."}
-----------------------------------------
This is because the Composite content view and its component content views are referring to the same repositories in Pulp (See below). Delete the composite content view will delete the referring Pulp repositories. Therefore, it breaks all the component content views.
This only affecting the content views that are migrated to Satellite 6.10 from 6.9. Those newly created in Satellite 6.10 don't have this issue.
-----------------------------------------
foreman-rake console
pp Katello::ContentView.find_by_label("ccv_test").repository_references
[#<Katello::Pulp3::RepositoryReference:0x0000000013f33320
id: 25,
repository_href:
"/pulp/api/v3/repositories/rpm/rpm/eb4ce2fd-1056-4736-976d-9a7d629fa334/", <=========== same
content_view_id: 17,
root_repository_id: 2>]
pp Katello::ContentView.find_by_label("cv_test").repository_references
[#<Katello::Pulp3::RepositoryReference:0x0000000013c99f88
id: 7,
repository_href:
"/pulp/api/v3/repositories/rpm/rpm/eb4ce2fd-1056-4736-976d-9a7d629fa334/", <=========== same
content_view_id: 2,
root_repository_id: 2>]
-----------------------------------------
Steps to Reproduce:
1. In Satellite 6.9, create a content view with at least 1 repo. Publish it.
2. Create a composite content view and add the content view you just created to it. Publish it.
3. Follow guide to migrate from pulp 2 to pulp 3.
satellite-maintain content prepare
4. Upgrade to Satellite 6.10.
5. In Satellite 6.10, delete the composite content view.
6. After that publish the content view
Actual results:
404 not found
Expected results:
No error
Additional information
Other composite content views that are having the same repository references will also break.