Bug #34635

Cannot upload a package to a repository if the same package already exists in another repository, but is not downloaded

Added by Samir Jha 4 months ago. Updated 3 months ago.

Target version:
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:


Trying to manually upload a package to a repository (using hammer or directly via API) will fail if the package being uploaded exists in any repository, but it's not downloaded yet.

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

How reproducible:

Steps to Reproduce:
1. Sync a repository with policy "on demand". For example EPEL
2. Create a custom repository (different than EPEL)
3. Manually download any package from EPEL and try to upload it to the custom repository:

  1. wget
  2. hammer repository upload-content --id 88 --path /root/0ad-0.0.22-1.el7.x86_64.rpm
    Could not upload the content:
    Task f97ecff1-9b11-4f76-97a1-0eeea168fc70: Katello::Errors::Pulp3Error: {'non_field_errors': [ErrorDetail(string='There is already a package with: arch=x86_64, checksum_type=sha256, epoch=0, name=0ad, pkgId=d7d709ff104a89b5f0de45688fdc31cef8d0ace274350b489151d035b977834c, release=1.el7, version=0.0.22.', code='invalid')]}

Actual results:
Upload fails.

Expected results:
Upload would work.

Additional info:

If the package exists and IS DOWNLOADED, the upload works just fine. It's enough to make a request to satellite so pulp will download it, and then try again:

  1. curl o /dev/null -k
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 3776k 100 3776k 0 0 5541k 0 -
    :--:-- --:--:-- --:--:-- 5537k
  2. hammer repository upload-content --id 88 --path /root/0ad-0.0.22-1.el7.x86_64.rpm
    Successfully uploaded file '0ad-0.0.22-1.el7.x86_64.rpm'

Associated revisions

Revision a3a856e8 (diff)
Added by Samir Jha 3 months ago

Fixes #34635 - Duplicate upload of package (#10025)


#1 Updated by The Foreman Bot 4 months ago

  • Status changed from New to Ready For Testing
  • Pull request added

#2 Updated by The Foreman Bot 3 months ago

  • Fixed in Releases Katello 4.5.0 added

#3 Updated by Samir Jha 3 months ago

  • Status changed from Ready For Testing to Closed

#4 Updated by Andrew Dewar 3 months ago

  • Triaged changed from No to Yes

Also available in: Atom PDF