Approver violates unique constraint

Bug #613821 reported by Jeroen T. Vermeulen
50
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Jeroen T. Vermeulen

Bug Description

At the moment we're seeing the approver fail because it violates the unique constraint translationimportqueueentry__entry_per_importer__unq

Traceback: http://paste.ubuntu.com/473493/

Looks like executeOptimisticApprovals is setting either entry.pofile or entry.potemplate, and this makes the row conflict with one that already exists.

Fixing this for real could be hard, but we should stop it from breaking the approver. We can do that by making executeOptimisticApprovals check for this, and skip the entry if a conflict looms. It should also log the problem so we have some "paper trail" to help us figure out problems that users might have with this.

Related branches

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Normally the entry that's in the way is already imported, or about to be, when the problem starts. If all goes well, the entry gets cleaned up 3 days later. If the problem persists for longer, the entry that is in the way may be in Failed state where it won't be cleaned up for a month.

tags: added: import-queue oops
Changed in rosetta:
status: New → Triaged
importance: Undecided → High
Changed in rosetta:
status: Triaged → In Progress
milestone: none → 10.08
Changed in rosetta:
assignee: nobody → Jeroen T. Vermeulen (jtv)
tags: added: canonical-losa-lp
tags: removed: oops
Revision history for this message
Данило Шеган (danilo) wrote :

I think I've worked around the problem for now. Helpful query:
select path, importer, distroseries, sourcepackagename, productseries, count(id)
  from translationimportqueueentry
  where status in (1,5)
  group by path, importer, distroseries, sourcepackagename, productseries
  having count(id) > 1;

That uncovered that https://translations.launchpad.net/astrid/trunk/+imports was to blame, but I am not sure how almost identical sets of files got imported. Race condition? I.e. while one was being unpacked, it was uploaded again and the checks were done at the start and then just inserted into the queue.

Revision history for this message
Dirk Stöcker (stoecker) wrote :

Maybe I can shed a little light on this. For initial import after uploading my browser told me that I uploaded an unrecognizable file format. I then retried as I though I got wrong file (seems sometimes firefox slips one line in file chooser). But I'm pretty sure I had the right TGZ file uploaded also on first try.

Maybe one part of upload processing thought file is wrong, whereas other parts proceeded correctly?

Revision history for this message
Данило Шеган (danilo) wrote :

Hi Dirk, I don't think this is directly related: blockage didn't happen because of JOSM but because of another project (well, because of a bug in LP, but triggered by "astrid" project :).

Though, the problem you seem to be having is very weird: if it ever happens again (i.e. you try uploading a file and it rejects it, and then succeeds later with the same file), please file a separate bug.

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Danilo, thanks for digging up the problem entries and landing the fix! This issue should no longer break things as of Thursday.

Revision history for this message
Данило Шеган (danilo) wrote :

Julian tells me we can QA this on dogfood.

tags: added: qa-ok
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

It works. Not sure why there was no automatic qa-needstesting tag on this bug.

Changed in rosetta:
status: In Progress → Fix Committed
Revision history for this message
Ursula Junque (ursinha) wrote : Bug fixed by a commit
tags: added: qa-needstesting
removed: qa-ok
tags: added: qa-ok
removed: qa-needstesting
Changed in rosetta:
status: Fix Committed → Fix Released
Changed in rosetta:
status: Fix Released → Fix Committed
Revision history for this message
Данило Шеган (danilo) wrote :

Please don't change status of the bugs.

Changed in rosetta:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.