Description of problem: - Unable to create an incremental CV update. The action fails: [root@jsenkyri-satellite-latest ~]# hammer content-view version incremental-update --content-view-version-id 17 --errata-ids 15612 [............................................................................................. ] [54%] Incremental Update incomplete. Error: Error message: the server returns an error HTTP status code: 400 Response headers: {"Date"=>"Mon, 17 Jan 2022 13:34:17 GMT", "Server"=>"gunicorn", "Content-Type"=>"application/json", "Vary"=>"Accept,Cookie", "Allow"=>"POST, OPTIONS", "X-Frame-Options"=>"SAMEORIGIN", "Content-Length"=>"110", "Correlation-ID"=>"e5e90bcb-a6ac-4d73-af84-d89a3ea18180", "Access-Control-Expose-Headers"=>"Correlation-ID", "Via"=>"1.1 jsenkyri-satellite-latest.sysmgmt.lan", "Connection"=>"close"} Response body: ["Version 1 does not exist for repository 'Red_Hat_Enterprise_Linux_8_for_x86_64_-_AppStream_RPMs_8-581060'."] Version-Release number of selected component (if applicable): - Satellite 6.10 How reproducible: - Always Steps to Reproduce: 1. Create a CV: hammer> content-view info --id 3 Id: 3 Name: rhel8 Label: rhel8 Composite: false Description: Content Host Count: 0 Solve Dependencies: false Organization: Default Organization Yum Repositories: 1) Id: 7 Name: Red Hat Enterprise Linux 8 for x86_64 - BaseOS RPMs 8 Label: Red_Hat_Enterprise_Linux_8_for_x86_64_-_BaseOS_RPMs_8 2) Id: 6 Name: Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs 8 Label: Red_Hat_Enterprise_Linux_8_for_x86_64_-_AppStream_RPMs_8 Container Image Repositories: OSTree Repositories: Lifecycle Environments: 1) Id: 1 Name: Library 2) Id: 2 Name: test Versions: 1) Id: 18 Version: 2.1 Published: 2022/01/17 13:34:08 2) Id: 16 Version: 1.0 Published: 2022/01/17 12:53:25 3) Id: 17 Version: 2.0 Published: 2022/01/17 12:53:57 Components: Activation Keys: 2. Try to add errata: [root@jsenkyri-satellite-latest ~]# hammer content-view version list ---|-------------------------------|---------|----------------------------------------------------------------------------------|----------------------- ID | NAME | VERSION | DESCRIPTION | LIFECYCLE ENVIRONMENTS ---|-------------------------------|---------|----------------------------------------------------------------------------------|----------------------- 14 | rhel7 11.2 | 11.2 | | 13 | rhel7 11.1 | 11.1 | | 12 | rhel7 11.0 | 11.0 | | Library 11 | rhel7 10.0 | 10.0 | | 10 | rhel7 9.0 | 9.0 | | 15 | rhel7 8.1 | 8.1 | | 9 | rhel7 8.0 | 8.0 | | 8 | rhel7 7.0 | 7.0 | | 7 | rhel7 6.0 | 6.0 | | 6 | rhel7 5.0 | 5.0 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... | 5 | rhel7 4.0 | 4.0 | | 4 | rhel7 3.0 | 3.0 | | 17 | rhel8 2.0 | 2.0 | | Library, test 3 | rhel7 2.0 | 2.0 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... | 16 | rhel8 1.0 | 1.0 | | 2 | rhel7 1.0 | 1.0 | | 1 | Default Organization View 1.0 | 1.0 | | Library ---|-------------------------------|---------|----------------------------------------------------------------------------------|----------------------- [root@jsenkyri-satellite-latest ~]# hammer erratum list | grep RHBA-2022:0106 15612 | RHBA-2022:0106 | bugfix | .NET 6.0 bugfix update | 2022-01-11 | 2022-01-11 [root@jsenkyri-satellite-latest ~]# hammer content-view version incremental-update --content-view-version-id 17 --errata-ids 15612 [............................................................................................. ] [54%] Incremental Update incomplete. Error: Error message: the server returns an error HTTP status code: 400 Response headers: {"Date"=>"Mon, 17 Jan 2022 13:34:17 GMT", "Server"=>"gunicorn", "Content-Type"=>"application/json", "Vary"=>"Accept,Cookie", "Allow"=>"POST, OPTIONS", "X-Frame-Options"=>"SAMEORIGIN", "Content-Length"=>"110", "Correlation-ID"=>"e5e90bcb-a6ac-4d73-af84-d89a3ea18180", "Access-Control-Expose-Headers"=>"Correlation-ID", "Via"=>"1.1 jsenkyri-satellite-latest.sysmgmt.lan", "Connection"=>"close"} Response body: ["Version 1 does not exist for repository 'Red_Hat_Enterprise_Linux_8_for_x86_64_-_AppStream_RPMs_8-581060'."] Additional info: - I tried with 2 different CVs (rhel7 and rhel8) - This is a fresh 6.10 install - Can provide access to reproducer
I can not reproduce this on some small CV/repo (i.e. Sat6.10 tools for RHEL8): 1) sync the repo 2) have CV with that repo BUT applied filter "exclude puppet-agent RPM" (this will remove 1 RPM and 1 errata) 3) incremental update of the CV to add the package and also add the errata: hammer> content-view version incremental-update --organization-id 1 --content-view-version-id 16 --package-ids 95140 [.....................................................................................................................................................................................] [100%] Content View: cv_tools_rhel8 version 2.1 Added Content: Packages: puppet-agent-6.22.1-1.el8sat.x86_64 hammer> content-view version incremental-update --organization-id 1 --content-view-version-id 16 --errata-ids 1 [.....................................................................................................................................................................................] [100%] Content View: cv_tools_rhel8 version 2.2 Added Content: Errata: RHBA-2021:4701 Packages: puppet-agent-6.22.1-1.el8sat.x86_64 hammer> So maybe something related to bigger repos?
.. and also incremental update of CV with RHEL7 (and another with RHEL8 baseos+appstream) went well for me. The bug hit isn't much generic as originally expected.
OK, there *is* a deterministic reproducer: 1) Create a custom product and repo 2) Upload a package to it 3) Create a CV, add that repo to it and publish 4) Upload another RPM (ideally same Name but higher Version/Release) to the repo 5) incremental update of the CV version fails: hammer> content-view version incremental-update --organization-id 1 --content-view-version-id 33 --package-ids 95164 [................................................................................... ] [46%] Incremental Update incomplete. Error: Error message: the server returns an error HTTP status code: 400 Response headers: {"Date"=>"Wed, 19 Jan 2022 11:19:52 GMT", "Server"=>"gunicorn", "Content-Type"=>"application/json", "Vary"=>"Accept,Cookie", "Allow"=>"POST, OPTIONS", "X-Frame-Options"=>"SAMEORIGIN", "Content-Length"=>"74", "Correlation-ID"=>"2f1977aa-d8c6-443f-aa97-984158ef1b5d", "Access-Control-Expose-Headers"=>"Correlation-ID", "Via"=>"1.1 pmoravec-sat610.satotest.gsslab.brq2.redhat.com", "Connection"=>"close"} Response body: ["Version 1 does not exist for repository 'sos_repo_incremental-695507'."] hammer> So it seem the problem happens when incrementally updating some content that was *missing* in _root_ repository (katello term) at the time of original CV publish / when the CV version (being incremented from) was created. Anyway, this is the typical use case of incremental update, the "restrict content via filters" is more artificial => quite severe bug (for incremental update).
Lai, isn't there some automated test for this? I would expect there is / should be..
Hey Pavel, We do have some tests around incremental update. Here are some: https://github.com/SatelliteQE/robottelo/blob/master/tests/foreman/cli/test_contentview.py#L3732 https://github.com/SatelliteQE/robottelo/blob/master/tests/foreman/ui/test_contentview.py#L2980 https://github.com/SatelliteQE/robottelo/blob/master/tests/foreman/ui/test_contentview.py#L3041 And then there's a few incremental update test in api/test_errata.py. If you see that there's some missing coverage, I can put those on my backlog.
I was looking into this community issue which I believe is the same one: https://community.theforeman.org/t/unable-to-publish-an-incremental-cv-update/27085/7 I'm not sure the root cause, but I found some potentially helpful info when debugging the Pulp copy task during incremental update: For the copy API call to Pulp during MultiCopyUnits, it appears that the "dest_repo" field is set incorrectly to the Pulp repository that is attached to one of the content view version's non-archived repositories. This incorrect assignment comes from the destination repository's RepositoryReference: https://github.com/Katello/katello/blob/master/app/services/katello/pulp3/repository/yum.rb#L97 It should be the dest_repo for the archived repository instead. Somehow, the RepositoryReference has a different repository from the ::Katello::Repository : [87] pry(main)> ::Katello::Pulp3::Repository::Yum.new(::Katello::Repository.find(60), SmartProxy.pulp_primary).repository_reference => #<Katello::Pulp3::RepositoryReference:0x000055a2ca5cbb98 id: 32, repository_href: "/pulp/api/v3/repositories/rpm/rpm/afa0e2cf-d25c-4ce9-b367-a54f5be2c481/", content_view_id: 18, root_repository_id: 16> compared to: [89] pry(main)> ::Katello::Repository.find(60).version_href => "/pulp/api/v3/repositories/rpm/rpm/d49ad868-8b54-4058-8195-da08a4a89529/versions/2/" I only saw this happen when I tried Pavel's reproducer steps by uploading a new RPM to a repository. It does not occur if I test instead by filtering out errata and incrementally adding them back in, for example.
Created redmine issue https://projects.theforeman.org/issues/34357 from this bug
Moving to POST as the upstream PR is now merged.
Hotfix RPM is available for Satellite 6.10.2 OBTAINING THE HOTFIX: The hotfix RPM is too large to be provided as an attachment on Bugzilla. Therefore please contact Red Hat Technical Support to obtain the hotfix. INSTALLING THE HOTFIX: 1. Take a complete backup or snapshot of Satellite 6.10.2 server 2. Obtain the hotfix RPM from Red Hat Technical Support and copy it to Satellite server 3. # yum install ./tfm-rubygem-katello-4.1.1.42-3.HOTFIXRHBZ2041497.el7sat.noarch.rpm --disableplugin=foreman-protector 4. # satellite-maintain service restart
Steps to retest 1. Create some repo and sync it 2. Delete some packages from the repo 3. Create a CV, add the repo, and publish 4. Re-sync the repo to get the deleted RPMs back 5. Incrementally add one or more RPMs back in Expected: Incrementally update should be successful Actual: Incremental update is successful I tried this with the zoo repo and removed 'bear' and 'frog' packages. After following the steps and doing inc update on the missing package, it was added successfully without issues. I tried this with a ccv and that was also successful. Verified on 7.0 snap 11. Tested on both rhel7 and rhel8.
Hello, My customer is on 6.10.3 and still facing this issue.
(In reply to Ian Ballou from comment #9) > I was looking into this community issue which I believe is the same one: > https://community.theforeman.org/t/unable-to-publish-an-incremental-cv- > update/27085/7 > > I'm not sure the root cause, but I found some potentially helpful info when > debugging the Pulp copy task during incremental update: > > For the copy API call to Pulp during MultiCopyUnits, it appears that the > "dest_repo" field is set incorrectly to the Pulp repository that is attached > to one of the content view version's non-archived repositories. This > incorrect assignment comes from the destination repository's > RepositoryReference: > https://github.com/Katello/katello/blob/master/app/services/katello/pulp3/ > repository/yum.rb#L97 > > It should be the dest_repo for the archived repository instead. Somehow, > the RepositoryReference has a different repository from the > ::Katello::Repository : > > [87] pry(main)> > ::Katello::Pulp3::Repository::Yum.new(::Katello::Repository.find(60), > SmartProxy.pulp_primary).repository_reference > => #<Katello::Pulp3::RepositoryReference:0x000055a2ca5cbb98 > id: 32, > repository_href: > "/pulp/api/v3/repositories/rpm/rpm/afa0e2cf-d25c-4ce9-b367-a54f5be2c481/", > content_view_id: 18, > root_repository_id: 16> > > compared to: > > [89] pry(main)> ::Katello::Repository.find(60).version_href > => > "/pulp/api/v3/repositories/rpm/rpm/d49ad868-8b54-4058-8195-da08a4a89529/ > versions/2/" > > > > I only saw this happen when I tried Pavel's reproducer steps by uploading a > new RPM to a repository. It does not occur if I test instead by filtering > out errata and incrementally adding them back in, for example. Hi Pavel's steps are in comment #4 I read through the tests Lai mentioned in comment #6 All currently use filtering to create applicability but no installability. The CLI test is specifically about not having a LCE. @lai you could modify "test_positive_errata_inc_update_list_package"[1] to upload an RPM in place of applying a filter the UI tests are slower than API tests, so you could ask @akjha if he can change his API test[2] to upload an RPM in place of applying a filter. Or just copy and modify it. [1] https://github.com/SatelliteQE/robottelo/blob/f8b6c8ad742bab67e0f75b0fa63fd4d5d5743476/tests/foreman/ui/test_contentview.py#L2947 [2] https://github.com/SatelliteQE/robottelo/blob/f8b6c8ad742bab67e0f75b0fa63fd4d5d5743476/tests/foreman/api/test_errata.py#L620
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