Dash won't open files anymore

Bug #751374 reported by Peterson Silva on 2011-04-05
This bug affects 35 people
Affects Status Importance Assigned to Milestone
unity (Ubuntu)
unity-place-files (Ubuntu)
xdg-utils (Ubuntu)

Bug Description

Binary package hint: unity-place-files

What I expected:

1) I press the super key or the combo super key (dealing, thus, with files only know).
2) I search for a file. In my case, it's a file called money.ods.
3) I find the file within the dash. I click on it.
4) The file opens.

What happens instead:
1), 2) and 3) are the same.
However, Dash won't open the file. Instead it says in a new pop-up window:

"Could not display "/home/peterson/Ubuntu One/Money.ods"."

"The location is not a folder."

It also happens with other files (other mime types, other folders [outside of Ubuntu One folder]).

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: unity-place-files 0.5.46-0ubuntu2
ProcVersionSignature: Ubuntu 2.6.38-7.39-generic 2.6.38
Uname: Linux 2.6.38-7-generic x86_64
Architecture: amd64
Date: Tue Apr 5 10:22:21 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
SourcePackage: unity-place-files
UpgradeStatus: Upgraded to natty on 2011-03-14 (22 days ago)

Peterson Silva (petersonsilva) wrote :
Omer Akram (om26er) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please answer these questions:

* Is this reproducible?
* If so, what specific steps should we take to recreate this bug?

This will help us to find and resolve the problem.

Changed in unity-place-files (Ubuntu):
status: New → Incomplete
Omer Akram (om26er) wrote :

Please ignore the last comment.

Changed in unity-place-files (Ubuntu):
status: Incomplete → New
Alex Launi (alexlauni) wrote :

are you able to open these files from nautilus? what about from a terminal with xdg-open? can you provide a screenshot of the error dialog?

Changed in unity-place-files:
status: New → Incomplete
Changed in unity:
status: New → Incomplete
Changed in unity-place-files (Ubuntu):
status: New → Incomplete
Peterson Silva (petersonsilva) wrote :

Screenshot attached =)

And no, I can't open it with xdg-open, but I can open the file normally from Nautilus.

Ben Mellor (cumber) wrote :

Same for me; Nautilus yes = yes, xdg-open = no.

Lennart Weller (lhw) wrote :

This bug is not restricted to the dash or anything. gnome-open fails to open any mimetype and interprets everything as a directory and tries to open it with nautilus.

I already tried/looked up the following stuff:
 * purging ~/.local/share/applications (completly)
 * lhw:~ % xdg-mime query default application/pdf
 * the gnome defaults file /etc/gnome/defaults.list

Everything seems to be in order but gnome-open/gvfs-open always produce the output seen in the screenshot above.

Omer Akram (om26er) on 2011-04-19
Changed in unity (Ubuntu):
status: New → Incomplete
Peter Júnoš (petoju) wrote :

I can confirm this issue.
Same problem is reported in #743859. Temporary solution (update will break it):
# cd /usr/bin/
# mv xdg-open xdg-open.backup
# ln -s exo-open xdg-open
# mv gnome-open gnome-open.backup
# ln -s exo-open gnome-open

gnome-open and xdg-open are broken when opening non-folders with them.

Ewan Davies (ewan.davies) wrote :

I experienced this bug in todays natty beta. I found this https://bbs.archlinux.org/viewtopic.php?id=112069 which suggested removing exo-utils. After removing any xfce related packages, including exo-utils and anything which depends on it, I can open files correctly with gnome-open. I assume it's a packaging problem.

Everthon Valadão (valadao) wrote :

Quick and *dirty* FIX:

I eddited* the thunar deb package and removed the exo-utils dependency, given it is the culprit for this BUG (specifically, the /usr/bin/exo-open). The modified thunar package is attached, but to fix this problem, first you have to remove exo-utils and then install the attached package to get Thunar without creating the bug:

     sudo apt-get remove exo-utils
     sudo dpkg -i thunar_1.2.1-3ubuntu2_i386-no_exo-utils_dependency.deb
     sudo apt-get -f install

* thanks to the post http://ubuntuforums.org/showpost.php?p=3925729&postcount=1

Alejandro Cuervo (a-cuervo) wrote :

Everthon Valadão solution works,

