Closed mathjazz closed 3 years ago
Comment Author: @flodolo
Looks like we're hitting this bug again, with sync stuck for Firefox.
May 23 13:35:47 mozilla-pontoon app/worker.1 psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "entity_locale_active"
May 23 13:35:47 mozilla-pontoon app/worker.1 DETAIL: Key (entity_id, locale_id, active)=(69308, 317, t) already exists.
Comment Author: @flodolo
It doesn't look like the string wasn't touched in the past 4 years https://pontoon.mozilla.org/ia/firefox/dom/chrome/accessibility/AccessFu.properties/?search=toolbar&string=69308
It's worth noting that this happened twice so far, and always with Interlingua (locale id 317). We had issues with Interlingua a while ago, when we migrated from BitBucket to hg.m.o, so maybe we're still seeing issues caused by that https://bugzilla.mozilla.org/show_bug.cgi?id=1409962
Comment Author: @mathjazz
There were dozens of duplicate translations in the ia Firefox localization, which I've identified with the help of the code below and removed.
translations = Translation.objects.filter(
entity__resource__project__slug="firefox",
locale__code="ia",
)
unique_entity_string_combination = (
translations
.values("entity", "string")
.annotate(count=Count('entity'))
)
for t in unique_entity_string:
# duplicate translations
if t["count"] > 1:
print(t)
Comment Author: @mathjazz
Let's keep the bug open to investigate if we have further cases of duplicate translations, where do they originate from and how do we prevent sync from crashing.
This issue was created automatically with bugzilla2github.
Bug 1703666
Bug Reporter: @mathjazz CC: @flodolo
An IntegrityError can appear during sync, which prevents the sync job to complete.
The only way to resolve the issue it to manually remove the conflicting active translation from Pontoon (by either deleting, rejecting or unapproving it).