After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 594008 - Import errors from symlink, but not from normal file
Import errors from symlink, but not from normal file
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: Importing
0.12.x
Other Linux
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-09-03 10:05 UTC by Derek Cramer
Modified: 2009-09-05 02:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Derek Cramer 2009-09-03 10:05:59 UTC
First up, OS is Fedora 11, fully updated.
Fedora release 11 (Leonidas)

rhythmbox-0.12.3-1.fc11.i586

2.6.29.6-217.2.16.fc11.i686.PAE


When I try to import a symlink to a file whose name (or any component in the path) contains accented characters, I get an import error. If I import the file directly (i.e. the target of the symlink), it works as expected.

My library consists of flac, ogg & mp3 symlinks in a hierarchy or directories such as the following:

/srv/music/all/Björk/Debut/01 - Human Behaviour.flac -> ../../../flac/Björk/Debut/01 - Human Behaviour.flac

This is because some of the music is duplicated between mp3 and other formats (for a hardware player that likes mp3), so I have a script that builds the directory of symlinks discarding duplicate files in the order flac->ogg->mp3. This works very well for the most part, except for files with accented characters in the the path (file or directory name), such as the example above. When I try to import the file "/srv/music/all/Björk/Debut/01 - Human Behaviour.flac", I get an import error to the effect of file not found. However, if I import the actual file from "/srv/music/flac/Björk/Debut/01 - Human Behaviour.flac" it works perfectly.

It seems like whatever is resolving the symlink is converting the accented characters to their literal equivalents, which resolves to a filename that doesn't exist. Does that make sense?

Sample output from a failed symbolic link import (rhythmbox -d):

(19:28:57) [0x90a4390] [action_thread_main] rhythmdb.c:2993: executing RHYTHMDB_ACTION_STAT for "file:///media/BigDisk/backups/music/all/Bj%C3%B6rk/Debut/01%20-%20Human%20Behaviour.flac"
(19:28:57) [0x870c5e8] [window_focus_cb] rb-mmkeys-plugin.c:142: window got focus, re-grabbing media keys
(19:28:57) [0x870c5e8] [rhythmdb_process_one_event] rhythmdb.c:2600: processing RHYTHMDB_EVENT_STAT
(19:28:57) [0x870c5e8] [rhythmdb_process_stat_event] rhythmdb.c:2154: queuing a RHYTHMDB_ACTION_LOAD: file:///media/BigDisk/backups/music/all/Bj%C3%B6rk/Debut/01%20-%20Human%20Behaviour.flac
(19:28:57) [0x90a4390] [action_thread_main] rhythmdb.c:3006: executing RHYTHMDB_ACTION_LOAD for "file:///media/BigDisk/backups/music/all/Bj%C3%B6rk/Debut/01%20-%20Human%20Behaviour.flac"
(19:28:57) [0x90a4390] [rb_uri_resolve_symlink] rb-file-helpers.c:329: error querying file:///media/BigDisk/backups/music/flac/Bj%5Cxc3%5Cxb6rk/Debut/01%20-%20Human%20Behaviour.flac: Error stating file '/media/BigDisk/backups/music/flac/Bj\xc3\xb6rk/Debut/01 - Human Behaviour.flac': No such file or directory
(19:28:57) [0x90a4390] [make_access_failed_error] rhythmdb.c:754: got error on file:///media/BigDisk/backups/music/all/Bj%C3%B6rk/Debut/01%20-%20Human%20Behaviour.flac: Couldn't access file:///media/BigDisk/backups/music/all/Björk/Debut/01 - Human Behaviour.flac: Error stating file '/media/BigDisk/backups/music/flac/Bj\xc3\xb6rk/Debut/01 - Human Behaviour.flac': No such file or directory
(19:28:57) [0x870c5e8] [rhythmdb_process_one_event] rhythmdb.c:2604: processing RHYTHMDB_EVENT_METADATA_LOAD
(19:28:57) [0x870c5e8] [rhythmdb_add_import_error_entry] rhythmdb.c:2202: adding import error for file:///media/BigDisk/backups/music/all/Bj%C3%B6rk/Debut/01%20-%20Human%20Behaviour.flac: Couldn't access file:///media/BigDisk/backups/music/all/Björk/Debut/01 - Human Behaviour.flac: Error stating file '/media/BigDisk/backups/music/flac/Bj\xc3\xb6rk/Debut/01 - Human Behaviour.flac': No such file or directory


