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

Fix local file creation when checking for an already synced file on the HDD

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.2.0
    • Fix Version/s: 4.3.0
    • Component/s: Synchronizer

      Description

      Error

      Sentry Issue: NUXEO-DRIVE-2AP

      IsADirectoryError: [Errno 21] Is a directory: '/home/USER/Nuxeo Drive'
        File "nxdrive/engine/processor.py", line 270, in _execute
        File "nxdrive/engine/processor.py", line 1053, in _synchronize_remotely_modified
        File "nxdrive/engine/processor.py", line 1012, in _update_remotely
        File "nxdrive/engine/processor.py", line 985, in _download_content
        File "shutil.py", line 248, in copy
        File "shutil.py", line 120, in copyfile
      

      Analysis

      When downloading a file, we first check for a "duplicate" one on the HDD, e.g. a file synced, in another location, with the same digest of the one we want to download. This is an interesting improvement to prevent useless multiple downloads of the same binary file.

      The line is https://github.com/nuxeo/nuxeo-drive/blob/release-4.2.0/nxdrive/engine/processor.py#L978.
      It is calling get_valid_duplicate_file() that checks for the remote digest, as seen here: https://github.com/nuxeo/nuxeo-drive/blob/release-4.2.0/nxdrive/engine/dao/sqlite.py#L1137.

      In the Sentry event, the found doc pair seems in a weird state, its local_path is set to /, and so it is converted to the local sync folder root.

      Fix

      Instead of just checking for the same remote digest, we should check for the same local digest too to better ensure the file is synced.

        Attachments

          Activity

            People

            • Assignee:
              mschoentgen Mickaël Schoentgen
              Reporter:
              mschoentgen Mickaël Schoentgen
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 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 - 1 hour, 15 minutes
                1h 15m