Export request form should check for uniqueness of entry

Bug #1558 reported by SVAKSHA
16
Affects Status Importance Assigned to Milestone
Launchpad itself
Invalid
High
Unassigned

Bug Description

The form at:
https://launchpad.net/distros/ubuntu/dapper/+source/gaim/+pots/gaim/bn/+export

is triggering an DB constraint, we should add a check in the Web UI.

OOPS-110D848

Revision history for this message
Sasha Vinčić (sasha) wrote :

I got the same error today. After couple minutes not receiving any email with file I tried to export it again and got the error. Then I just did one translation and saved it and tried to export it and it worked.

Revision history for this message
Christian Reis (kiko) wrote : Re: [Bug 1558] system error while exporting files

What product's translations were you exporting?

Revision history for this message
Christian Reis (kiko) wrote : Re: system error while exporting files

You can reproduce this by exporting twice with a short interval of time:

    * Module canonical.launchpad.database.poexportrequest, line 43, in _addRequestEntry
      format=format)
    * Module sqlobject.main, line 912, in __init__
      self._create(id, **kw)
    * Module sqlobject.main, line 945, in _create
      self._SO_finishCreate(id)
    * Module sqlobject.main, line 969, in _SO_finishCreate
      id, names, values)
    * Module sqlobject.dbconnection, line 624, in queryInsertID
      return self._dbConnection._queryInsertID(
    * Module sqlobject.postgres.pgconnection, line 93, in _queryInsertID
      c.execute(q)
    * Module zope.app.rdb, line 283, in execute
      return self.cursor.execute(operation)

IntegrityError: ERROR: duplicate key violates unique constraint "poexportrequest_duplicate_key" INSERT INTO POExportRequest (id, person, pofile, potemplate, format) VALUES (2838, 1387, 58442, 2614, 1)

Changed in launchpad:
status: New → Rejected
Revision history for this message
John Steele Scott (t-tec) (john-t-tec-deactivatedaccount) wrote :
Changed in rosetta:
status: New → Accepted
Revision history for this message
Dafydd Harries (daf) wrote :

We should add a check before trying to add a duplicate request. If the check fails, we should generate an error page that explains the problem.

Steve reproduced this as today's OOPS-B260.

Revision history for this message
Dafydd Harries (daf) wrote :

It occurred to me that this problem might happen if somebody requests a single file and then later requests a tarball which also contains that file while that file is still in the export queue. The reverse situation (tar file, then single file) would also cause the error.

After discussing this with Steve, we decided that the correct thing to do is to remove the database constraint and allow people to request the same file as many times as they want. This creates a new corner case where the code will try to create a tar file with the same file twice. In order to avoid this, a set() of files should be created before deciding whether to create a tar file or not. If there is more than one file in the set, a tar file should be created; otherwise only a single file need be exported.

Revision history for this message
Carlos Perelló Marín (carlos) wrote :

Why don't just check if that entry already exists in our database?

description: updated
Changed in rosetta:
assignee: nobody → carlos
Changed in rosetta:
assignee: carlos → matsubara
importance: Medium → High
Christian Reis (kiko)
Changed in rosetta:
assignee: matsubara → danilo
Revision history for this message
Diogo Matsubara (matsubara) wrote :

Danilo here's the pagetest conversion for the +export page.
https://sodium.ubuntu.com/~andrew/paste/filemooHje.html

Revision history for this message
Christian Reis (kiko) wrote :

Bumping up given Stuart's comment.

Changed in rosetta:
importance: High → Critical
Changed in rosetta:
assignee: danilo → matsubara
Revision history for this message
Christian Reis (kiko) wrote :

Blocked on bug 61757.

Revision history for this message
Diogo Matsubara (matsubara) wrote :

Lowering priority because the fix was committed in rev 70 of our SQLObject tree. Only missing tests which are up for review.

Changed in rosetta:
status: Confirmed → In Progress
importance: Critical → Medium
Changed in rosetta:
status: In Progress → Fix Committed
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