Project

General

Profile

Actions

Bug #37137

closed

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

Added by Jeremy Lenz 5 months ago. Updated 3 months ago.

Status:
Closed
Priority:
High
Assignee:
Category:
Hosts
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=2223567

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"

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.

Actions #1

Updated by The Foreman Bot 5 months ago

  • Status changed from New to Ready For Testing
  • Assignee set to Jeremy Lenz
  • Pull request https://github.com/Katello/katello/pull/10878 added
Actions #2

Updated by Chris Roberts 4 months ago

  • Subject changed from Postgresql logs contain PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "katello_available_module_streams_name_stream_context" to Postgresql logs contain PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "katello_available_module_streams_name_stream_context"
  • Target version set to Katello 4.12.0
  • Triaged changed from No to Yes
Actions #3

Updated by The Foreman Bot 4 months ago

  • Fixed in Releases Katello 4.13.0 added
Actions #4

Updated by Jeremy Lenz 4 months ago

  • Status changed from Ready For Testing to Closed
Actions #5

Updated by The Foreman Bot 4 months ago

  • Pull request https://github.com/Katello/katello/pull/10896 added
Actions #6

Updated by Samir Jha 3 months ago

  • Pull request deleted (https://github.com/Katello/katello/pull/10896)
Actions #7

Updated by The Foreman Bot 3 months ago

  • Fixed in Releases Katello 4.12.0 added
Actions #8

Updated by The Foreman Bot 3 months ago

  • Pull request https://github.com/Katello/katello/pull/10918 added
Actions #9

Updated by The Foreman Bot 3 months ago

  • Pull request deleted (https://github.com/Katello/katello/pull/10878, https://github.com/Katello/katello/pull/10918)
Actions

Also available in: Atom PDF