And here's what happens when I import the regular file:

(21:51:57) [0x9dccde0] [action_thread_main] rhythmdb.c:2993: executing RHYTHMDB_ACTION_STAT for "file:///media/BigDisk/backups/music/flac/Bj%C3%B6rk/Debut/01%20-%20Human%20Behaviour.flac"
(21:51:57) [0x95ed5e8] [window_focus_cb] rb-mmkeys-plugin.c:142: window got focus, re-grabbing media keys
(21:51:57) [0x95ed5e8] [rhythmdb_process_one_event] rhythmdb.c:2600: processing RHYTHMDB_EVENT_STAT
(21:51:57) [0x95ed5e8] [rhythmdb_process_stat_event] rhythmdb.c:2154: queuing a RHYTHMDB_ACTION_LOAD: file:///media/BigDisk/backups/music/flac/Bj%C3%B6rk/Debut/01%20-%20Human%20Behaviour.flac
(21:51:57) [0x9dccde0] [action_thread_main] rhythmdb.c:3006: executing RHYTHMDB_ACTION_LOAD for "file:///media/BigDisk/backups/music/flac/Bj%C3%B6rk/Debut/01%20-%20Human%20Behaviour.flac"
Comment 1 Jonathan Matthew 2009-09-04 00:39:18 UTC
(In reply to comment #0)
> It seems like whatever is resolving the symlink is converting the accented
> characters to their literal equivalents, which resolves to a filename that
> doesn't exist. Does that make sense?

Yes, that's what it looks like.  I don't think we do anything special to handle symlinks, so maybe this is a gio/gvfs problem.  Does 'gvfs-info "/srv/music/all/Björk/Debut/01 - Human Behaviour.flac"' work?
Comment 2 Derek Cramer 2009-09-04 08:35:41 UTC
Looks like you're right. I've snipped most of the output of gvfs-info, but the relevant line seems to be:

   standard::symlink-target: ../../../flac/Bj\xc3\xb6rk/Debut/01 - Human Behaviour.flac
   
Which seems to be where the problem is coming from. 

So should this bug be re-assigned to gvfs, or should I make a new one?

gvfs-info "/srv/music/all/Björk/Debut/01 - Human Behaviour.flac"
display name: 01 - Human Behaviour.flac
edit name: 01 - Human Behaviour.flac
name: 01 - Human Behaviour.flac
type: regular
size: 24844288
attributes:
  standard::name: 01 - Human Behaviour.flac
  standard::is-symlink: TRUE
  standard::type: 1
  standard::size: 24844288
  standard::allocated-size: 24875008
  standard::symlink-target: ../../../flac/Bj\xc3\xb6rk/Debut/01 - Human Behaviour.flac
  standard::display-name: 01 - Human Behaviour.flac
  standard::edit-name: 01 - Human Behaviour.flac
  standard::copy-name: 01 - Human Behaviour.flac
  standard::content-type: audio/x-flac
  standard::icon: audio-x-flac, gnome-mime-audio-x-flac, audio-x-generic
  standard::fast-content-type: audio/x-flac
Comment 3 Jonathan Matthew 2009-09-04 09:59:14 UTC
I'm not sure.  gio seems to be handling the symlink properly.  I'm guessing the symlink-target attribute is formatted for display rather than for use in constructing a valid path for the target, so we're probably doing that wrong.
Comment 4 Jonathan Matthew 2009-09-05 02:29:46 UTC
commit 88b813f430342ee47bf3e877b29ece31ec4b9dca
Author: Jonathan Matthew <jonathan@d14n.org>
Date:   Sat Sep 5 12:28:26 2009 +1000

    file-helpers: get symlink target as byte string, not ASCII (bug #594008)