Bug 1004580

Summary: checksum-type not honored on upload using pulp-admin
Product: [Retired] Pulp Reporter: Ryan Bowlby <rbowlby83>
Component: user-experienceAssignee: Barnaby Court <bcourt>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 2.2 BetaCC: bcourt, frank, gassmann, mhrivnak
Target Milestone: ---Keywords: Triaged
Target Release: 2.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-09 06:56:03 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 Ryan Bowlby 2013-09-05 01:46:04 UTC
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):

2.2.0-0.25.beta.el6

How reproducible:


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

Actual results:

sha256

Expected results:

sha1

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 21:51:39 UTC
I think the problem can be solved here:

https://github.com/pulp/pulp_rpm/blob/master/plugins/pulp_rpm/plugins/importers/yum/parse/rpm.py#L39

by passing the checksum type as a third parameter.

Comment 2 Ryan Bowlby 2013-09-30 19:35:33 UTC
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 21:10:20 UTC
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 13:02:17 UTC
Hi,

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?

Thanks,
Frank

Comment 5 Frank Ederveen 2014-02-18 10:15:10 UTC
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.

Regards,
Frank

Comment 6 Jeff Ortel 2014-04-03 13:35:40 UTC
build: 2.4.0-0.7.beta

Comment 7 Preethi Thomas 2014-04-15 20:27:04 UTC
verified
[root@pulp-24-server ~]# rpm -qa pulp-server
pulp-server-2.4.0-0.9.beta.el6.noarch
[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 _
                    allowed
  --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 06:56:03 UTC
This has been fixed in Pulp 2.4.0-1.