Project

General

Profile

Actions

Bug #11028

closed

Nightly repo syncs often result in duplicate key error

Added by Jason Frisvold over 9 years ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Category:
Repositories
Target version:
Difficulty:
medium
Triaged:
Fixed in Releases:
Found in Releases:

Description

I have a number of repos set to sync at midnight each night. Each night, at least one repo sync seems to fail with an error similar to this :

PGError: ERROR: duplicate key value violates unique constraint "katello_system_errata_eid_sid"
: INSERT INTO katello_system_errata (erratum_id, system_id) VALUES (2647, 5)

I can correct this by just resuming the task and it finishes with no additional errors.

Actions #1

Updated by Dominic Cleal over 9 years ago

  • Project changed from Foreman to Katello
  • Category deleted (47)
  • Triaged set to No
Actions #2

Updated by Eric Helms over 9 years ago

  • Status changed from New to Need more information
  • Translation missing: en.field_release set to 31
  • Triaged changed from No to Yes

What version of Katello are you seeing this on?

Actions #3

Updated by Jason Frisvold over 9 years ago

I'm running Katello 2.2.1 and Foreman 1.8.2.

Actions #4

Updated by Erik van Pienbroek about 9 years ago

I'm affected by this bug as well. Also on Katello 2.2.1 / Foreman 1.8.2 / RHEL 7.1 and it happens during the daily sync of repositories

Actions #5

Updated by Ivan Necas about 9 years ago

I was able to reproduce the issue: seems like it happens when multiple repositories are being synchronized at the same time, so that the errata applicability import is happening for a given host multiple times at once.

After resuming the task the operation seemed to proceed successfully (no even need for skip the failing step). One possible fix would be either to:

1. make the code https://github.com/Katello/katello/blob/master/app/models/katello/glue/pulp/consumer.rb#L94 retry several times before failling, to cound on the fact that some other repo might be recalculating the applicability
2. limit the errata touched by this operation withing the Repo sync only to those affected by the repository that is just being synchronized

I belive the right answer would be the combination of these two.

Actions #6

Updated by Ivan Necas about 9 years ago

  • Bugzilla link set to 1244704
Actions #7

Updated by The Foreman Bot about 9 years ago

  • Status changed from Need more information to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/5368 added
  • Pull request deleted ()
Actions #8

Updated by Justin Sherrill about 9 years ago

  • Assignee set to Justin Sherrill
Actions #9

Updated by Justin Sherrill about 9 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #10

Updated by Bryan Kearney over 8 years ago

  • Category set to Web UI
Actions #11

Updated by Bryan Kearney over 8 years ago

  • Category changed from Web UI to Repositories
Actions #12

Updated by Justin Sherrill over 8 years ago

  • Status changed from Closed to Assigned
  • Translation missing: en.field_release changed from 31 to 86
  • Difficulty set to medium

Reopening due to reports of it still happening

Actions #13

Updated by The Foreman Bot over 8 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/5904 added
Actions #14

Updated by Justin Sherrill over 8 years ago

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

Updated by The Foreman Bot 9 months ago

  • Pull request https://github.com/Katello/katello/pull/10862 added
Actions #16

Updated by The Foreman Bot 9 months ago

  • Pull request deleted (https://github.com/Katello/katello/pull/5368, https://github.com/Katello/katello/pull/5904, https://github.com/Katello/katello/pull/10862)
Actions

Also available in: Atom PDF