Bug 654886

Summary: rhnpush does not update a package even using the --force when the package has the same name but different checksums
Product: Red Hat Satellite 5 Reporter: Marcelo Moreira de Mello <mmello>
Component: ServerAssignee: Miroslav Suchý <msuchy>
Status: CLOSED DUPLICATE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: high Docs Contact:
Priority: urgent    
Version: 540CC: cperry, jpazdziora, mmello, mmraka, msuchy, tore.lonoy, xdmoon
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-12-15 16:12:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 646488    

Description Marcelo Moreira de Mello 2010-11-18 22:55:27 UTC
Description of problem:

The rhnpush does not update a package even using the --force when the package has the same name  but different checksums

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


How reproducible:
100%

Steps to Reproduce:
1) Environment and bulting a RPM package

     $ rpm -q rhnpush
        rhnpush-5.5.4-2.el5sat
     $ rhn-schema-version 
        5.4.0.8-1.el5sat
     $ cat /etc/redhat-release 
        Red Hat Enterprise Linux Server release 5.5 (Tikanga)

We created a custom channel and built a test RPM package 

           $ wget http://download.fedora.redhat.com/pub/epel/5/SRPMS/sdparm-1.04-1.el5.src.rpm
           $ rpm -ivh sdparm-1.04-1.el5.src.rpm 
           $ rpmbuild  -ba /usr/src/redhat/SPECS/sdparm.spec 
           $ md5sum /usr/src/redhat/RPMS/i386/sdparm-1.04-1.i386.rpm
              d15a816c3df1c44398bd06e1628d58ca  /usr/src/redhat/RPMS/i386/sdparm-1.04-1.i386.rpm 

                                      ^^^^^^ this is the md5sum for the first RPM package

           $ rhnpush  -c personnal -vvv -u user -p password --server satellite-server.FQDN  /usr/src/redhat/RPMS/i386/sdparm-1.04-1.i386.rpm --nosig 
           Connecting to http://satellite-server.FQDN/APP
           url is http://satellite-server.FQDN/PACKAGE-PUSH
           Result codes: 200 OK
           Computing checksum and package info. This may take some time ...
           Package /usr/src/redhat/RPMS/i386/sdparm-1.04-1.i386.rpm Not Found on RHN Server -- Uploading
           Uploading package /usr/src/redhat/RPMS/i386/sdparm-1.04-1.i386.rpm
            Using POST request

2) Trying for the second time: 

           $ rhnpush  -c personnal -vvv -u user -p password --server satellite-server.FQDN  /usr/src/redhat/RPMS/i386/sdparm-1.04-1.i386.rpm --nosig 
             Connecting to http://satellite-server.FQDN/APP
             url is http://satellite-server.FQDN/PACKAGE-PUSH
             Result codes: 200 OK
             Computing checksum and package info. This may take some time ...
             Package /usr/src/redhat/RPMS/i386/sdparm-1.04-1.i386.rpm already exists on the RHN Server-- Skipping Upload...

3) Trying now for the third time using --force 

           $ rhnpush  -c personnal -vvv -u user -p password --server satellite-server.FQDN  /usr/src/redhat/RPMS/i386/sdparm-1.04-1.i386.rpm --nosig --force
             Connecting to http://satellite-server.FQDN/APP
             url is http://satellite-server.FQDN/PACKAGE-PUSH
             Result codes: 200 OK
             Computing checksum and package info. This may take some time ...
             Uploading package /usr/src/redhat/RPMS/i386/sdparm-1.04-1.i386.rpm
             Using POST request

########## changing ckecksum 

4) Creating a new package and adding a comment on spec

            $ vim sdparm.spec (added a comment)
            $ rpmbuild  -ba /usr/src/redhat/SPECS/sdparm.spec
            $ md5sum /usr/src/redhat/RPMS/i386/sdparm-1.04-1.i386.rpm
              bb87a5929150d6f6c129cd6104114737  /usr/src/redhat/RPMS/i386/sdparm-1.04-1.i386.rpm

                      ^^^^^^  note different checksum, but same name, version and release

5) Trying to update the package using rhnpush

	    $ rhnpush  -c personnal -vvv -u user -p password --server satellite-server.FQDN  /usr/src/redhat/RPMS/i386/sdparm-1.04-1.i386.rpm --nosig 
              Connecting to http://satellite-server.FQDN/APP
              url is http://satellite-server.FQDN/PACKAGE-PUSH
              Result codes: 200 OK
              Computing checksum and package info. This may take some time ...
              Error: Package /usr/src/redhat/RPMS/i386/sdparm-1.04-1.i386.rpm already exists on the server with a different checksum. Skipping upload to prevent overwriting existing package. (You may use rhnpush with the --force option to force this upload if the force_upload option is enabled on your server.)

6) Trying to update using the --force option (as suggested on the command line above) 

            $ rhnpush  -c personnal -vvv -u user -p password --server satellite-server.FQDN  /usr/src/redhat/RPMS/i386/sdparm-1.04-1.i386.rpm --nosig --force
              Connecting to http://satellite-server.FQDN/APP
              url is http://satellite-server.FQDN/PACKAGE-PUSH
              Result codes: 200 OK
              Computing checksum and package info. This may take some time ...
              Package checksum /usr/src/redhat/RPMS/i386/sdparm-1.04-1.i386.rpm mismatch  -- Forcing Upload
              Uploading package /usr/src/redhat/RPMS/i386/sdparm-1.04-1.i386.rpm
              Using POST request

OK.. At this time the package is suppose to be uploaded. 

7) Testing the new package upload 

	     $  wget https://satellite-server.FQDN/download/package/2316a3acd921a4ce69c63a78b3ff3a6d4c8c05f6/1290170387302/2/16024/sdparm-1.04-1.i386.rpm --no-check-certificate
	     $ md5sum sdparm-1.04-1.i386.rpm 
             d15a816c3df1c44398bd06e1628d58ca  sdparm-1.04-1.i386.rpm

			^^^^^^  the md5 are kept from the first package updated

So, this test shows that even using the --force option on rhnpush, the package is not updated. 

  
Actual results:
Package is not updated

Expected results:
Package be updated 

Additional info:

Comment 2 Michael Mráka 2010-11-24 11:08:42 UTC
In step 6) the package has been uploaded but it ends up in 'Manage Software Packages' i.e. outside of any channel.

Comment 3 Jan Pazdziora (Red Hat) 2010-12-06 19:05:10 UTC
Isn't this a complete dupe of bug 624092?

Comment 4 Clifford Perry 2010-12-06 19:32:45 UTC
Jan - I am not sure myself. I would like ideally the same developer to look at both to make that determination. Same bug, different ways of looking at it (maybe more information for testing for QA). 

If it is a dupe and can be still fixed, I'm OK with that :)

Cliff

Comment 5 Miroslav Suchý 2010-12-09 12:48:53 UTC
Taking from Michael.

Comment 6 Miroslav Suchý 2010-12-15 16:12:00 UTC

*** This bug has been marked as a duplicate of bug 624092 ***