Bug 1326345 - duplicate key value violates unique constraint "index_operatingsystems_on_title" when syncing multiple kickstart tree repos simultaneously [NEEDINFO]
Summary: duplicate key value violates unique constraint "index_operatingsystems_on_tit...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-12 13:26 UTC by Og Maciel
Modified: 2018-11-16 07:37 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-08-02 20:58:56 UTC
Target Upstream Version:
lzap: needinfo? (mmccune)


Attachments (Terms of Use)
Error found in log (27.06 KB, text/plain)
2016-04-12 13:26 UTC, Og Maciel
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1444963 0 high CLOSED duplicate key value violates unique constraint "index_operatingsystems_on_title" when registering host to satellite 2021-07-09 17:02:24 UTC

Internal Links: 1444963

Description Og Maciel 2016-04-12 13:26:31 UTC
Created attachment 1146447 [details]
Error found in log

Description of problem:

Looks like synchronizing more than one kickstart tree repositories at the same time causes a race condition which leads to one of the tasks to show a warning in the Sync Status page. @jsherill thinks that this is related to the sync of both x86_64 and i386 kickstart tree repos and their process finishing at the same time.


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

* Satellite 6.2.0 SNAP 7.1

How reproducible:


Steps to Reproduce:

* Enabled the following repositories for synchronization (through the UI):
  * Red Hat Enterprise Linux 6 Server RPMs x86_64 6Server
  * Red Hat Enterprise Linux 6 Server RPMs i386 6Server
  * Red Hat Enterprise Linux 6 Server Kickstart x86_64 6.7
  * Red Hat Enterprise Linux 6 Server Kickstart i386 6.7
  * Red Hat Enterprise Linux 5 Server RPMs x86_64 5Server
  * Red Hat Enterprise Linux 5 Server RPMs i386 5Server
  * Red Hat Enterprise Linux 5 Server Kickstart x86_64 5.11
  * Red Hat Enterprise Linux 5 Server Kickstart i386 5.11
* Synchronized them (Sync Status page)
* Sync status page for "Red Hat Enterprise Linux 6 Server Kickstart x86_64 6.7" shows that something went wrong (yellow warning icon)
* Clicking the warning icon takes me to the task status page and the following error is shown:
    PG::Error: ERROR:  duplicate key value violates unique constraint "index_operatingsystems_on_title"
DETAIL:  Key (title)=(RedHat 6.7) already exists.
: INSERT INTO "operatingsystems" ("created_at", "major", "minor", "name", "title", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"

Actual results:


Expected results:


Additional info:

Action:

Actions::Katello::Foreman::ContentUpdate

Input:

{"environment_id"=>1,
 "content_view_id"=>1,
 "repository_id"=>31,
 "remote_user"=>"admin",
 "remote_cp_user"=>"admin",
 "locale"=>"en"}

Output:

{}

Exception:

ActiveRecord::RecordNotUnique: PG::Error: ERROR:  duplicate key value violates unique constraint "index_operatingsystems_on_title"
DETAIL:  Key (title)=(RedHat 6.7) already exists.
: INSERT INTO "operatingsystems" ("created_at", "major", "minor", "name", "title", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"

Comment 1 Og Maciel 2016-04-12 13:29:16 UTC
Re-triggering the sync for the failed repository finished successfully.

Comment 5 Bryan Kearney 2018-08-02 20:58:56 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the forseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.


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