Bug #11028
closedNightly repo syncs often result in duplicate key error
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.
Updated by Dominic Cleal over 9 years ago
- Project changed from Foreman to Katello
- Category deleted (
47) - Triaged set to No
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?
Updated by Jason Frisvold over 9 years ago
I'm running Katello 2.2.1 and Foreman 1.8.2.
Updated by Erik van Pienbroek over 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
Updated by Ivan Necas over 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.
Updated by The Foreman Bot over 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 (
)
Updated by Justin Sherrill over 9 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset katello|6b2570c9ad25f74dcafcb7e17d40207a332be827.
Updated by Bryan Kearney almost 9 years ago
- Category changed from Web UI to Repositories
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
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
Updated by Justin Sherrill over 8 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|0bb2f52a0cbb98946b25fad188d0532ef1ae85ec.
Updated by The Foreman Bot 11 months ago
- Pull request https://github.com/Katello/katello/pull/10862 added
Updated by The Foreman Bot 11 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)