Here is the 64-bit version just in case someone needs it.


Changed in unity-2d:
status: New → Confirmed
importance: Undecided → High
Didier Roche (didrocks) on 2011-07-22
Changed in unity-place-files:
status: Incomplete → Confirmed
Changed in unity-place-files (Ubuntu):
status: Incomplete → Confirmed
Ayke (ayke) wrote :

This is a quick fix too. Add a file somewhere in your $PATH (for example, ~/bin and add ~/bin to your $PATH variable). call it xdg-open:
  exo-open "$1"
Make it executable with chmod +x bin/xdg-open
Log out and log in again
This works for gnome-do.

Changed in xdg-utils (Ubuntu):
status: New → Confirmed
PhobosK (phobosk) wrote :

This bug has nothing to do with unity, xdg-utils  , unity-2d, or unity-place-files.
It is an upstream problem with the desktop files which install wrong handlers for the things (that is if you do not use XFCE)...

The "MimeType=" entry in the:
files should become: "X-XFCE-MimeType="

A quick fix for your problem is to change the entry as needed and update your desktop file database.

Changing the entry can be done as root in a terminal this way:

sed -i -e 's/^MimeType=/X-XFCE-MimeType=/' \
     /usr/share/applications/exo-file-manager.desktop \
     /usr/share/applications/exo-mail-reader.desktop \

I have prepared a package with the fixed bug in my PPA, so you can install it (you may need to wait till it builds btw) (https://launchpad.net/~phobosk/+archive/phobosk-ppa)

Please let someone with the necessary permissions to upload this to the proper natty updates repos... (you can find the debdiff and all needed files in my PPA)

PhobosK (phobosk) on 2011-08-23
Changed in xdg-utils (Ubuntu):
status: Confirmed → Invalid
Changed in unity-place-files (Ubuntu):
status: Confirmed → Invalid
Changed in unity (Ubuntu):
status: Incomplete → Invalid
Changed in unity-lens-files:
status: Confirmed → Invalid
Changed in unity-2d:
status: Confirmed → Invalid
Changed in unity:
status: Incomplete → Invalid
Changed in exo:
status: New → Confirmed
PhobosK (phobosk) wrote :

BTW in order this fix to end up quickly in the updates repos, a confirmation that it works is needed,
so please test and report back if the solution works for you :)

I personally tested it in GNOME and in XFCE and it works ok.

Subharo Bhikkhu (subharo) wrote :

The bug seems to be that Nautilus cannot open a URI beginning with "file:///" that includes a filename at the end. Here's how to easily reproduce the bug:

1. Install Thunar (which does not have this bug).

2. Choose or create an arbitrary file (say, from LibreOffice Writer), let's say "/home/myuser/Documents/foo.odt"

3. Can Nautilus open this file for us, if we pass a "file:///" URI to it as an argument? Open a Terminal. Ctrl+Alt+T.

4. Try opening the file with this command to see the error dialog appear:
      nautilus file:///home/myuser/Documents/foo.odt

5. Now do it again, removing the filename off the end:
      nautilus file:///home/myuser/Documents/

      ...and now Nautilus will open that folder! So it's proven that Nautilus doesn't like the filename on the end of the URI.

6. Let's try step 4 again, but this time with Thunar:
     thunar file:///home/myuser/Documents/foo.odt

     ...and now Thunar will properly open the file directly into LibreOffice (like Nautilus should). Bad Nautilus!

7. As a workaround, set Thunar to be Unity's default File browser, with the command:

     ...then go to the "Utilities" tab, and set the File Manager to "Thunar," and "Close"

PhobosK (phobosk) wrote :

@Subharo Bhikkhu,

Nautilus is not intended to handle such kind of behaviour (opening a file from the command line) at all (look at the code in src/nautilus-window-manager-views.c/.h). The proper file handling is done by 'gnome-open'.

Anyway, if you believe this is a nautilus bug just open a new bug upstream, 'cause the one we are talking about here is the exo-utils wrong XDG file handler install that actually brings us this error...

Subharo Bhikkhu (subharo) wrote :

OK, here's how to reproduce the bug from a default Ubuntu install:

