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

Fix cross-device link errors by forcing using a download folder on the same hard-drive of the sync folder

    XMLWordPrintable

    Details

      Description

      Error

      Sentry Issue: NUXEO-DRIVE-452

      OSError: [Errno 18] Cross-device link: '/Users/USER/.nuxeo-drive/.tmp/ENGINE/DOCID/file.jpg' -> '/Volumes/Data/NXD/IT/TestLocal/file.jpg'
        File "nxdrive/engine/processor.py", line 283, in _execute
        File "nxdrive/engine/processor.py", line 1325, in _synchronize_remotely_created
        File "nxdrive/engine/processor.py", line 1398, in _create_remotely
        File "nxdrive/client/local/base.py", line 506, in move
        File "nxdrive/utils.py", line 590, in safe_rename
        File "pathlib.py", line 1334, in rename
      

      Analysis

      When find_suitable_tmp_dir() does not find a suitable folder that is on the same hard-drive than the sync folder, it will fallback to the $HOME/.nuxeo-drive folder. And obviously, we will end with folders on different HD and thus the error.

      Proof:

      >>> from pathlib import Path
      >>> from nxdrive.utils import find_suitable_tmp_dir
      
      >>> # Here, sync_folder exists
      >>> sync_folder = Path("/Volumes/Nuxeo Drive/Nuxeo Drive.app/Contents")
      >>> home_folder = Path("/Users/tiger-222/.nuxeo-drive")
      >>> find_suitable_tmp_dir(sync_folder, home_folder)
      PosixPath('/Volumes/Nuxeo Drive/Nuxeo Drive.app/.nuxeo-drive')
      
      >>> # Here, sync_folder does not exist
      >>> sync_folder = Path("/Volumes/Nuxeo Drive/Nuxeo Drive.app/Contentssssssss")
      >>> find_suitable_tmp_dir(sync_folder, home_folder)
      PosixPath('/Users/tiger-222/.nuxeo-drive')
      

      Fix

      We should enforce the same hard-drive even more than what is done currently. If the sync folder does not exist, then create it and use its parent.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 25 minutes
                  25m