Bug 1850914

Summary: Checksum type "sha256" is not available for all units in the repository. Make sure those units have been downloaded
Product: Red Hat Satellite Reporter: Hao Chang Yu <hyu>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Tasos Papaioannou <tpapaioa>
Severity: high Docs Contact:
Priority: high    
Version: 6.7.0CC: bmbouter, dkliban, ehelms, fperalta, ggainey, iballou, ipanova, jbhatia, kagarwal, kkinge, ktordeur, ltran, mawerner, mjia, pcreech, rbertolj, rchan, tpapaioa, ttereshc, turan.yildirim
Target Milestone: 6.8.0Keywords: Reproducer, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pulp-rpm-2.21.3-1, rubygem-katello-3.16.0-0.16.rc4.1 Doc Type: Known Issue
Doc Text:
Checksum type "sha256" is not available for all units in the repository. Make sure those units have been downloaded.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-27 13:03:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Hao Chang Yu 2020-06-25 07:33:18 UTC
Description of problem:
Below is the steps that how the error will happen:

1) There is a sha1 srpm in downstream Pulp repo 'A' which was previously synced.
2) Upstream repo 'A' deleted the srpm and switched to sha256 metadata
3) Downstream pulp (still in sha1) sync with upstream pulp and fail with:
-------------------------
Checksum type "sha256" is not available for all units in the repository. Make sure those units have been downloaded
-------------------------

It is because there is a bug in Pulp that never delete the srpm. The srpm already deleted in the upstream pulp so downstream pulp is not able to determine the sha256 of the srpm which causes the error.


Steps to Reproduce:
1. Create a "sha1" local repository with 1 rpm and 1 srpm in /var/www/html/pub/my_local_repo

createrepo -s sha1 /var/www/html/pub/my_local_repo

2. Create a repo from the satellite web UI to sync the local repo. 
3. Sync the repo and wait until it is succeeded.
4. Remove the the "repodata" and the srpm in /var/www/html/pub/my_local_repo
5. Recreate a sha256 repo

createrepo /var/www/html/pub/my_local_repo

6. Sync the repo again and get the following error.


Actual results:
Checksum type "sha256" is not available for all units in the repository. Make sure those units have been downloaded

Expected results:
Remove missing should remove srpm too.

Comment 2 pulp-infra@redhat.com 2020-06-25 13:03:25 UTC
The Pulp upstream bug status is at NEW. Updating the external tracker on this bug.

Comment 3 pulp-infra@redhat.com 2020-06-25 13:03:27 UTC
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.

Comment 4 pulp-infra@redhat.com 2020-06-29 12:04:28 UTC
The Pulp upstream bug status is at POST. Updating the external tracker on this bug.

Comment 6 pulp-infra@redhat.com 2020-07-06 22:03:55 UTC
The Pulp upstream bug status is at MODIFIED. Updating the external tracker on this bug.

Comment 7 Bryan Kearney 2020-07-09 16:03:58 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/30235 has been resolved.

Comment 8 pulp-infra@redhat.com 2020-07-14 11:04:05 UTC
The Pulp upstream bug status is at CLOSED - CURRENTRELEASE. Updating the external tracker on this bug.

Comment 9 Tasos Papaioannou 2020-09-29 20:03:57 UTC
Verified on 6.8.0_17.0.

Comment 12 errata-xmlrpc 2020-10-27 13:03:32 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 (Important: Satellite 6.8 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-2020:4366