Bug 1306411 - upload doesn't upload rpm to a custom repo but reports success
Summary: upload doesn't upload rpm to a custom repo but reports success
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: Tools
Version: 3.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Patrick Creech
QA Contact: Irina Gulina
URL:
Whiteboard:
Depends On:
Blocks: 1198817
TreeView+ depends on / blocked
 
Reported: 2016-02-10 18:41 UTC by Irina Gulina
Modified: 2017-03-01 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-01 22:11:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0367 0 normal SHIPPED_LIVE Red Hat Update Infrastructure 3.0 Release 2017-03-02 03:05:22 UTC

Description Irina Gulina 2016-02-10 18:41:27 UTC
Description of problem:
upload doesn't upload rpm to a custom repo but reports success


Version-Release number of selected component (if applicable):
>> rpm -qa "*rhui*"
rh-amazon-rhui-client-rhs30-2.2.124-1.el7.noarch
rhui-installer-base-0.0.24-1.el7ui.noarch
rh-rhui-tools-libs-pre.3.0.16-1.el7ui.noarch
rhui-installer-0.0.24-1.el7ui.noarch
rh-rhui-tools-pre.3.0.16-1.el7ui.noarch
rhui-default-ca-1.0-1.noarch
rh-amazon-rhui-client-2.2.118-1.el7.noarch

>> rpm -qa "*pulp*"
python-pulp-client-lib-2.7.0-0.5.beta.el7ui.noarch
pulp-rpm-plugins-2.7.0-0.5.beta.el7ui.noarch
python-pulp-common-2.7.0-0.5.beta.el7ui.noarch
python-pulp-docker-common-1.0.2-1.el7ui.noarch
pulp-selinux-2.7.0-0.5.beta.el7ui.noarch
pulp-admin-client-2.7.0-0.5.beta.el7ui.noarch
python-pulp-rpm-common-2.7.0-0.5.beta.el7ui.noarch
pulp-server-2.7.0-0.5.beta.el7ui.noarch
python-pulp-oid_validation-2.7.0-0.5.beta.el7ui.noarch
python-pulp-ostree-common-1.0.0-0.3.beta.el7ui.noarch
pulp-ostree-plugins-1.0.0-0.3.beta.el7ui.noarch
pulp-rpm-admin-extensions-2.7.0-0.5.beta.el7ui.noarch
python-pulp-repoauth-2.7.0-0.5.beta.el7ui.noarch
pulp-docker-plugins-1.0.2-1.el7ui.noarch
python-pulp-bindings-2.7.0-0.5.beta.el7ui.noarch

RHUI iso 20151013

How reproducible:
always

Steps to Reproduce:
1. Mind if BZ1306404 is fixed, otherwise set SELinux to the permissive mode
2. Try to upload rpm to a custom repo

------------------------------------------------------------------------------
rhui (repo) => u   

Select the repositories to upload the package into:
  -  1 : custom-i386-x86_64
  -  2 : custom-x86_64-x86_64
  -  3 : custom-i386-i386
  -  4 : repo1
Enter value (1-4) to toggle selection, 'c' to confirm selections, or '?' for more commands: 4

Select the repositories to upload the package into:
  -  1 : custom-i386-x86_64
  -  2 : custom-x86_64-x86_64
  -  3 : custom-i386-i386
  x  4 : repo1
Enter value (1-4) to toggle selection, 'c' to confirm selections, or '?' for more commands: c


Enter the location of the packages to upload. If the location is an RPM,
the file will be uploaded. If the location is a directory, all RPMs in that
directory will be uploaded:
/tmp/zsh-5.1.1-4.fc23.x86_64.rpm                   

The following RPMs will be uploaded:
  zsh-5.1.1-4.fc23.x86_64.rpm
Proceed? (y/n) y


Uploading /tmp/zsh-5.1.1-4.fc23.x86_64.rpm to server...
Associating /tmp/zsh-5.1.1-4.fc23.x86_64.rpm has been queued, task will run at the next available time slot.

3. The previous step reports success. Now display detailed information on this repo:

rhui (repo) => i

Select one or more repositories:

  Custom Repositories
    -  1 : custom-i386-i386
    -  2 : custom-i386-x86_64
    -  3 : custom-x86_64-x86_64
    -  4 : repo1

  Red Hat Repositories

Enter value (1-4) to toggle selection, 'c' to confirm selections, or '?' for more commands: 4

