Closed Bug 1697650 Opened 3 years ago Closed 3 years ago

base_locale unreviewed_strings check constraint

Categories

(Webtools Graveyard :: Pontoon, defect)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1690978

People

(Reporter: callum, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0

Steps to reproduce:

Occasisionally when syncing git projects a

psycopg2.errors.CheckViolation: new row for relation "base_locale" violates check constraint "base_locale_unreviewed_strings_1033a236_check"

error gets thrown. It also occurs when approving a string translation.

I don't have exact steps to reproduce, but it seems to be that the base_locale columns aren't actually updating. the unreviewed_strings column in the DB had a value of 0, then when you try to approve an unreviewed_string [or sync the git project] the system must be taking the existing value and subtracting 1 from it, which results in a negative value that violates the check_constraint.

I'm not familiar enough with the code base to be able to determine why the unreviewed_strings value is set to zero when there are actually unreviewed strings.

Speculating, but our projects also have visibility set to Private. Could it be that the unreviewed_strings column is only being updated to non-zero values if the project is public, but the same logic isn't being used when approving a translation and when syncing?

Actual results:

An error was thrown in the logs and the action did not occur.

The exception is in the attached log file.

Expected results:

the system should have proceeded without error.

This may be related to #1690978 ?

As some background:
I work for an organisation that has recently swapped to using Fluent / FTL for our products translation system. At the current time Pontoon appears to be the only translation system that has support for FTL, and as such we've had to set up a local instance of pontoon to use for our translations.

Thanks for the report. Resolving as dupe of bug 1690978, which includes a full stack trace.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE

I stand corrected - you've also attached the full server log. Anyhow, it's the same root cause, let's track it at one place.

Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: