Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-2625

[Direct Transfer] Prevent constraint error when pausing an Upload

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.1.4
    • Fix Version/s: 5.2.0
    • Component/s: Direct Transfer

      Description

      Sentry Issue: NUXEO-DRIVE-4XV

      UploadPaused: 100
        File "nxdrive/engine/processor.py", line 315, in _execute
        File "nxdrive/engine/processor.py", line 256, in _handle_doc_pair_dt
        File "nxdrive/engine/processor.py", line 544, in _synchronize_direct_transfer
        File "nxdrive/client/remote_client.py", line 446, in upload
        File "nxdrive/client/uploader/direct_transfer.py", line 79, in upload
        File "nxdrive/client/uploader/__init__.py", line 206, in upload_impl
        File "nxdrive/client/uploader/__init__.py", line 291, in upload_chunks
        File "nuxeo/handlers/default.py", line 229, in iter_upload
        File "nxdrive/client/remote_client.py", line 199, in transfer_end_callback
      
      IntegrityError: UNIQUE constraint failed: Uploads.doc_pair
        File "nxdrive/engine/workers.py", line 196, in run
        File "nxdrive/engine/processor.py", line 389, in _execute
        File "nxdrive/engine/dao/sqlite.py", line 2952, in set_transfer_doc
        File "nxdrive/engine/dao/sqlite.py", line 154, in execute
      
      Thread EXCEPTION
      

      The Upload.uid raised in the exception seems to not be the good one.
      A few release ago, we allowed an user to upload multiple times the same file in different DT sessions. When an Upload is Paused/Resumed, the Upload uid was fetched by path and the first occurence was returned. Thus, we tried to update the wrong upload causing this exception.

      Uploads should be fetched by doc_pair which is the only UNIQUE column in the database for Uploads.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h