Bug 2223567 - [Regression] PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "katello_available_module_streams_name_stream_context"
Summary: [Regression] PG::UniqueViolation: ERROR: duplicate key value violates unique ...
Keywords:
Status: NEW
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts - Content
Version: 6.13.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-18 09:42 UTC by Jan Jansky
Modified: 2023-08-14 13:49 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 2139545 0 high CLOSED Registration error: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "katello_available_modul... 2023-07-18 09:42:22 UTC
Red Hat Issue Tracker SAT-19116 0 None None None 2023-07-24 12:53:23 UTC

Description Jan Jansky 2023-07-18 09:42:23 UTC
Description of problem:
This seems to be regression of BZ 2139545.

During registration violation of unique constraint is hit as below

PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "katello_available_module_streams_name_stream_context"

It seems like previous bugzilla just removed the log from /var/log/foreman/production, but postgresql still reflects same issue as below:

2023-07-18 13:31:36 CEST ERROR:  duplicate key value violates unique constraint "katello_available_module_streams_name_stream_context"
2023-07-18 13:31:36 CEST DETAIL:  Key (name, stream, context)=(python36, 3.6, 683b2e54) already exists.
2023-07-18 13:31:36 CEST STATEMENT:  INSERT INTO "katello_available_module_streams" ("name", "stream", "context") VALUES ($1, $2, $3) RETURNING "id"
2023-07-18 13:31:36 CEST ERROR:  duplicate key value violates unique constraint "katello_available_module_streams_name_stream_context"
2023-07-18 13:31:36 CEST DETAIL:  Key (name, stream, context)=(ruby, 2.5, ad008a3a) already exists.
2023-07-18 13:31:36 CEST STATEMENT:  INSERT INTO "katello_available_module_streams" ("name", "stream", "context") VALUES ($1, $2, $3) RETURNING "id"

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

How reproducible:
Always

Steps to Reproduce:
1. re-register RHEL8 host

Actual results:
/var/log/foreman/production.log
2023-07-18T13:31:36 [I|app|9ba09d93] Processing by Katello::Api::Rhsm::CandlepinDynflowProxyController#upload_profiles as JSON
2023-07-18T13:31:36 [I|app|9ba09d93]   Parameters: {"id"=>"1b137c1f-62d0-440b-acb7-9a55c342dd45"}
2023-07-18T13:31:36 [I|app|9ba09d93] Completed 200 OK in 167ms (Views: 6.1ms | ActiveRecord: 56.7ms | Allocations: 52327)

/var/lib/pgsql/data/log/postgresql-Tue.log
2023-07-18 13:31:36 CEST ERROR:  duplicate key value violates unique constraint "katello_available_module_streams_name_stream_context"
2023-07-18 13:31:36 CEST DETAIL:  Key (name, stream, context)=(python36, 3.6, 683b2e54) already exists.
2023-07-18 13:31:36 CEST STATEMENT:  INSERT INTO "katello_available_module_streams" ("name", "stream", "context") VALUES ($1, $2, $3) RETURNING "id"
2023-07-18 13:31:36 CEST ERROR:  duplicate key value violates unique constraint "katello_available_module_streams_name_stream_context"
2023-07-18 13:31:36 CEST DETAIL:  Key (name, stream, context)=(ruby, 2.5, ad008a3a) already exists.
2023-07-18 13:31:36 CEST STATEMENT:  INSERT INTO "katello_available_module_streams" ("name", "stream", "context") VALUES ($1, $2, $3) RETURNING "id"

Expected results:
No index violation.

Additional info:
Reported by customer but also reproduced locally, i will share reproducer details.


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