Description of problem: Currently for RHEL 5 repos there is some logic in pulp that on first sync the scratchpad has some info set to indicate if the upstream repo was using sha or sha255. Then on first publish pulp looks at the scratchpad and sets the actual checksum of the repo accordingly. We would like to do an initial publish of every repo we create in katello initially so that systems that are assigned to the repo don't receive errors (404s) when attempting to do yum operations before the sync finishes. This is a problem because when we do the initial publish (prior to the sync), pulp is looking at the scratchpad, not finding a checksum and then setting the repo's checksum to the explicit default value (sha256). It would make more sense if it simply did nothing if the scratchpad wasn't there. Version-Release number of selected component (if applicable): 2.4.0-0.29 How reproducible: Always Steps to Reproduce: 1. Create a repo pointed to a rhel 5 yum repo 2. Publish the repo 3. Sync the repo 4. Publish it again Actual results: Repo is published as sha256 Expected results: Repo is published as sha
The problem is that the default checksum type is being saved on the distributor during the first publish. We should only be saving the checksum type if a value is actually specified on the repo scratchpad. This is done so that if someone queries the distributor they will understand why it published with the checksum type it did if it is not the default.
https://github.com/pulp/pulp_rpm/pull/544 This should should fix automatically setting the default checksum (sha256 currently) on repositories that don't have a checksum type explicitly set in their configuration. To verify: 1. 'pulp-admin rpm repo create --repo-id=test_repo --feed=<repo-url-that-uses-something-other-than-sha256>' 2. 'pulp-admin rpm repo publish run --repo-id=test_repo' 3. Check the repomd.xml. It should be using sha256 as the checksum type. 4. 'pulp-admin rpm repo sync run --repo-id=test_repo' 5. Check the repomd.xml. It should be using whatever the feed repo uses. In the case of rhel5, sha1.
The above PR was closed and reopened against master https://github.com/pulp/pulp_rpm/pull/546
build: 2.5.0-0.6.beta
verified [root@cloud-qe-15 ~]# rpm -qa pulp-server pulp-server-2.5.0-0.7.beta.el7.noarch [root@cloud-qe-15 ~]# [root@cloud-qe-15 ~]# pulp-admin rpm repo create --repo-id rhel5-new --feed https://cdn.redhat.com/content/dist/rhel/server/5/5Server/x86_64/os/ --feed-ca-cert CDN/cdn.redhat.com-chain.crt --feed-cert CDN/1391032266_4771.crt --feed-key CDN/1391032266_4771.key --relative-url rhel5-new Successfully created repository [rhel5-new] [root@cloud-qe-15 ~]# [root@cloud-qe-15 ~]# [root@cloud-qe-15 ~]# pulp-admin rpm repo publish run --repo-id rhel5-new +----------------------------------------------------------------------+ Publishing Repository [rhel5-new] +----------------------------------------------------------------------+ This command may be exited via ctrl+c without affecting the request. Initializing repo metadata [-] ... completed Publishing Distribution files [-] ... completed Publishing RPMs [-] ... completed Publishing Delta RPMs ... skipped Publishing Errata [-] ... completed Publishing Comps file [-] ... completed Publishing Metadata. [-] ... completed Closing repo metadata [-] ... completed Generating sqlite files ... skipped Publishing files to web [-] ... completed Writing Listings File [-] ... completed Task Succeeded [root@cloud-qe-15 ~]# cat /var/lib/pulp/published/yum/https/repos/ content/ listing released/ repos/ rhel5-new/ [root@cloud-qe-15 ~]# cat /var/lib/pulp/published/yum/https/repos/rhel5-new/repodata/repomd.xml <?xml version="1.0" encoding="UTF-8"?> <repomd xmlns="http://linux.duke.edu/metadata/repo" xmlns:rpm="http://linux.duke.edu/metadata/rpm"><revision>1412685424</revision> <data type="filelists"><location href="repodata/2434bbe508d348a2a129a8dee0dab60e9e5e50441eb7e5b6415d12afa96ba3f1-filelists.xml.gz" /><timestamp>1412685424.97</timestamp><size>145</size><checksum type="sha256">2434bbe508d348a2a129a8dee0dab60e9e5e50441eb7e5b6415d12afa96ba3f1</checksum><open-size>124</open-size><open-checksum type="sha256">e2b3c5cc76abd55189dbe9be272ecb9b3cdbce84d32c2a03aa080d0ed6f8e511</open-checksum></data> [root@cloud-qe-15 ~]# pulp-admin rpm repo sync run --repo-id rhel5-new +----------------------------------------------------------------------+ Synchronizing Repository [rhel5-new] +----------------------------------------------------------------------+ This command may be exited via ctrl+c without affecting the request. Downloading metadata... [-] ... completed Downloading repository content... [==================================================] 100% RPMs: 0/0 items Delta RPMs: 0/0 items ... completed Downloading distribution files... [==================================================] 100% Distributions: 0/0 items ... completed Importing errata... [/] ... completed Importing package groups/categories... [-] ... completed Task Succeeded Copying files [-] ... completed Initializing repo metadata [-] ... completed Publishing Distribution files [-] ... completed Publishing RPMs [==================================================] 100% 16459 of 16459 items ... completed Publishing Delta RPMs ... skipped Publishing Errata [==================================================] 100% 3001 of 3001 items ... completed Publishing Comps file [==================================================] 100% 105 of 105 items ... completed Publishing Metadata. [-] ... completed Closing repo metadata [-] ... completed Generating sqlite files ... skipped Publishing files to web [/] ... completed Writing Listings File [-] ... completed Task Succeeded [root@cloud-qe-15 ~]# cat /var/lib/pulp/published/yum/https/repos/rhel5-new/repodata/repomd.xml <?xml version="1.0" encoding="UTF-8"?> <repomd xmlns="http://linux.duke.edu/metadata/repo" xmlns:rpm="http://linux.duke.edu/metadata/rpm"><revision>1412686080</revision> <data type="filelists"><location href="repodata/778865410b58279ae11774c681c05ea98ac64268-filelists.xml.gz" /><timestamp>1412686127.18</timestamp><size>32172740</size><checksum type="sha1">778865410b58279ae11774c681c05ea98ac64268</checksum><open-size>528169651</open-size><open-checksum type="sha1">e3918fb62f77e91ee92d6e41a5741d1a76e8fc3a</open-checksum></data>
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
pulp migration seems to have re-opened this.