Select one or more repositories:

  Custom Repositories
    -  1 : custom-i386-i386
    -  2 : custom-i386-x86_64
    -  3 : custom-x86_64-x86_64
    x  4 : repo1

  Red Hat Repositories

Enter value (1-4) to toggle selection, 'c' to confirm selections, or '?' for more commands: c


Name:                repo1
Type:                Custom
Relative Path:       repo1
GPG Check:           Yes
Custom GPG Keys:     (None)
Red Hat GPG Key:     Yes
Package Count:       0

4. In the previous step Package Cound is '0'. Check this repo in pulp-admin and observe that rpm wasn't upload. 

>> pulp-admin -u admin -p admin rpm repo list --repo-id repo1
+----------------------------------------------------------------------+
                            RPM Repositories
+----------------------------------------------------------------------+

Id:                   repo1
Display Name:         repo1
Description:          repo1
Content Unit Counts:  

5. Try to upload in through pulp-admin: 

>> pulp-admin -u admin -p admin rpm repo uploads rpm --repo-id repo1 --file /tmp/zsh-5.1.1-4.fc23.x86_64.rpm
+----------------------------------------------------------------------+
                              Unit Upload
+----------------------------------------------------------------------+

Extracting necessary metadata for each request...
[==================================================] 100%
Analyzing: zsh-5.1.1-4.fc23.x86_64.rpm
... completed

Creating upload requests on the server...
[==================================================] 100%
Initializing: zsh-5.1.1-4.fc23.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
canceled entirely using the cancel command.

Uploading: zsh-5.1.1-4.fc23.x86_64.rpm
[==================================================] 100%
2745706/2745706 bytes
... completed

Importing into the repository...
This command may be exited via ctrl+c without affecting the request.


[\]
Running...

Task Succeeded


Deleting the upload request...
... completed

>> pulp-admin -u admin -p admin rpm repo list --repo-id repo1+----------------------------------------------------------------------+
                            RPM Repositories
+----------------------------------------------------------------------+

Id:                   repo1
Display Name:         repo1
Description:          repo1
Content Unit Counts:  
  Rpm: 1

6. Return back to rhui-manager and check 'Package counter' for the repo

rhui (repo) => i


Select one or more repositories:

  Custom Repositories
    -  1 : custom-i386-i386
    -  2 : custom-i386-x86_64
    -  3 : custom-x86_64-x86_64
    -  4 : repo1

  Red Hat Repositories

Enter value (1-4) to toggle selection, 'c' to confirm selections, or '?' for more commands: Enter value (1-4) to toggle selection, 'c' to confirm selections, or '?' for more commands: 4

Select one or more repositories:

  Custom Repositories
    -  1 : custom-i386-i386
    -  2 : custom-i386-x86_64
    -  3 : custom-x86_64-x86_64
    x  4 : repo1

  Red Hat Repositories

Enter value (1-4) to toggle selection, 'c' to confirm selections, or '?' for more commands: c


Name:                repo1
Type:                Custom
Relative Path:       repo1
GPG Check:           Yes
Custom GPG Keys:     (None)
Red Hat GPG Key:     Yes
Package Count:       1

rhui-manager reports the package is there.

Conclusion: 
Upload doesn't upload rpm to a custom repo but reports success.  

Expected results:
Successful upload

Comment 3 Irina Gulina 2016-07-20 17:07:20 UTC
On RHEL6 iso 20160719
>> etenforce
Permissive

>> rhui (repo) => l

Custom Repositories
  protected_repo
  unprotected_repo

>> rhui (repo) => u

Select the repositories to upload the package into:
  -  1 : protected_repo
  -  2 : unprotected_repo
Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: 1-2

Select the repositories to upload the package into:
  x  1 : protected_repo
  x  2 : unprotected_repo
Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: c


Enter the location of the packages to upload. If the location is an RPM,
the file will be uploaded. If the location is a directory, all RPMs in that
directory will be uploaded:
/tmp

The following RPMs will be uploaded:
  rh-amazon-rhui-client-rhs30-2.2.130-1.el6.noarch.rpm
Proceed? (y/n) y


Uploading /tmp/rh-amazon-rhui-client-rhs30-2.2.130-1.el6.noarch.rpm to server...
Associating /tmp/rh-amazon-rhui-client-rhs30-2.2.130-1.el6.noarch.rpm has been queued, task will run at the next available time slot.

------------------------------------------------------------------------------
rhui (repo) => i

Select one or more repositories:

  Custom Repositories
    -  1 : protected_repo
    -  2 : unprotected_repo

  Red Hat Repositories

Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: 1-2

