Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2047675 - Getting "404 not found" when publishing a content view
Summary: Getting "404 not found" when publishing a content view
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Views
Version: 6.10.0
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: 6.11.0
Assignee: satellite6-bugs
QA Contact: Lai
URL:
Whiteboard:
: 2049195 2079460 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-28 09:36 UTC by Hao Chang Yu
Modified: 2022-10-20 21:22 UTC (History)
15 users (show)

Fixed In Version: tfm-rubygem-katello-4.3.0.3-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2059379 (view as bug list)
Environment:
Last Closed: 2022-07-05 14:32:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 34436 0 Urgent New Getting "404 not found" when publishing a content view 2022-02-10 20:20:10 UTC
Red Hat Issue Tracker CEECBA-6117 0 None None None 2022-03-11 07:12:31 UTC
Red Hat Knowledge Base (Solution) 6809431 0 None None None 2022-03-11 07:07:02 UTC
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:32:41 UTC

Description Hao Chang Yu 2022-01-28 09:36:31 UTC
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.

Comment 1 Peter Vreman 2022-01-31 10:56:30 UTC
I think i hit this issue also
The first weeks after migration the sat6.10+pulp3 was running fine. But now i updated content and published new CVs and updated the CCVs the CCV publishing is broken and if the tasks somehow finished the clients only get 404 to retrieve the metadata.
I do not delete CCVs as a whole. Instead if i have published+promoted CCV-versions then the old versions are nicely cleaned-up if they area not assigned to a LE anymore.

Comment 2 Paul Dudley 2022-02-02 19:38:50 UTC
*** Bug 2049195 has been marked as a duplicate of this bug. ***

Comment 4 Paul Dudley 2022-02-02 23:31:56 UTC
Closing bz 2049195 as a duplicate of this, just noting here that the correct_repostories rake does not solve this issue. As noted there, this rake will clear the repos in foreman that are no longer in Pulp:
~~~
foreman-rake console << EORAKE
Katello::Pulp3::RepositoryReference.all.select do |ref|
  api = Katello::RepositoryTypeManager.repository_types[ref.root_repository.content_type].pulp3_api_class.new(SmartProxy.pulp_primary)
  api.repositories_api.read(ref.repository_href)  
rescue => e
   if e&.code == 404
     ref.destroy
   end
end
EORAKE
~~~

Comment 8 Justin Sherrill 2022-02-10 20:20:09 UTC
Created redmine issue https://projects.theforeman.org/issues/34436 from this bug

Comment 11 Lai 2022-03-01 21:17:36 UTC
I followed the steps outside in the description of the bz for verification.

After upgrade and deleting a ccv, I was able to publish the cv that was in the ccv and it was able to publish successfully.

Verified on 7.0 snap 11 with tfm-rubygem-katello-4.3.0.7-1.el7sat.noarch.

This was tested on rhel7.9.  Can't test this on a rhel8.5 system because sat6.9 is only on rhel7.

Comment 15 errata-xmlrpc 2022-07-05 14:32:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5498

Comment 17 myoder 2022-09-23 16:12:19 UTC
*** Bug 2079460 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.