Unicode error syncinc non ascii path with u1sync

Bug #515920 reported by Pierre Paysant-Le Roux
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
u1sync
Confirmed
Undecided
Unassigned

Bug Description

u1sync fails initializing non ascii directory

$ u1sync non-ascii-dir-éà
Traceback (most recent call last):
  File "/usr/bin/u1sync", line 29, in <module>
    exit(main(*sys.argv))
  File "/usr/lib/python2.6/dist-packages/ubuntuone/u1sync/main.py", line 462, in main
    do_main(argv=argv)
  File "/usr/lib/python2.6/dist-packages/ubuntuone/u1sync/main.py", line 444, in capture_exception
    func()
  File "/usr/lib/python2.6/dist-packages/ubuntuone/u1sync/main.py", line 423, in run_client
    dry_run=options.dry_run, quiet=options.quiet)
  File "/usr/lib/python2.6/dist-packages/ubuntuone/u1sync/main.py", line 136, in do_sync
    metadata_dir = os.path.join(absolute_path, METADATA_DIR_NAME)
  File "/usr/lib/python2.6/posixpath.py", line 70, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 30: ordinal not in range(128)

or syncinc non ascii path

$ pwd
/home/pplr/test/non-ascii-path-éç
$ u1sync --init test

Initializing directory...

Writing mirror metadata...

Done.

$ u1sync test
Traceback (most recent call last):
  File "/usr/bin/u1sync", line 29, in <module>
    exit(main(*sys.argv))
  File "/usr/lib/python2.6/dist-packages/ubuntuone/u1sync/main.py", line 462, in main
    do_main(argv=argv)
  File "/usr/lib/python2.6/dist-packages/ubuntuone/u1sync/main.py", line 444, in capture_exception
    func()
  File "/usr/lib/python2.6/dist-packages/ubuntuone/u1sync/main.py", line 423, in run_client
    dry_run=options.dry_run, quiet=options.quiet)
  File "/usr/lib/python2.6/dist-packages/ubuntuone/u1sync/main.py", line 136, in do_sync
    metadata_dir = os.path.join(absolute_path, METADATA_DIR_NAME)
  File "/usr/lib/python2.6/posixpath.py", line 70, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 31: ordinal not in range(128)

Tags: ops+
Changed in ubuntuone-client:
status: New → Confirmed
assignee: nobody → Ubuntu One Desktop+ team (ubuntuone-desktop+)
tags: added: foundations+
Changed in ubuntuone-client:
assignee: Ubuntu One Desktop+ team (ubuntuone-desktop+) → Ubuntu One Ops+ team (ubuntuone-ops+)
tags: added: ops+
removed: foundations+
Revision history for this message
Flemming Christensen (laoshi) wrote :

This bug seems to block all file synchronization in lucid rc
directories placed in ubuntuone directory are sync'ed but not the files in directories - their names appear markes as 'uploading' but nothing happens
I have tried to sync ~/Documents in place, and same thing happens.
u1sdtool --waiting-content
lists a lot of files ready to be uploaded

u1stdtool --waiting-metadata give this:

Oops, an error ocurred:
Traceback (most recent call last):
Failure: dbus.exceptions.DBusException: org.freedesktop.DBus.Python.UnicodeEncodeError: Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/dbus/service.py", line 702, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/lib/python2.6/dist-packages/ubuntuone/syncdaemon/dbus_interface.py", line 204, in waiting_metadata
    waiting_metadata.append(str(cmd))
  File "/usr/lib/python2.6/dist-packages/ubuntuone/syncdaemon/action_queue.py", line 1442, in __str__
    for attr in str_attrs]
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe6' in position 25: ordinal not in range(128)

Is there a way to have a clue as to identify the offending file? Or to remove the queued files? As it stands now absolutely nothing can be sync'ed - only uploaded one file at a time.

Revision history for this message
Flemming Christensen (laoshi) wrote :

A clarification: When sync'ing ~/Documents in place Documents-directory and sub-directories are uploaded, and so are filenames - only the files don't upload - they have been standing for days marked as 'uploading' - and I see no way to make them upload, or - on the other hand - remove them from the list

u1sdtool --current-transfers
Current uploads: 0
Current downloads: 0

u1sdtool --status
State: QUEUE_MANAGER
    connection: With User With Network
    description: processing queues
    is_connected: True
    is_error: False
    is_online: True
    queues: WORKING_ON_BOTH

Revision history for this message
Flemming Christensen (laoshi) wrote :

One last comment:
as stated above the console says:

u1sdtool --current-transfers
Current uploads: 0
Current downloads: 0

u1sdtool --status
State: QUEUE_MANAGER
    connection: With User With Network
    description: processing queues
    is_connected: True
    is_error: False
    is_online: True
    queues: WORKING_ON_BOTH

and at thesame time the ubuntuone-applet in the MeMenu tells me that synchronization is going on...

Revision history for this message
Milan Bouchet-Valat (nalimilan) wrote :

"processing queues" means that synchronization is going on... If nothing is in the queue, that means eveyrthing is up-to-date, so nothing happens.

The real problem is that non-ASCII files seem not to be handled correclty, so they are ignored.

Revision history for this message
Flemming Christensen (laoshi) wrote :

Yes - but the problem is that nothing is really going on - and non-ASCII files seem not to be ignored. They are blocking the synchronization process.

Revision history for this message
dcam (david-pastornet) wrote :

I can confirm this behaviour in Maverick...I had added a directory whose name was ascii, but some of the files buried in the directory had chinese names, and the whole sync failed

Revision history for this message
dcam (david-pastornet) wrote :

I attach a tar file containing a file with Chinese characters in the name.

I have found that if this contained file exists in a directory being synced (for the first time at least) then the existence of this file prevents ANY files from being uploaded. The directories are created as part of the sync process, but no files upload at all.

affects: ubuntuone-client → u1sync
Curtis Hovey (sinzui)
Changed in u1sync:
assignee: Registry Administrators (registry) → nobody
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.