Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2042854

Summary: can't upload multiple versions of the same RPM to a repository
Product: Red Hat Satellite Reporter: Evgeni Golov <egolov>
Component: RepositoriesAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Cole Higgins <chiggins>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.11.0CC: jsherril
Target Milestone: 6.11.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-01-27 20:24:58 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 Evgeni Golov 2022-01-20 09:21:42 UTC
Description of problem:
When uploading multiple versions of the same RPM (different NEVRA) to Satellite, it seems the "latest" (as in rpm vercmp latest) one wins, and the others are silently discarded.


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

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
this is a regression compared to Satellite 6.8 (I've not yet checked 6.9 and 6.10, but would guess the real regression is in 6.10, with the Pulp3 switch)

Comment 1 Evgeni Golov 2022-01-20 12:43:08 UTC
so this might actually be slightly different… and it just rejects *any* new upload?

my PostgreSQL logs are full of blocks like this:

2022-01-20 12:38:59 UTC ERROR:  duplicate key value violates unique constraint "core_artifact_sha256_key"
2022-01-20 12:38:59 UTC DETAIL:  Key (sha256)=(c0cace4d6bd977ad29096c46467682b30b7ef65aff60fe7f7238096f9003d898) already exists.
2022-01-20 12:38:59 UTC STATEMENT:  INSERT INTO "core_artifact" ("pulp_id", "pulp_created", "pulp_last_updated", "file", "size", "md5", "sha1", "sha224", "sha256", "sha384", "sha512", "timestamp_of_interest") VALUES ('62f8160c-f5fd-4a0e-9bc7-6187341ade93'::uuid, '2022-01-20T12:38:59.879368+00:00'::timestamptz, '2022-01-20T12:38:59.879376+00:00'::timestamptz, 'artifact/c0/cace4d6bd977ad29096c46467682b30b7ef65aff60fe7f7238096f9003d898', 71, NULL, '7deb2cfcc5d3e2fc5e5ddf6a5e95df1a63354b9b', 'fa45bc89d36cc982ae950612026ca1f876b61100fe8aa264463256b4', 'c0cace4d6bd977ad29096c46467682b30b7ef65aff60fe7f7238096f9003d898', '1fc42098d33391ad83cd44801780e213de24347e41caf96206b1f1ff4300f5c3a46fd3d6586538d6d2ed9b2d1a0a505d', '62a08c1c7e62dba69a2a2279124a478b261a0abd64a70bf1d3405e72f38d47b5fbc53537d0fe97d8c1be4231090bda46cfd632930d477192e136f8cd4b6ef296', '2022-01-20T12:38:59.879521+00:00'::timestamptz)
2022-01-20 12:39:18 UTC ERROR:  duplicate key value violates unique constraint "core_artifact_sha256_key"
2022-01-20 12:39:18 UTC DETAIL:  Key (sha256)=(5215ee998e60570498607690984b49632e048827267264f092e3dd2e5fa9ad99) already exists.
2022-01-20 12:39:18 UTC STATEMENT:  INSERT INTO "core_artifact" ("pulp_id", "pulp_created", "pulp_last_updated", "file", "size", "md5", "sha1", "sha224", "sha256", "sha384", "sha512", "timestamp_of_interest") VALUES ('ea3bc840-b702-4ea6-910c-73fe2347d8ec'::uuid, '2022-01-20T12:39:18.279785+00:00'::timestamptz, '2022-01-20T12:39:18.279798+00:00'::timestamptz, 'artifact/52/15ee998e60570498607690984b49632e048827267264f092e3dd2e5fa9ad99', 612, NULL, '7841f77f6a810972c5e724e2dd5f7e63413b80ac', '5cd996bcb83ce908469057e8db7ea2a787f92fb956e008aa4e9acf49', '5215ee998e60570498607690984b49632e048827267264f092e3dd2e5fa9ad99', 'edf369a34f9cb1e3896e55d400193f62539e62d151c4620f74a0b13635db92530ca3e0099c2d5a270ae0fe42b67dedea', '9cbc768f95781ee78f7dc45f3a0bd1df7e2a0d4ff6f9e89d5b9d30432add236abba262ee9d7520e112fb4e45ed81649a748fa3dd0deb548b907d6b587c3661d4', '2022-01-20T12:39:18.280569+00:00'::timestamptz)
2022-01-20 12:39:18 UTC ERROR:  duplicate key value violates unique constraint "core_artifact_sha256_key"
2022-01-20 12:39:18 UTC DETAIL:  Key (sha256)=(821225e30e9df13403eb9b9223e72530a3c61c129f0633da9f8b2f07b949cb0d) already exists.
2022-01-20 12:39:18 UTC STATEMENT:  INSERT INTO "core_artifact" ("pulp_id", "pulp_created", "pulp_last_updated", "file", "size", "md5", "sha1", "sha224", "sha256", "sha384", "sha512", "timestamp_of_interest") VALUES ('37327e10-9aee-4aa6-988a-973c6d7f6704'::uuid, '2022-01-20T12:39:18.285439+00:00'::timestamptz, '2022-01-20T12:39:18.285447+00:00'::timestamptz, 'artifact/82/1225e30e9df13403eb9b9223e72530a3c61c129f0633da9f8b2f07b949cb0d', 243, NULL, 'b7aa82e61b0531ed32fcf40f69ddc905f558700b', '4d2983ea7dc63ef61f97829a2dbf6bf4872176a12ebccdb790a374a1', '821225e30e9df13403eb9b9223e72530a3c61c129f0633da9f8b2f07b949cb0d', '95deb3a36462907c94364e586bc89ecfe98483cc490f51405c34ffb49e741ccf18dc20f4e25a91bf795f850271593184', '22554978e36ae00d32dd86240182e7c634ebb314882cd4539b57663b8191610f323d9ac4e05496f32e3e57eee23be6222f163d9f601e151613a7605179c58178', '2022-01-20T12:39:18.285639+00:00'::timestamptz)
2022-01-20 12:39:18 UTC ERROR:  duplicate key value violates unique constraint "core_artifact_sha256_key"
2022-01-20 12:39:18 UTC DETAIL:  Key (sha256)=(35e95f999a8ccd100a84903ac3500e5d86129a478f85d46d29495847324f15bc) already exists.
2022-01-20 12:39:18 UTC STATEMENT:  INSERT INTO "core_artifact" ("pulp_id", "pulp_created", "pulp_last_updated", "file", "size", "md5", "sha1", "sha224", "sha256", "sha384", "sha512", "timestamp_of_interest") VALUES ('318bb629-508e-48fd-8614-de80bd65752e'::uuid, '2022-01-20T12:39:18.289072+00:00'::timestamptz, '2022-01-20T12:39:18.289080+00:00'::timestamptz, 'artifact/35/e95f999a8ccd100a84903ac3500e5d86129a478f85d46d29495847324f15bc', 227, NULL, 'a11bebf8d2973f0102b140b8313d075bea46b478', '043ec1d713470bf32c52bb181e7888d755dad9d1b6944f565ba24e82', '35e95f999a8ccd100a84903ac3500e5d86129a478f85d46d29495847324f15bc', 'a756d6107745d8942475cc36cf7874644f896c0e2d81e3a25be8d25c3d2cd1e0a22234e575e2edf72a3cd735f96b265b', '392108517c412e85c0bfbf4e925a7bbc563e57797c2359d7c6bc9380e39521bfa0da85b7e1aed006720823602299446f0343d87a57464a38fae48dfcf5c4afcd', '2022-01-20T12:39:18.289257+00:00'::timestamptz)
2022-01-20 12:39:18 UTC ERROR:  duplicate key value violates unique constraint "core_artifact_sha256_key"
2022-01-20 12:39:18 UTC DETAIL:  Key (sha256)=(c0cace4d6bd977ad29096c46467682b30b7ef65aff60fe7f7238096f9003d898) already exists.
2022-01-20 12:39:18 UTC STATEMENT:  INSERT INTO "core_artifact" ("pulp_id", "pulp_created", "pulp_last_updated", "file", "size", "md5", "sha1", "sha224", "sha256", "sha384", "sha512", "timestamp_of_interest") VALUES ('a3b01188-00cf-449a-9474-c5625cfc6e0a'::uuid, '2022-01-20T12:39:18.292614+00:00'::timestamptz, '2022-01-20T12:39:18.292624+00:00'::timestamptz, 'artifact/c0/cace4d6bd977ad29096c46467682b30b7ef65aff60fe7f7238096f9003d898', 71, NULL, '7deb2cfcc5d3e2fc5e5ddf6a5e95df1a63354b9b', 'fa45bc89d36cc982ae950612026ca1f876b61100fe8aa264463256b4', 'c0cace4d6bd977ad29096c46467682b30b7ef65aff60fe7f7238096f9003d898', '1fc42098d33391ad83cd44801780e213de24347e41caf96206b1f1ff4300f5c3a46fd3d6586538d6d2ed9b2d1a0a505d', '62a08c1c7e62dba69a2a2279124a478b261a0abd64a70bf1d3405e72f38d47b5fbc53537d0fe97d8c1be4231090bda46cfd632930d477192e136f8cd4b6ef296', '2022-01-20T12:39:18.292812+00:00'::timestamptz)

when trying to upload https://fixtures.pulpproject.org/rpm-with-sha/walrus-0.71-1.noarch.rpm and https://fixtures.pulpproject.org/rpm-with-sha/walrus-5.21-1.noarch.rpm

this happens equally on satellite snaps, but also upstream katello 4.3 builds

Comment 2 Evgeni Golov 2022-01-20 13:03:33 UTC
and yes, before you ask, the upload is considered successful by Katello *and* pulp:


2022-01-20T12:39:17 [I|app|b37c05f0] Started POST "/katello/api/v2/repositories/1/upload_content" for 192.168.122.1 at 2022-01-20 12:39:17 +0000
2022-01-20T12:39:17 [I|app|b37c05f0] Processing by Katello::Api::V2::RepositoriesController#upload_content as HTML
2022-01-20T12:39:17 [I|app|b37c05f0]   Parameters: {"content"=>[#<ActionDispatch::Http::UploadedFile:0x00007f76981d2160 @tempfile=#<Tempfile:/tmp/RackMultipart20220120-37810-15yy3kb.rpm>, @original_filename="walrus-5.21-1.noarch.rpm", @content_type="application/x-rpm", @headers="Content-Disposition: form-data; name=\"content[]\"; filename=\"walrus-5.21-1.noarch.rpm\"\r\nContent-Type: application/x-rpm\r\n">], "authenticity_token"=>"6yVikjRVBh173nO2uUdCYs9RLMQkhGMhUl008qJ7PCdQjTnBFal4YE9BWjRAVRU23qfjaRAwdfYqVp0aBE5gqA==", "api_version"=>"v2", "id"=>"1"}
2022-01-20T12:39:17 [I|bac|b37c05f0] Task {label: , id: d1ad8cca-557b-4052-8d08-112504512b31, execution_plan_id: 8e55b031-2e70-48ff-91f5-43e4d48b284e} state changed: pending 
2022-01-20T12:39:17 [I|bac|b37c05f0] Task {label: Actions::Katello::Repository::UploadFiles, id: d1ad8cca-557b-4052-8d08-112504512b31, execution_plan_id: 8e55b031-2e70-48ff-91f5-43e4d48b284e} state changed: planning 
2022-01-20T12:39:17 [I|bac|b37c05f0] Task {label: Actions::Katello::Repository::UploadFiles, id: d1ad8cca-557b-4052-8d08-112504512b31, execution_plan_id: 8e55b031-2e70-48ff-91f5-43e4d48b284e} state changed: planned 
2022-01-20T12:39:17 [I|bac|b37c05f0] Task {label: Actions::Katello::Repository::UploadFiles, id: d1ad8cca-557b-4052-8d08-112504512b31, execution_plan_id: 8e55b031-2e70-48ff-91f5-43e4d48b284e} state changed: running 
2022-01-20T12:39:18 [I|aud|b37c05f0] Katello::Repository (1) update event on publication_href /pulp/api/v3/publications/rpm/rpm/76d548e9-f2a0-455f-a04f-50a4d6b02968/, /pulp/api/v3/publications/rpm/rpm/a96aa573-0040-45df-ae55-8407a0862ee1/
2022-01-20T12:39:19 [I|bac|b37c05f0] Task {label: , id: 1e7276f9-fbe3-4b80-ab61-d67b39e0430a, execution_plan_id: 9ab13d0a-bf9f-487d-90b9-a9cd29c102b6} state changed: pending 
2022-01-20T12:39:19 [I|bac|b37c05f0] Task {label: Actions::Katello::Repository::CapsuleSync, id: 1e7276f9-fbe3-4b80-ab61-d67b39e0430a, execution_plan_id: 9ab13d0a-bf9f-487d-90b9-a9cd29c102b6} state changed: planning 
2022-01-20T12:39:19 [I|bac|b37c05f0] Task {label: Actions::Katello::Repository::CapsuleSync, id: 1e7276f9-fbe3-4b80-ab61-d67b39e0430a, execution_plan_id: 9ab13d0a-bf9f-487d-90b9-a9cd29c102b6} state changed: planned 
2022-01-20T12:39:19 [I|bac|b37c05f0] Task {label: Actions::Katello::Repository::CapsuleSync, id: 1e7276f9-fbe3-4b80-ab61-d67b39e0430a, execution_plan_id: 9ab13d0a-bf9f-487d-90b9-a9cd29c102b6} state changed: running 
2022-01-20T12:39:19 [I|bac|b37c05f0] Task {label: Actions::Katello::Repository::CapsuleSync, id: 1e7276f9-fbe3-4b80-ab61-d67b39e0430a, execution_plan_id: 9ab13d0a-bf9f-487d-90b9-a9cd29c102b6} state changed: stopped  result: success
2022-01-20T12:39:19 [I|bac|b37c05f0] Task {label: Actions::Katello::Repository::UploadFiles, id: d1ad8cca-557b-4052-8d08-112504512b31, execution_plan_id: 8e55b031-2e70-48ff-91f5-43e4d48b284e} state changed: stopped  result: success
2022-01-20T12:39:19 [I|app|b37c05f0] Completed 200 OK in 2618ms (Views: 0.2ms | ActiveRecord: 16.0ms | Allocations: 145490

Jan 20 12:39:17 centos8-stream-katello-4-3.tanso.example.com pulpcore-api[39028]: pulp [b37c05f0-bfd4-4099-8057-560aaa7020ba]:  - - [20/Jan/2022:12:39:17 +0000] "GET /pulp/api/v3/status HTTP/1.1" 301 0 "-" "rest-client/2.0.2 (linux x86_64) ruby/2.7.3p183"
Jan 20 12:39:17 centos8-stream-katello-4-3.tanso.example.com pulpcore-api[39028]: pulp [b37c05f0-bfd4-4099-8057-560aaa7020ba]:  - - [20/Jan/2022:12:39:17 +0000] "GET /pulp/api/v3/status/ HTTP/1.1" 200 1520 "-" "rest-client/2.0.2 (linux x86_64) ruby/2.7.3p183"
Jan 20 12:39:17 centos8-stream-katello-4-3.tanso.example.com pulpcore-api[39028]: pulp [b37c05f0-bfd4-4099-8057-560aaa7020ba]:  - - [20/Jan/2022:12:39:17 +0000] "GET /pulp/api/v3/content/rpm/packages/ HTTP/1.1" 200 1643 "-" "OpenAPI-Generator/3.16.1/ruby"
Jan 20 12:39:17 centos8-stream-katello-4-3.tanso.example.com pulpcore-api[39028]: pulp [b37c05f0-bfd4-4099-8057-560aaa7020ba]:  - - [20/Jan/2022:12:39:17 +0000] "POST /pulp/api/v3/repositories/rpm/rpm/bcbb5a2f-66ac-4b79-aeb0-8af31f95658a/modify/ HTTP/1.1" 202 67 "-" "OpenAPI-Generator/3.16.1/ruby"
Jan 20 12:39:17 centos8-stream-katello-4-3.tanso.example.com pulpcore-api[39028]: pulp [b37c05f0-bfd4-4099-8057-560aaa7020ba]:  - - [20/Jan/2022:12:39:17 +0000] "GET /pulp/api/v3/tasks/19958caa-3891-4ba8-85f6-a5122d075890/ HTTP/1.1" 200 594 "-" "OpenAPI-Generator/3.16.0/ruby"
Jan 20 12:39:18 centos8-stream-katello-4-3.tanso.example.com pulpcore-api[39028]: pulp [b37c05f0-bfd4-4099-8057-560aaa7020ba]:  - - [20/Jan/2022:12:39:18 +0000] "GET /pulp/api/v3/tasks/19958caa-3891-4ba8-85f6-a5122d075890/ HTTP/1.1" 200 617 "-" "OpenAPI-Generator/3.16.0/ruby"
Jan 20 12:39:18 centos8-stream-katello-4-3.tanso.example.com pulpcore-api[39028]: pulp [b37c05f0-bfd4-4099-8057-560aaa7020ba]:  - - [20/Jan/2022:12:39:18 +0000] "GET /pulp/api/v3/content/rpm/packages/293e7351-d635-4a69-a572-26099dda850b/ HTTP/1.1" 200 1591 "-" "OpenAPI-Generator/3.16.1/ruby"
Jan 20 12:39:18 centos8-stream-katello-4-3.tanso.example.com pulpcore-api[39028]: pulp [b37c05f0-bfd4-4099-8057-560aaa7020ba]:  - - [20/Jan/2022:12:39:18 +0000] "POST /pulp/api/v3/publications/rpm/rpm/ HTTP/1.1" 202 67 "-" "OpenAPI-Generator/3.16.1/ruby"
Jan 20 12:39:18 centos8-stream-katello-4-3.tanso.example.com pulpcore-api[39028]: pulp [b37c05f0-bfd4-4099-8057-560aaa7020ba]:  - - [20/Jan/2022:12:39:18 +0000] "GET /pulp/api/v3/tasks/fb025092-ea81-441e-838a-9e73387740e3/ HTTP/1.1" 200 590 "-" "OpenAPI-Generator/3.16.0/ruby"
Jan 20 12:39:18 centos8-stream-katello-4-3.tanso.example.com pulpcore-api[39028]: pulp [b37c05f0-bfd4-4099-8057-560aaa7020ba]:  - - [20/Jan/2022:12:39:18 +0000] "GET /pulp/api/v3/tasks/fb025092-ea81-441e-838a-9e73387740e3/ HTTP/1.1" 200 824 "-" "OpenAPI-Generator/3.16.0/ruby"
Jan 20 12:39:18 centos8-stream-katello-4-3.tanso.example.com pulpcore-api[39028]: pulp [b37c05f0-bfd4-4099-8057-560aaa7020ba]:  - - [20/Jan/2022:12:39:18 +0000] "GET /pulp/api/v3/distributions/rpm/rpm/?base_path=Default_Organization%2FLibrary%2Fcustom%2Fasdf%2Fasdf HTTP/1.1" 200 533 "-" "OpenAPI-Generator/3.16.1/ruby"
Jan 20 12:39:18 centos8-stream-katello-4-3.tanso.example.com pulpcore-api[39028]: pulp [b37c05f0-bfd4-4099-8057-560aaa7020ba]:  - - [20/Jan/2022:12:39:18 +0000] "PATCH /pulp/api/v3/distributions/rpm/rpm/4b2d7214-f941-4677-a72f-97f6d2b2738d/ HTTP/1.1" 202 67 "-" "OpenAPI-Generator/3.16.1/ruby"
Jan 20 12:39:18 centos8-stream-katello-4-3.tanso.example.com pulpcore-api[39028]: pulp [b37c05f0-bfd4-4099-8057-560aaa7020ba]:  - - [20/Jan/2022:12:39:18 +0000] "GET /pulp/api/v3/tasks/2569c98c-1aef-4d0a-82f1-c5e17a67ce00/ HTTP/1.1" 200 535 "-" "OpenAPI-Generator/3.16.0/ruby"
Jan 20 12:39:19 centos8-stream-katello-4-3.tanso.example.com pulpcore-api[39028]: pulp [b37c05f0-bfd4-4099-8057-560aaa7020ba]:  - - [20/Jan/2022:12:39:19 +0000] "GET /pulp/api/v3/tasks/2569c98c-1aef-4d0a-82f1-c5e17a67ce00/ HTTP/1.1" 200 562 "-" "OpenAPI-Generator/3.16.0/ruby"
Jan 20 12:39:19 centos8-stream-katello-4-3.tanso.example.com pulpcore-api[39028]: pulp [b37c05f0-bfd4-4099-8057-560aaa7020ba]:  - - [20/Jan/2022:12:39:19 +0000] "PATCH /pulp/api/v3/distributions/rpm/rpm/4b2d7214-f941-4677-a72f-97f6d2b2738d/ HTTP/1.1" 202 67 "-" "OpenAPI-Generator/3.16.1/ruby"


# hammer package list --organization "Default Organization" --product "asdf" --repository "asdf"
---|--------------------------|----------------------
ID | FILENAME                 | SOURCE RPM           
---|--------------------------|----------------------
1  | walrus-0.71-1.noarch.rpm | walrus-0.71-1.src.rpm
---|--------------------------|----------------------

Comment 3 Evgeni Golov 2022-01-27 07:23:46 UTC
This actually could be a dupe of BZ#2037508 -- will re-try once the patch lands.

Comment 4 Justin Sherrill 2022-01-27 20:24:58 UTC
ryan confirmed it is a dupe, will mark it as such for now.  Feel free to reopen if you disagree

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