(Note: When Ubuntu is installed by default, there is only one file browser, Nautilus. In the "Preferred Applications" utility (easily searched for in the Launcher), there is no place to specify one's favorite File Manager/File Browser. But a graphical utility to set this does exist, unbeknownst to most users, called "exo-preferred-applications". But there's no icon ever presented for this in the Launcher. You can run "exo-preferred-applications" from the command line.)

1) In a Terminal, run "exo-preferred-applications". Go to the "Utilities" tab, and note that the "File Manager" is set, by default, to "No application selected". In this state, the bug does not occur. Close "exo-preferred-applications" for now.

2) Install a second File Manager/File Browser, say, Thunar.

3) In Firefox, download some file, say a .pdf. Once downloaded, double-click the .pdf in the "Downloads" window to try to open it. Now there are two possible File Managers to pick from, so a dialog is presented for you to select your default File Manager (see screenshot). Choose Nautilus, and click OK. NOW THE BUG IS IN EFFECT! And you'll promptly be presented with the error message window ('Could not display "/home/myuser/Downloads/sample.pdf" The location is not a folder'), instead of the .pdf opening properly. And now you'll also be screwed in the way the original poster of this bug explained: no files can be launched from the "Files & Folders" utility either (in the Dash, or Launcher).

4) Open "exo-preferred-applications" again. Go to the "Utilities" tab, and note that the "File Manager" is now set to Nautilus. And you can't choose "No application selected" anymore, you can only select between Nautilus and Thunar. So you can't go back to the state before the bug occurred. But you can set Thunar to be the default File Manager, as a workaround.

Now, PhobosK, do you see the relevance of my previous post? It nailed down exactly where this error occurs, and explains why the workaround works.

Most Ubuntu users will never install a second File Manager, and therefore never run into this bug. But I had to install Thunar, as a workaround to another Nautilus bug: https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/574693

The solution to this issue might need to be twofold:

1) Allow the selecting of preferred File Manager in the "Preferred Applications" utility. And the default should be "Nautilus", not "No application selected".

2) Nautilus should successfully open URI's beginning with "file:///" and ending with a filename, just like Thunar can, as per my previous post.

And perhaps a better title for this bug (although I know it's way too long) might be 'Launcher/Dash can't directly open files, unless 'File Manager' is set to "No application selected" in "exo-preferred-applications"'

PhobosK (phobosk) wrote :
Download full text (3.3 KiB)

@Subharo Bhikkhu,
I got what you are trying to explain... The problem is that you are wrong...
And i will try to explain you why...

1. 'exo-preferred-applications' is part of XFCE4 and is installed because by default Ubuntu installs 'xfce4-terminal' that depends on the 'exo-utils' package. Actually 'exo-preferred-applications' is part of 'exo-utils' package. It is intended to be used in XFCE only

2. Every application should be XDG compliant and should use its specifications. According to these specs an app may install a .desktop file and claim handling of a specific mime type by adding to its .desktop file an entry named 'MimeType' (http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.0.html and other resources)

3. In this particular bug/case 'exo-utils' adds the /usr/share/applications/exo-file-manager.desktop which claims the file:// scheme to be handled by "exo-open --launch FileManager %u":

[Desktop Entry]
Exec=exo-open --launch FileManager %u

'--launch FileManager' here means use the file manager chosen by 'exo-preferred-applications'... so if you have chosen Nautilus there, practically files will be started by this command:

nautilus file:///example_text_file.txt

4. Nautilus cannot open files using the 'file://" schema.... It opens only folders when using this schema...

5. Thunar on the contrary CAN open files this way... (like thunar file:///.... )
That is why you can open files using Thunar and cannot by using Nautilus....

6. Now most gnome applications use "gnome-open" internally to detect which program to use to open a file. It is part of the 'libgnome2-0' package.... The problem here in this bug is that gnome-open always complies to XDG specs and uses the /usr/share/applications/exo-file-manager.desktop to open files (this .desktop file had already claimed that it will do that). The fail comes because of Nautilus (see number 4)

7. To fix all this mess the /usr/share/applications/exo-file-manager.desktop needs to be fixed as the 'MimeType=' entry, should be rewritten as: 'X-XFCE-MimeType=' which means: "claim to open all files using 'xdg-open --launch FileManager' ONLY if we are in XFCE"

So in a few words... the bug exists because when some app tries to open the file /tmp/test.txt for example, the following happens when in GNOME:

A: When nautilus is selected in exo-preferred-applications

gnome-open /tmp/test.txt -> xdg-open --launch FileManager /tmp/test.txt -> nautilus /tmp/test.txt -> nautilus is not able to open files -> error 'Location is not a folder'

B: When Thunar is selected in exo-preferred-applications

gnome-open /tmp/test.txt -> xdg-open --launch FileManager /tmp/test.txt -> thunar /tmp/test.txt -> file is opened ok

When you are in XFCE things work ok without this bug...

Anyway this bug should be fixed as i described in my post #14 (and as i already said the fixed exo package is in my PPA and have been tested to work ok in GNOME and XFCE)

I am sorry if my explanations are a kinda unclear or too simplified but i cannot explain it better...

So t...


Subharo Bhikkhu (subharo) wrote :

PhobosK: I tried your fix, but it didn't work. Here's what I did.

1) Added your PPA: https://launchpad.net/~phobosk/+archive/phobosk-ppa
2) apt-get update; apt-get install exo-utils # ...and I could see exo-utils downloading from your PPA)
3) ran "exo-preferred-applications". Changed "File Manager" from "Thunar" back to "Nautilus". Pressed "Close" button.
4) Tried to launch a file from the Dash. Same error message as before! "The location is not a folder"

