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

Use a temp dir located on the same drive as the local folder in LocalClient.rename()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 4.1.2
    • Fix Version/s: 4.4.1
    • Component/s: Local client
    • Environment:
      Windows

      Description

      Error

      Sentry Issue: NUXEO-DRIVE-VC

      OSError: [WinError 17] Impossible de déplacer le fichier vers un lecteur de disque différent: '\\\\?\\D:\\Documents\\Nuxeo Drive\\foo.pdf' -> 'C:\\Users\\USER\\AppData\\Local\\Temp\\a3356e66-fa3f-4535-ad32-3ef4e9605e33'
        File "nxdrive\engine\processor.py", line 263, in _execute
        File "nxdrive\engine\processor.py", line 1093, in _synchronize_remotely_modified
        File "nxdrive\client\local_client.py", line 646, in rename
        File "pathlib.py", line 1309, in rename
        File "pathlib.py", line 393, in wrapped
      

      Analysis

      The faultive code is inside LocalClient.rename():

      # The filesystem is not sensitive, so we cannot rename
      # from "a" to "A". We need to use a temporary filename
      # inbetween, which allows us to do "a" -> <tempname> -> "A".
      temp_path = normalized_path(tempfile.gettempdir()) / str(uuid.uuid4())
      source_os_path.rename(temp_path)
      

      Here, tempfile.gettempdir() returns the value of the %TEMP% envar, which is not on the same partition as the local folder.

      Fix

      We could use the Engine.download_dir folder as it already ensures that it is on the same partition as the local folder.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 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, 45 minutes
                  2h 45m

                    PagerDuty

                    Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.