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

Deleting a remote folder while synchronizing its children from the client to the server crashes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3.1216
    • Fix Version/s: 2.0.0626
    • Component/s: Synchronizer
    • Backlog priority:
      350
    • Sprint:
      Sprint Drive 7.2-2, Sprint Drive 7.2-5
    • Story Points:
      5

      Description

      Typically when copying large files in a local folder then deleting the remote folder before its children are completely uploaded, we get the following:

      Server-side
      --------------

      2013-09-09 14:49:21,167 ERROR [http-bio-0.0.0.0-8080-exec-2] [org.nuxeo.ecm.automation.server.jaxrs.batch.BatchResource] Error while executing automation batch 
      org.nuxeo.ecm.core.api.ClientException: Failed to invoke operation NuxeoDrive.CreateFile
      	at org.nuxeo.ecm.core.api.ClientException.wrap(ClientException.java:59)
      ...
      Caused by: org.nuxeo.ecm.core.api.ClientException: Cannot create a file in file system item with id defaultSyncRootFolderItemFactory#default#0004ea07-35c2-471f-aed4-5c779666d805 because it doen't exist.
      	at org.nuxeo.drive.service.impl.FileSystemItemManagerImpl.createFile(FileSystemItemManagerImpl.java:213)
      

      Client-side
      -------------

      2013-09-09 14:48:50,534 6961 140724566996736 DEBUG    nxdrive.synchronizer Detected a new non-alignable local file at /Shared with JOE/very_fat_files.tar.gz
      2013-09-09 14:49:04,776 6961 140724566996736 DEBUG    nxdrive.synchronizer Creating remote document 'very_fat_files.tar.gz' in folder 'Shared with JOE'
      2013-09-09 14:49:21,353 6961 140724566996736 DEBUG    nxdrive.client.base_automation_client {"error" : "Failed to invoke operation NuxeoDrive.CreateFile"}
      2013-09-09 14:49:21,354 6961 140724566996736 ERROR    nxdrive.synchronizer Failed to sync LastKnownState<local_folder=u'Nuxeo Drive', local_path=u'/Shared with JOE/very_fat_files.tar.gz', remote_name=None, local_state=u'created', remote_state=u'unknown', pair_state=u'locally_created'>, blacklisting doc pair for 300 seconds
      Traceback (most recent call last):
        File "/home/ataillefer/sources/nuxeo/addons/nuxeo-drive/nuxeo-drive-client/nxdrive/synchronizer.py", line 1034, in synchronize
          self.synchronize_one(pair_state, session=session)
        File "/home/ataillefer/sources/nuxeo/addons/nuxeo-drive/nuxeo-drive-client/nxdrive/synchronizer.py", line 573, in synchronize_one
          local_info, remote_info)
        File "/home/ataillefer/sources/nuxeo/addons/nuxeo-drive/nuxeo-drive-client/nxdrive/synchronizer.py", line 693, in _synchronize_locally_created
          parent_ref, doc_pair.get_local_abspath(), filename=name)
        File "/home/ataillefer/sources/nuxeo/addons/nuxeo-drive/nuxeo-drive-client/nxdrive/client/remote_file_system_client.py", line 120, in stream_file
          file_path, filename=filename, parentId=parent_id)
        File "/home/ataillefer/sources/nuxeo/addons/nuxeo-drive/nuxeo-drive-client/nxdrive/client/base_automation_client.py", line 301, in execute_with_blob_streaming
          return self.execute_batch(command, batch_id, '0', **params)
        File "/home/ataillefer/sources/nuxeo/addons/nuxeo-drive/nuxeo-drive-client/nxdrive/client/base_automation_client.py", line 372, in execute_batch
          check_params=False, **params)
        File "/home/ataillefer/sources/nuxeo/addons/nuxeo-drive/nuxeo-drive-client/nxdrive/client/base_automation_client.py", line 209, in execute
          resp = self.opener.open(req, timeout=timeout)
        File "/usr/lib/python2.7/urllib2.py", line 406, in open
          response = meth(req, response)
        File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
          'http', request, response, code, msg, hdrs)
        File "/usr/lib/python2.7/urllib2.py", line 444, in error
          return self._call_chain(*args)
        File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
          result = func(*args)
        File "/usr/lib/python2.7/urllib2.py", line 527, in http_error_default
          raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
      HTTPError: HTTP Error 500: Erreur Interne de Servlet
      2013-09-09 14:49:21,457 6961 140724566996736 DEBUG    nxdrive.synchronizer Deleting local folder '/home/ataillefer/Nuxeo Drive/Shared with JOE'
      

      The client should be smart in this case and not try to create remotely the locally created children but jump to the next cycle and let the synchronizer delete locally the parent folder and thus its children recursively.

      Yet, even if errors occur in the logs for each child, this should not stop the synchronization process from going on, as the remotely deleted parent folder finally gets locally deleted as we can see in the logs.

        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 - 3 days
                  3d
                  Remaining:
                  Remaining Estimate - 3 days
                  3d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified