Bug 2119120 - ACS create fails when same name used with "PG::UniqueViolation: ERROR: duplicate key value violates unique constraint"
Summary: ACS create fails when same name used with "PG::UniqueViolation: ERROR: dupli...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Alternate Content Sources
Version: 6.12.0
Hardware: All
OS: All
unspecified
high
Target Milestone: 6.12.0
Assignee: Samir Jha
QA Contact: Gaurav Talreja
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-17 15:16 UTC by Gaurav Talreja
Modified: 2023-09-18 04:44 UTC (History)
4 users (show)

Fixed In Version: tfm-rubygem-katello-4.5.0.14-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-16 13:35:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 35482 0 Normal New ACS create fails when same name used with "PG::UniqueViolation: ERROR: duplicate key value violates unique constraint" 2022-09-02 16:16:15 UTC
Red Hat Issue Tracker SAT-12288 0 None None None 2022-08-18 14:23:26 UTC
Red Hat Issue Tracker SAT-12500 0 None None None 2022-09-02 16:29:13 UTC
Red Hat Product Errata RHSA-2022:8506 0 None None None 2022-11-16 13:35:31 UTC

Description Gaurav Talreja 2022-08-17 15:16:09 UTC
Description of problem:


Version-Release number of selected component (if applicable):
Satellite 6.12.0 Snap 6.1

How reproducible:
Always

Steps to Reproduce:
1. Enable ACS lab feature
2. # hammer alternate-content-source create --name test_repo_acs --base-url http://reposerver.example.com:33333/ --subpaths fake_yum0/ --smart-proxy-ids 1
Alternate Content Source created.

3. # hammer alternate-content-source create --name test_repo_acs --base-url http://reposerver.example.com:33333/ --subpaths fake_yum0/
Could not create the Alternate Content Source.:
  PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_katello_alternate_content_sources_on_name"
  DETAIL:  Key (name)=(test_repo_acs) already exists.

Actual results:


Expected results:


Additional info:

Comment 1 Ian Ballou 2022-08-17 16:01:42 UTC
This is likely fixed upstream in code that won't be back-portable to 6.12

Comment 2 Ian Ballou 2022-08-17 17:49:56 UTC
Never mind, it's the same in upstream!

Comment 3 Samir Jha 2022-09-02 16:16:14 UTC
Created redmine issue https://projects.theforeman.org/issues/35482 from this bug

Comment 4 Bryan Kearney 2022-09-06 16:04:59 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35482 has been resolved.

Comment 7 Gaurav Talreja 2022-09-23 21:57:36 UTC
Verified.

Tested on Satellite 6.12.0 Snap 12.0

Steps:
1. # hammer alternate-content-source create --name test_repo_acs --base-url http://reposerver.example.com:33333/ --subpaths fake_yum0/ --smart-proxy-ids 1

Observation:
Above command ran twice as mentioned in comment 1, and the validation included for the name says "Validation failed: Name has already been taken" and there were no DB errors returned.

Comment 11 errata-xmlrpc 2022-11-16 13:35:21 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 (Important: Satellite 6.12 Release), 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/RHSA-2022:8506

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


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