Do

gnome3 breaks files and folders

Bug #850543 reported by Frank Lockom on 2011-09-15
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Do
Undecided
Unassigned
Do Plugins
High
Unassigned

Bug Description

on ArchLinux x64 after upgrading to GNOME3 files and folders stopped working. I receive no results when searching for files. I uninstalled all plugins and receive the same error from "GNOME Special Locations"

from the terminal:

[code]
$ gnome-do --debug
[Info 15:45:21.647] [Services] Successfully located service of type IPreferencesService.
[Info 15:45:21.656] [Services] Successfully located service of type ILogService.
[Info 15:45:21.656] [Services] Successfully located service of type ISecurePreferencesService.
[Info 15:45:21.664] [Services] Successfully located service of type INotificationsService.
[Debug 15:45:21.668] [InterfaceManager] "Mini" interface was loaded
[Info 15:45:21.669] [Services] Successfully located service of type ILogService.
[Debug 15:45:21.669] [InterfaceManager] "Classic" interface was loaded
[Debug 15:45:21.669] [InterfaceManager] "Glass" interface was loaded
[Debug 15:45:21.670] [InterfaceManager] "Nouveau" interface was loaded
[Debug 15:45:21.673] [PluginManager] Loaded "ApplicationItemSource" from plugin.
[Debug 15:45:21.673] [PluginManager] Loaded "GNOMESpecialLocationsItemSource" from plugin.
[Info 15:45:21.675] [Services] Successfully located service of type AbstractApplicationService.
[Debug 15:45:21.676] [PluginManager] Loaded "InternalItemSource" from plugin.
[Debug 15:45:21.676] [PluginManager] Loaded "ItemSourceItemSource" from plugin.
[Debug 15:45:21.677] [PluginManager] Loaded "EmailAction" from plugin.
[Debug 15:45:21.678] [PluginManager] Loaded "OpenAction" from plugin.
[Debug 15:45:21.681] [PluginManager] Loaded "OpenUrlAction" from plugin.
[Debug 15:45:21.681] [PluginManager] Loaded "OpenWithAction" from plugin.
[Debug 15:45:21.681] [PluginManager] Loaded "RevealAction" from plugin.
[Debug 15:45:21.682] [PluginManager] Loaded "RunAction" from plugin.
[Debug 15:45:21.682] [PluginManager] Loaded "CopyToClipboardAction" from plugin.
[Info 15:45:21.682] [Services] Successfully located service of type AbstractSystemService.
[Debug 15:45:21.684] [SystemService] No other application instance detected. Continue startup.
[Info 15:45:21.692] [Services] Successfully located service of type IPreferencesService.
[Info 15:45:21.692] [Services] Successfully located service of type ISecurePreferencesService.
[Debug 15:45:21.698] [Controller] Setting theme Classic
[Info 15:45:21.791] [Services] Successfully located service of type IKeyBindingService.
[Info 15:45:21.840] [Services] Successfully located service of type INetworkService.
[Info 15:45:21.844] [UniverseManager] Reloading universe...
[Debug 15:45:21.845] [UniverseManager] Reloading actions...
[Debug 15:45:21.849] [UniverseManager] Reloading item source "Applications"...
[Debug 15:45:21.973] [UniverseManager] Reloading item source "GNOME Special Locations"...
[Info 15:45:21.987] [Services] Successfully located service of type IUniverseFactoryService.
[Info 15:45:21.993] [Services] Successfully located service of type IEnvironmentService.
Do.Universe.Linux.GNOMESpecialLocationsItemSource "GNOME Special Locations" encountered an error in UpdateItems: System.TypeInitializationException: An exception was thrown by the type initializer for Do.Universe.Linux.FileItem ---> System.ArgumentNullException: Argument cannot be null.
Parameter name: path2
  at System.IO.Path.Combine (System.String path1, System.String path2) [0x00000] in <filename unknown>:0
  at Do.Platform.Linux.EnvironmentServiceExtensions.PathForXdgVariable (IEnvironmentService envService, System.String key, System.String fallback) [0x00000] in <filename unknown>:0
  at Do.Platform.Linux.EnvironmentServiceExtensions.MaybePathForXdgVariable (IEnvironmentService envService, System.String key) [0x00000] in <filename unknown>:0
  at Do.Universe.Linux.FileItem..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Do.Platform.Linux.UniverseFactoryService.NewFileItem (System.String path) [0x00000] in <filename unknown>:0
  at Do.Universe.Linux.GNOMESpecialLocationsItemSource+<ReadBookmarkItems>c__Iterator3.MoveNext () [0x00000] in <filename unknown>:0
  at Do.Universe.Linux.GNOMESpecialLocationsItemSource.UpdateItems () [0x00000] in <filename unknown>:0
  at Do.Universe.Safe.SafeItemSource.UpdateItems () [0x00000] in <filename unknown>:0 .
[Debug 15:45:22.001] [UniverseManager] Reloading item source "Internal GNOME Do Items"...
[Debug 15:45:22.002] [UniverseManager] Reloading item source "GNOME Do Item Sources"...
[Info 15:45:22.003] [UniverseManager] Universe contains 156 items.
[Debug 15:47:22.008] [UniverseManager] Reloading item source "Applications"...
[Debug 15:47:22.036] [UniverseManager] Reloading item source "GNOME Special Locations"...
Do.Universe.Linux.GNOMESpecialLocationsItemSource "GNOME Special Locations" encountered an error in UpdateItems: System.TypeInitializationException: An exception was thrown by the type initializer for Do.Universe.Linux.FileItem ---> System.ArgumentNullException: Argument cannot be null.
Parameter name: path2
  at System.IO.Path.Combine (System.String path1, System.String path2) [0x00000] in <filename unknown>:0
  at Do.Platform.Linux.EnvironmentServiceExtensions.PathForXdgVariable (IEnvironmentService envService, System.String key, System.String fallback) [0x00000] in <filename unknown>:0
  at Do.Platform.Linux.EnvironmentServiceExtensions.MaybePathForXdgVariable (IEnvironmentService envService, System.String key) [0x00000] in <filename unknown>:0
  at Do.Universe.Linux.FileItem..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Do.Platform.Linux.UniverseFactoryService.NewFileItem (System.String path) [0x00000] in <filename unknown>:0
  at Do.Universe.Linux.GNOMESpecialLocationsItemSource+<ReadBookmarkItems>c__Iterator3.MoveNext () [0x00000] in <filename unknown>:0
  at Do.Universe.Linux.GNOMESpecialLocationsItemSource.UpdateItems () [0x00000] in <filename unknown>:0
  at Do.Universe.Safe.SafeItemSource.UpdateItems () [0x00000] in <filename unknown>:0 .
[/code]

Will Timpson (greybluemist) wrote :

This error is a result of the lack of the file user-dirs.dirs, which usually resides in ~/.config/. This file can be created manually, but it is automatically created by the program xdg-user-dirs-update which is included in the package xdg-user-dirs.

Refer to:
http://www.unix.com/man-page/OpenSolaris/1/xdg-user-dirs-update/
https://wiki.archlinux.org/index.php/GNOME_Tips

Frank Lockom (flockom) wrote :

Thanks! this solved the problem.

Seems strange that files and folders should stop working without this file:

XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

what does it do besides allow for the custom icons on those folders?

Will Timpson (greybluemist) wrote :

My understanding is that xdg-user-dirs is useful in that it provides a way for any application to find these folders on any system. I am basing this on a cursory reading of: http://www.freedesktop.org/wiki/Software/xdg-user-dirs. I think that I found that some part of Do is coded to read that file in such a way that if it doesn't exist, it fails poorly and the Files and Folders plugin is unusable as a result. I don't really know much about the internals of xdg or gnome-do. I'm just a fellow Do user who had the same problem as you and was inspired by your post to finally figure it out.

I actually just searched the source code (which I found here: http://gnome-do.sourcearchive.com/documentation/0.8.5-1/main.html) until I found the file that contained the line that was throwing the error (http://gnome-do.sourcearchive.com/documentation/0.8.5-1/EnvironmentServiceExtensions_8cs_source.html).
Then I figured that this line: userDirsPath = Path.Combine (configDir, "user-dirs.dirs"); contained the only Path.Combine that was likely to be throwing the error, since it contained an absolute reference (to user-dirs.dirs), while all the rest just referenced variables.
When I discovered that my filesystem did not contain any file named as such, I just searched the tubes for what that file was.

Et voila. (It actually took me an hour or two and I literally did a little dance when I figured it out.)

P.S. I'm no developer, but if there are developers reading this, it seems to me that there should be a better way of doing this. Does the Files and Folders plugin (or the code in Do that the plugin is using) need to read the user-dirs.dirs file to be useful? If not, there should be a way to code it so that it can be used if available, but the remaining functionality of Files and Folders is maintained in its absence. If it is necessary, then xdg-user-dirs should be a dependency of Do (or maybe the plugins?), so that user-dirs.dirs is available to Do when it is needed (I realize that in this case, it is more of a packaging problem). Any thoughts?

 affects do-plugins
 status triaged
 importance high
 milestone 0.8.5

We should indeed handle the case where the user-dirs file isn't
available better. Not crashing would be good :)

Chris Halse Rogers (raof) wrote :

 affects do-plugins
 status triaged
 importance high

We should indeed handle the case where the user-dirs file isn't
available better. Not crashing would be good :)

I also met this problem, so any news? or How to fix this bug?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers