KeyError on the root folder inside volume manager

Bug #802738 reported by Natalia Bidart
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu One Client
Fix Released
Critical
Manuel de la Peña

Bug Description

The trace is:

2011-06-27 18:01:33,697 - ubuntuone.SyncDaemon.fsm - DEBUG - get_by_path(\\?\C:\Users\Test\Ubuntu One\) with idx {u'\\\\?\\C:\\Users\\Test\\Ubuntu One\\yadda': '2ddb851d-bc2e-4a1d-8b87-113fee73da8a', u'\\\\?\\C:\\Users\\Test\\Ubuntu One\\images\\inner': 'a1ceb8f8-fbcc-4a11-978e-af96aa286042', '\\\\?\\C:\\Users\\Test\\Ubuntu One\\file.18.txt': '9bee0973-8300-4f48-96cb-679356a135a6', '\\\\?\\C:\\Users\\Test\\Ubuntu One': '7172c671-ccbb-4505-badf-efe86c43837d', u'\\\\?\\C:\\Users\\Test\\Ubuntu One\\images': 'e7812341-9288-47f4-b1f9-9b182ec341d6', u'\\\\?\\C:\\Users\\Test\\Ubuntu One\\empty': '670e3f42-7d09-4513-975b-0fafc8394c62'}
2011-06-27 18:01:33,697 - ubuntuone.SyncDaemon.sync - ERROR - Node delta for :407d60a4-2153-4b99-b631-76b6126a27b5 can't be applied.
Traceback (most recent call last):
  File "C:\Users\Test\src\extra_os_helper_logging\ubuntuone\syncdaemon\sync.py", line 1156, in handle_AQ_DELTA_OK
    os.path.dirname(node.path))
  File "C:\Users\Test\src\extra_os_helper_logging\ubuntuone\syncdaemon\filesystem_manager.py", line 775, in get_by_path
    mdid = self._idx_path[path]
KeyError: '\\\\?\\C:\\Users\\Test\\Ubuntu One\\'

This is caused becasue os.path.normpath will not normalize paths that starts with the \\\\?\\ prefix. Refer to the source code for details, but the key part is:

def normpath(path):
    """Normalize path, eliminating double slashes, etc."""
    # Preserve unicode (if path is unicode)
    backslash, dot = (u'\\', u'.') if isinstance(path, unicode) else ('\\', '.')
    if path.startswith(('\\\\.\\', '\\\\?\\')):
        # in the case of paths with these prefixes:
        # \\.\ -> device names
        # \\?\ -> literal paths
        # do not do any normalization, but return the path unchanged
        return path

We need to handle path normalization by our own, on the window side.

Related branches

Revision history for this message
Natalia Bidart (nataliabidart) wrote :
Changed in ubuntuone-client:
assignee: nobody → Manuel de la Pena (mandel)
status: New → Triaged
importance: Undecided → Critical
tags: added: u1-zomg-windows
Changed in ubuntuone-client:
status: Triaged → In Progress
Changed in ubuntuone-client:
status: In Progress → Fix Committed
dobey (dobey)
Changed in ubuntuone-client:
milestone: none → 1.7.1
dobey (dobey)
Changed in ubuntuone-client:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.