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 731613 - gnome-music-3.12.2 fails to start if xdg default directories are not created
gnome-music-3.12.2 fails to start if xdg default directories are not created
Status: RESOLVED FIXED
Product: gnome-music
Classification: Applications
Component: general
3.12.x
Other Linux
: Normal normal
: 3.14
Assigned To: gnome-music-maint
gnome-music-maint
Depends on:
Blocks:
 
 
Reported: 2014-06-13 10:50 UTC by Pacho Ramos
Modified: 2015-01-09 11:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A possible workaround for the xdg user dirs does not exist and gnome-music fails to start.. to test the patch comment the line XDG_MUSIC_DIR in ~/.config/user-dirs.dirs (2.15 KB, patch)
2014-07-25 07:01 UTC, Pranav Ganorkar
reviewed Details | Review
Fixes the bug for xdg-user-dirs not found bug...... (2.10 KB, patch)
2014-07-28 17:17 UTC, Pranav Ganorkar
rejected Details | Review
Final updated patch (2.10 KB, patch)
2014-07-29 13:41 UTC, Pranav Ganorkar
none Details | Review
Check for xdg-user-dirs-update existence (935 bytes, patch)
2015-01-07 23:21 UTC, Gilles Dartiguelongue
rejected Details | Review

Description Pacho Ramos 2014-06-13 10:50:32 UTC
As reported downstream at:
https://bugs.gentoo.org/show_bug.cgi?id=512300

gnome-music fails to start if xdg directories are missing in home directory:
# gnome-music
/usr/lib64/python3.3/site-packages/gi/module.py:178: Warning: g_array_append_vals: assertion 'array' failed
  g_type = info.get_g_type()
/usr/lib64/python3.3/site-packages/gi/module.py:178: Warning: g_hash_table_lookup: assertion 'hash_table != NULL' failed
  g_type = info.get_g_type()
/usr/lib64/python3.3/site-packages/gi/module.py:178: Warning: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed
  g_type = info.get_g_type()
Traceback (most recent call last):
  • File "/usr/bin/gnome-music", line 38 in <module>
    from gnomemusic.application import Application
  • File "/usr/lib64/python3.3/site-packages/gnomemusic/application.py", line 36 in <module>
    from gnomemusic.window import Window
  • File "/usr/lib64/python3.3/site-packages/gnomemusic/window.py", line 38 in <module>
    from gnomemusic.query import Query
  • File "/usr/lib64/python3.3/site-packages/gnomemusic/query.py", line 32 in <module>
    class Query():
  • File "/usr/lib64/python3.3/site-packages/gnomemusic/query.py", line 35 in Query
    GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_MUSIC)
TypeError: Argument 0 does not allow None as a value

Comment 1 Pranav Ganorkar 2014-07-25 07:01:56 UTC
Created attachment 281663 [details] [review]
A possible workaround for the xdg user dirs does not exist and gnome-music fails to start.. to test the patch comment the line XDG_MUSIC_DIR in ~/.config/user-dirs.dirs
 

It provides a possible workaround to the xdg user dirs does not exist problem...
so that atleast the program is able to successfully start and inform the user about the existing problem.....
Comment 2 Pranav Ganorkar 2014-07-25 07:07:17 UTC
to test the patch comment the line XDG_MUSIC_DIR line in ~/.config/user-dirs.dirs
Comment 3 Vadim Rutkovsky 2014-07-28 13:46:01 UTC
Review of attachment 281663 [details] [review]:

Allan, any ideas how do we treat 'broken environment' situation? I don't think we should be showing a very detailed error message here.

Pranav, if I'm not mistaken you were running Music in LXDE when this error occurred?

::: gnomemusic/view.py
@@ +339,3 @@
         label = builder.get_object('label1')
+        if Query.MUSIC_DIR == None:
+            label.set_label(_('Your Environment is not Configured Properly'))