Select one or more repositories:

  Custom Repositories
    x  1 : protected_repo
    x  2 : unprotected_repo

  Red Hat Repositories

Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: c


Name:                protected_repo
Type:                Custom
Relative Path:       protected_repo
GPG Check:           No
Package Count:       1

Name:                unprotected_repo
Type:                Custom
Relative Path:       unprotected_repo
GPG Check:           No
Package Count:       1


>> rhui (repo) => p

Choose a repository:
  1  - protected_repo
  2  - unprotected_repo
Enter value (1-2) or 'b' to abort: 1-2
Enter value (1-2) or 'b' to abort: 1

Enter the first few characters (case insensitive) of an RPM to filter the results
(blank line for no filter):


Only filtered results that contain less than 100 packages will have their
contents displayed. Results with more than 100 packages will display
a package count only.

Packages:
  rh-amazon-rhui-client-rhs30-2.2.130-1.el6.noarch.rpm


>> pulp-admin rpm repo list
+----------------------------------------------------------------------+
                            RPM Repositories
+----------------------------------------------------------------------+

Id:                  unprotected_repo
Display Name:        unprotected_repo
Description:         unprotected_repo
Content Unit Counts: 
  Rpm: 1

Id:                  protected_repo
Display Name:        protected_repo
Description:         protected_repo
Content Unit Counts: 
  Rpm: 1


>> ls -la /var/lib/pulp/published/yum/master/yum_distributor/protected_repo/1469033963.67/r
repodata/                                             rh-amazon-rhui-client-rhs30-2.2.130-1.el6.noarch.rpm

Comment 4 Irina Gulina 2016-07-20 17:16:16 UTC
Everything is ok on RHEL7 iso 20160719

rhui (repo) => u

Select the repositories to upload the package into:
  -  1 : protected_repo
  -  2 : unprotected_repo
Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: 1-2

Select the repositories to upload the package into:
  x  1 : protected_repo
  x  2 : unprotected_repo
Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: c


Enter the location of the packages to upload. If the location is an RPM,
the file will be uploaded. If the location is a directory, all RPMs in that
directory will be uploaded:
/tmp

The following RPMs will be uploaded:
  rh-amazon-rhui-client-rhs30-2.2.130-1.el7.noarch.rpm
Proceed? (y/n) y


Uploading /tmp/rh-amazon-rhui-client-rhs30-2.2.130-1.el7.noarch.rpm to server...
Associating /tmp/rh-amazon-rhui-client-rhs30-2.2.130-1.el7.noarch.rpm has been queued, task will run at the next available time slot.

------------------------------------------------------------------------------
rhui (repo) => l

Custom Repositories
  protected_repo
  unprotected_repo


------------------------------------------------------------------------------
rhui (repo) => i

Select one or more repositories:

  Custom Repositories
    -  1 : protected_repo
    -  2 : unprotected_repo

  Red Hat Repositories

Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: 1-2

Select one or more repositories:

  Custom Repositories
    x  1 : protected_repo
    x  2 : unprotected_repo

  Red Hat Repositories

Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: c


Name:                protected_repo
Type:                Custom
Relative Path:       protected_repo
GPG Check:           No
Package Count:       1

Name:                unprotected_repo
Type:                Custom
Relative Path:       unprotected_repo
GPG Check:           No
Package Count:       1

pulp-admin rpm repo list 
+----------------------------------------------------------------------+
                            RPM Repositories
+----------------------------------------------------------------------+

Id:                  unprotected_repo
Display Name:        unprotected_repo
Description:         unprotected_repo
Content Unit Counts: 
  Rpm: 1

Id:                  protected_repo
Display Name:        protected_repo
Description:         protected_repo
Content Unit Counts: 
  Rpm: 1

ls -la /var/lib/pulp/published/yum/master/yum_distributor/unprotected_repo/1469034838.55/rh-amazon-rhui-client-rhs30-2.2.130-1.el7.noarch.rpm 
lrwxrwxrwx. 1 apache apache 134 Jul 20 13:13 /var/lib/pulp/published/yum/master/yum_distributor/unprotected_repo/1469034838.55/rh-amazon-rhui-client-rhs30-2.2.130-1.el7.noarch.rpm -> /var/lib/pulp/content/units/rpm/b3/046639b471c16fb435ef25740ca97f33acd9f6121d0bac16c000624602d8fb/03323dcb-3f57-4adb-a3f0-1e60df39b38a

Comment 5 errata-xmlrpc 2017-03-01 22:11:36 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, 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/RHBA-2017:0367


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