PhobosK: does your fix only "save" users who haven't yet gotten into the situation I'm in (where "exo-preferred-applications" has it's File Manager changed from "No application selected" to "Nautilus")? I'm not sure what your fix does, as experienced by the end user (in my steps that reproduced the bug). Does your fix prevent users from being asked to choose the default file manager in the first place (when they're not in XFCE, as was my case)?

Is there any fix to get people like me out of the situation we're currently in, perhaps somehow putting "No application selected" back into place in "exo-preferred-applications", or some other config file?

PhobosK (phobosk) wrote :

All my fix does is change the 'MimeType=' entry to 'X-XFCE-MimeType=' (in the 3 files: /usr/share/applications/exo-file-manager.desktop, /usr/share/applications/exo-mail-reader.desktop , /usr/share/applications/exo-web-browser.desktop)

Since you have already used the broken 'exo-preferred-applications', probably it has put some wrong entries into your:

So do:
grep 'exo' ~/.local/share/applications/mimeapps.list

and if it finds any such entries, please open that file and delete them manually, save the file and then do:

That (deleting the entries in mimeapps.list + installing my PPA's exo-utils) should fix everything.

So my fix is a kinda preventing users that never started 'exo-preferred-applications'....
If they had already used it, a manual delete of all exo entries in ~/.local/share/applications/mimeapps.list is needed and then update of desktop database...

And please never use Nautilus for opening files from command line... It will not open them... It opens only folders...
Use gnome-open, xdg-open, exo-open or kde-open (best choice is xdg-open that is a desktop sensitive open application) instead....

PhobosK (phobosk) wrote :

P.S. Sorry the needed command for update desktop database is:

update-desktop-database ~/.local/share/applications

Subharo Bhikkhu (subharo) wrote :

Most appreciated, PhobosK. That worked.

If unity or something else is calling xdg-open that is a bug. It
should use g_app_info_launch_default_for_uri() or other suitable GIO

PhobosK (phobosk) wrote :

@Mikkel Kamstrup Erlandsen,
I am not much into unity's internal code... 'cause i do not like it and I do not use it at all...

But actually considering this bug, it doesn't matter if it uses the GAppInfo class or xdg-open because g_app_info_launch_default_for_uri() is launching the default app registered to handle the specified file/uri, and in this case exo when installed registers as the default handler for any file ...
So this causes a system wide problem when opening files and thus breaking every single app that uses this class' func or xdg/gnome/exo etc open... thus none of the app work as expected... evo cannot open attachments, dash is not working etc....

That is why this needs to be fixed in the repos...
The problem is that a manual removal of the entries of the registered exo in user profile is needed and this cannot be handled by a package install as far as i am aware :S....

PhobosK (phobosk) wrote :

To all others that run across this bug:



There are 3 basic possible solutions for you... I list them from preferred to less preferred:

NOTE: All solutions need you first to REMOVE any exo entry in your '~/.local/share/applications/mimeapps.list' file. Do that as an user (NOT as root) by:
               1. grep 'exo' ~/.local/share/applications/mimeapps.list
               2. open the file ~/.local/share/applications/mimeapps.list in a text editor and manually remove all entries found by (1),
                   save the file
               3. update-desktop-database ~/.local/share/applications

THEN select ONE of the following options:

1. Update your repos and update the exo-utils package (this solution will ONLY work when the proposed fix hits the repos, so at the time of this writing it is not available and not working!)

2. Add my PPA (https://launchpad.net/~phobosk/+archive/phobosk-ppa) to your repos, update them and update exo-utils package

3. AS ROOT edit the affected .desktop files by running:
          sed -i -e 's/^MimeType=/X-XFCE-MimeType=/' \
                         /usr/share/applications/exo-file-manager.desktop \
                         /usr/share/applications/exo-mail-reader.desktop \



And you should get rid of this bug...

thomas (thomas-heuer) wrote :

Update: This bug is still existing in Ubuntu 11.10. Now there isn't an error-message anymore ("The location is not a folder."), but instead the folder, in which the file is located is opened in a file-manager. I still want to open files from the dash and still it is not possible.

Changed in unity:
status: Invalid → New
Changed in unity (Ubuntu):
status: Invalid → New
PhobosK (phobosk) wrote :

yeah the problem should exist in 11.10, because they use an older version of XFCE that has the bug i have described above upstream...
It seems no one cares to fix it, here though the solution is very easy...

Anyway the fix i have described in my post #27 ( https://bugs.launchpad.net/ubuntu/+source/unity-place-files/+bug/751374/comments/27 ) should work for you -> use solution 3 (the one with .desktop edit as root). Just follow the steps described there (#27)...

I am sorry that i have not uploaded any oneiric fix in my PPA, but i do not plan to upgrade to 11.10 anytime soon 'cause Oneiric is even buggier than Natty...

PhobosK (phobosk) wrote :

Oh... and BTW ... I will leave the unity (+ unity ubuntu) bug status as "new", though they should really be "Invalid", since as i've already explained it is an exo problem, not unity's one...
This way i hope someone at least will pay attention to this annoying bug and will commit the fix....

PhobosK (phobosk) wrote :

UPDATE: I am sorry i should apologize... I have looked the orig sources of an older version of exo, not the oneiric one where upstream has fixed it....

So this should be another kinda bug not related to exo..
Sorry again...

The attachment "The debdiff between exo-0.6.0-1 and exo-0.6.0-2" of this bug report has been identified as being a patch in the form of a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Omer Akram (om26er) wrote :

thomas, Could you login to a guest session or create a new user and test to tell if the issue happens afterwards.

Michael Terry (mterry) wrote :

Can anyone still affected by this in Ubuntu 11.10 please confirm that you are not just being affected by your cached mime preferences? I have double-confirmed that 11.10 ships a fixed exo and will mark this Fix Released if ya'll confirm the above.

Do the following:
1) grep 'exo' ~/.local/share/applications/mimeapps.list
2) If it finds any such entries, please open that file, delete them manually, and save the file
3) update-desktop-database ~/.local/share/applications

Thanks to PhobosK for the heroic debugging!

Changed in exo:
status: Confirmed → Incomplete
Michael Terry (mterry) wrote :

Oh, didn't see Omer's comment. Using a guest account is a more fool-proof test.

PhobosK (phobosk) wrote :

I think you should not mark this as "Fix Released", because the actual original bug was(and still is) in Natty and a fixed package for Natty is still not in the repos....
Anyway you know best...

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unity (Ubuntu):
status: New → Confirmed
Didier Roche (didrocks) on 2011-11-22
Changed in unity:
status: New → Confirmed
Ayke (ayke) wrote :

I have this bug too in oneiric, with XFCE and Nautilus file manager. Linking xdg-open to exo-open fixes the problem.

PhobosK (phobosk) wrote :

@Ayke van Laethem,
This is a very bad/dirty way to fix it....
You'd better stick to the above fixes... or one day you may end up with a totally broken "open file/folder/email/etc" ability of your system...

Stephen M. Webb (bregma) wrote :

Bug still has nothing to do with Unity (see comments)

Changed in unity:
status: Confirmed → Invalid
Changed in unity (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers