Bug 2060328

Summary: Uploading to a custom repo a package that is present in Satellite raises pulp-3 exception
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Lai <ltran>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.10.3CC: dalley, dkliban, jpasqual
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-09-23 20:34:43 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 Pavel Moravec 2022-03-03 10:49:28 UTC
Description of problem:
Having an on demand repo with not-yet-downloaded package, and attempting to upload the *same* package manually to some custom repo, that upload task fails in dynflow step:

Actions::Pulp3::Repository::SaveArtifact

with error:

{'non_field_errors': [ErrorDetail(string='There is already a package with: arch=noarch, checksum_type=sha256, epoch=0, name=penguin, pkgId=57d314cc6f5322484cdcd33f4173374de95c53034de5b1168b9291ca0ad06dec, release=1, version=0.9.1.', code='invalid')]}{'non_field_errors': [ErrorDetail(string='There is already a package with: arch=noarch, checksum_type=sha256, epoch=0, name=pike, pkgId=d18c68073ece073dc3ece72b7fa2011c180599e9698e456243c4faf9a8b9124a, release=1, version=2.2.', code='invalid')]}


Version-Release number of selected component (if applicable):
Sat 6.10.2
python3-pulpcore-3.14.9-1.el7pc.noarch
tfm-rubygem-katello-4.1.1.42-1.el7sat.noarch


How reproducible:
100%


Steps to Reproduce:
Very tiny reproducer:

wget https://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/test_simple_errata/test-package-0.1-1.el6.noarch.rpm -O /tmp/test-package-0.1-1.el6.noarch.rpm

(
echo "product create --name product_repo_upload_bug --organization-id 1"
echo "repository create --name repo_synced --url https://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/test_simple_errata/ --organization-id 1 --product product_repo_upload_bug --download-policy on_demand --content-type yum"
echo "repository synchronize --name repo_synced --organization-id 1 --product product_repo_upload_bug"
echo "repository create --name repo_upload --organization-id 1 --product product_repo_upload_bug --content-type yum"
echo "repository upload-content --path /tmp/test-package-0.1-1.el6.noarch.rpm --name repo_upload --content-type rpm --product product_repo_upload_bug --organization-id 1"
) | hammer -u admin -p redhat shell


Actual results:
the repository upload-content fails with:

Could not upload the content:
  Task ef2c7834-1522-4e8e-a410-a1e55240d4e2: Katello::Errors::Pulp3Error: {'non_field_errors': [ErrorDetail(string='There is already a package with: arch=noarch, checksum_type=sha256, epoch=0, name=test-package, pkgId=51ec9c4d020ef029bd87ef2612647fe77a186b3ae81c27d15c2e1d6dc07657b4, release=1.el6, version=0.1.', code='invalid')]}

Further error: the task is in running/error state, which cant be easily resumed.


Expected results:
Upload succeeds.


Additional info:

Comment 3 Daniel Alley 2022-06-07 23:25:25 UTC
^

Comment 5 Pavel Moravec 2022-09-23 20:34:43 UTC
Ah right, it is the same bug, sorry for not responding sooner.

Closing this as dup of the other (despite my bug is a few hours older :-P :) )

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

Comment 6 Red Hat Bugzilla 2023-09-18 04:32:59 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days