Bug 1004580 - checksum-type not honored on upload using pulp-admin
checksum-type not honored on upload using pulp-admin
Product: Pulp
Classification: Community
Component: user-experience (Show other bugs)
2.2 Beta
Unspecified Unspecified
medium Severity unspecified
: ---
: 2.4.0
Assigned To: Barnaby Court
Preethi Thomas
: Triaged
Depends On:
  Show dependency treegraph
Reported: 2013-09-04 21:46 EDT by Ryan Bowlby
Modified: 2014-08-09 02:56 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-08-09 02:56:03 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ryan Bowlby 2013-09-04 21:46:04 EDT
Description of problem:

Repository checksum of sha1 is not honored when uploading content via pulp-admin as well as API.

Version-Release number of selected component (if applicable):


How reproducible:

Steps to Reproduce:
1. Create repo with checksum of sha1
2. upload content
3. check primary.xml.gz 

Actual results:


Expected results:


Additional info:

sha1 hasn't been properly honored since I started with pulp in v1. I usually just modify all five sha256 entries in ./pulp_rpm/yum_plugin/metadata.py. That has not been enough in this case. I can't seem to figure what class holds the static 256 entry instead of checking the repo settings.
Comment 1 Michael Hrivnak 2013-09-05 17:51:39 EDT
I think the problem can be solved here:


by passing the checksum type as a third parameter.
Comment 2 Ryan Bowlby 2013-09-30 15:35:33 EDT
Any chance this bug can be fixed before 2.4? No one on RH5 or older can use pulp repositories till 2.4?
Comment 3 Barnaby Court 2013-11-26 16:10:20 EST
The checksum is calculated at upload time and as the checksum of the unit is independent of the checksum for a particular distributor the fix is to add a checksum-type parameter for RPM and SRPM that can be specified at upload time.  

PR: https://github.com/pulp/pulp_rpm/pull/401
Comment 4 Frank Ederveen 2014-02-17 08:02:17 EST

We are running into this same problem; i.e. when uploading files to a 'sha1' repo, the file gets a sha256 checksum in *primary.xml.gz.

Is there a workaround for those of us on 2.3.1? I wouldn't mind not using sha256 anywhere if that helps.

Does the above patch add a checksum option to 'rpm repo uploads', or does it get the desired checksum type from the --repo-id it is uploading to?

Comment 5 Frank Ederveen 2014-02-18 05:15:10 EST
A quick update: as a workaround I created a "classic" yum repository (createrepo --checksum=sha1 -d .) and set up a feed from there instead of uploading directly in to pulp. This seems to work fine for now.

Comment 6 Jeff Ortel 2014-04-03 09:35:40 EDT
build: 2.4.0-0.7.beta
Comment 7 Preethi Thomas 2014-04-15 16:27:04 EDT
[root@pulp-24-server ~]# rpm -qa pulp-server
[root@pulp-24-server ~]# 

[root@pulp-24-server ~]# pulp-admin rpm repo uploads rpm --repo-id sha -f upload/pulp-dot-2.0-test-0.1.2-1.fc11.x86_64.rpm -v --help
Command: rpm
Description: uploads one or more RPMs into a repository

Available Arguments:

  --repo-id       - (required) unique identifier; only alphanumeric, ., -, and _
  --file, -f      - full path to a file to upload; may be specified multiple
                    times for multiple files
  --dir, -d       - full path to a directory containing files to upload; may be
                    specified multiple times for multiple directories
  -v              - display extra information about the upload process
  --skip-existing - if specified, RPMs that already exist on the server will not
                    be uploaded
  --checksum-type - type of checksum to use during metadata generation

[root@pulp-24-server ~]# pulp-admin rpm repo uploads rpm --repo-id sha -f upload/pulp-dot-2.0-test-0.1.2-1.fc11.x86_64.rpm --checksum-type sha1 --skip-existing
                              Unit Upload

Extracting necessary metadata for each request...
[==================================================] 100%
Analyzing: pulp-dot-2.0-test-0.1.2-1.fc11.x86_64.rpm
... completed

Checking for existing RPMs on the server...
... completed

Creating upload requests on the server...
[==================================================] 100%
Initializing: pulp-dot-2.0-test-0.1.2-1.fc11.x86_64.rpm
... completed

Starting upload of selected units. If this process is stopped through ctrl+c,
the uploads will be paused and may be resumed later using the resume command or
cancelled entirely using the cancel command.

Uploading: pulp-dot-2.0-test-0.1.2-1.fc11.x86_64.rpm
[==================================================] 100%
2359/2359 bytes
... completed

Importing into the repository...
Import postponed due to queued operations against the repository. The progress
of this import can be viewed in the repository tasks list.
Comment 8 Randy Barlow 2014-08-09 02:56:03 EDT
This has been fixed in Pulp 2.4.0-1.

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