This label is a bit misleading and doesn't help user in any way, we'd better stick to existing "No Music found" label
Comment 4 Pacho Ramos 2014-07-28 13:50:22 UTC
Maybe it could tell users about review xdg-user-dirs-update usage in their setup (as a hint)
Comment 5 Pranav Ganorkar 2014-07-28 13:57:04 UTC
(In reply to comment #4)
> Maybe it could tell users about review xdg-user-dirs-update usage in their
> setup (as a hint)

Yes, That could also be a good Idea.But as Vadim said, we should not display a detailed error message.....so, I think we could stick to the "No Music Found" and I will update the patch likewise......
Comment 6 Pranav Ganorkar 2014-07-28 14:06:29 UTC
(In reply to comment #3)
> Review of attachment 281663 [details] [review]:
> 
> Allan, any ideas how do we treat 'broken environment' situation? I don't think
> we should be showing a very detailed error message here.
> 
> Pranav, if I'm not mistaken you were running Music in LXDE when this error
> occurred?
> 
> ::: gnomemusic/view.py
> @@ +339,3 @@
>          label = builder.get_object('label1')
> +        if Query.MUSIC_DIR == None:
> +            label.set_label(_('Your Environment is not Configured Properly'))
> 
> This label is a bit misleading and doesn't help user in any way, we'd better
> stick to existing "No Music found" label

Hi Vadim, I think the error is not specific to LXDE....cause When I tried running Gnome-music in gnome environment then also it was giving me the error unless and until I ran xdg-user-dirs-update which created the required directories for me...
I think this should be added as a dependency to gnome-music package....and for the patch I will change it to "No Music Found" label as for now...
Comment 7 Pranav Ganorkar 2014-07-28 17:17:14 UTC
Created attachment 281880 [details] [review]
Fixes the bug for xdg-user-dirs not found bug......

Fixes the bug for xdg-user-dirs not found bug......Now, the program displays "No Music Found!" When xdg-user-dirs are not created..
Comment 8 Pranav Ganorkar 2014-07-28 17:19:26 UTC
Added The updated patch...
Comment 9 Pranav Ganorkar 2014-07-29 13:22:22 UTC
Review of attachment 281880 [details] [review]:

minor correction...
Comment 10 Pranav Ganorkar 2014-07-29 13:41:51 UTC
Created attachment 281952 [details] [review]
Final updated patch

Fixed a minor correction in earlier version.....
Comment 11 Christopher Gregory 2014-07-31 01:24:51 UTC
Hello,

Maybe this should be a new bug, but even WITH xdg directories created gnome-music is NOT able to locate them.  With this patch the application does indeed start.

I have proved that gnome-music can not find the directory by modifying the error message displayed in the first set label of view.py and when gnome-music launches it displays that modified error message.

If it was able to locate the directory then the second label should have been displayed.

This is clearly an error with gnome-music.

I do have tracker 1.0.2 installed even though the requirements for it are not placed anywhere that the end user can find them.

Christopher.
Comment 12 Vadim Rutkovsky 2015-01-06 11:12:35 UTC
Pushed an updated patch as https://git.gnome.org/browse/gnome-music/commit/?id=0444ce2, this is fixed in upcoming 3.15.4

Sorry this took too long, there were several problems with previous patch (e.g. string update, which is not acceptable for stable version)
Comment 13 Pacho Ramos 2015-01-06 14:45:44 UTC
Cannot it be included to 3.14 branch to get it fixed in next 3.14.x version too then? :)

Well, thanks a lot anyway for fixing it :D
Comment 14 Vadim Rutkovsky 2015-01-06 17:06:29 UTC
Right, pushed https://git.gnome.org/browse/gnome-music/commit/?id=7b072bd to gnome-3-14
Comment 15 Gilles Dartiguelongue 2015-01-07 23:21:39 UTC
Created attachment 294067 [details] [review]
Check for xdg-user-dirs-update existence

Hello there, I think this still needs a proper check for downstream packagers to know that they should have that kind of compliance.

I didn't find a README where I think it should be noted as well.
Comment 16 Vadim Rutkovsky 2015-01-09 11:26:41 UTC
Review of attachment 294067 [details] [review]:

I don't think gnome-music deps (e.g. gtk+) can be built without XDG dirs support, so this is not really required