Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppImage: folders and some files don't open when double clicked #20

Open
pizzadude opened this issue May 18, 2019 · 62 comments
Open

AppImage: folders and some files don't open when double clicked #20

pizzadude opened this issue May 18, 2019 · 62 comments
Assignees
Labels
external bug/can't fix Bug caused by an external software and not related to Drill high priority

Comments

@pizzadude
Copy link

Linux distro
Linux Mint 19.1 Cinnamon

Build Version
1.131

  • Appimage? Yes.

Describe the bug
In Linux Mint 19.1 Cinnamon (which uses Nemo file manager) double clicking a directory does nothing, but opening files such as videos and pictures works. Opening .txt files does nothing also. In Mint, xed is the default text editor.

To Reproduce
Steps to reproduce the behavior:
Try to open a txt file or directory with default applications.

Expected behavior
Double clicking a directory should open with nemo, opening a text file should open with xed.

@yatima1460
Copy link
Owner

The only reason I can think why this happens is because by not having a default application set xdg-open will probably do nothing at all.
Other possible reasons are if they have root-like permissions or strange characters in the path (unlikely)

But pretty sure it's because Mint uses its own xdg implementation hidden behind xdg-open, so if possible to fix this I would need to check if the file opening succeeded and then if not use other implementations like Mint's one

@yatima1460
Copy link
Owner

yatima1460 commented May 18, 2019

Does the folder open if you type "xdg-open /full/path/to/folder"?

@pizzadude
Copy link
Author

Yes, they open fine with xdg-open.

@yatima1460
Copy link
Owner

Okay so we can exclude xdg-open implementations, I wonder if it's a permission problem or something else, in the next version I will try to implement a messagebox that pops up if the opening failed reporting the error, so you can report it here.

I will let you know when I've implemented the messagebox!

@yatima1460
Copy link
Owner

Maybe I will start a VM with Mint too

@pizzadude
Copy link
Author

Note that pictures and videos both open. My video player is SMPlayer and picture viewer is Nomacs, both sandboxed by firejail (symlinked to firejail in /usr/local/bin/) I didnt sandbox Nemo or Xed, which don't work.

@pizzadude
Copy link
Author

BTW despite these problems thanks for making this program, its the fastest GUI file searching tool I've used.

@yatima1460
Copy link
Owner

It seems distros based on Ubuntu have their own xdg-open too, maybe first trying that and then falling back to xdg-open in case it does not work would be a good idea 🤔

@yatima1460
Copy link
Owner

yatima1460 commented May 18, 2019

@pizzadude

Booted Mint in a VM to check this, got this error:

image

Works on .deb, does not work in AppImage, I will contact the AppImage creator, it's either an AppImage problem or xed doing something badly.

I recommend you to use the .deb until this gets fixed by them.

@yatima1460
Copy link
Owner

@pizzadude
Copy link
Author

pizzadude commented May 19, 2019

Thanks, the deb version works without issue when opening files and folders with xed and nemo. Also, you might want to change the name of the binary that goes into /usr/bin/ because drill is another program from a package that is available in the repositories, just in case other people have it installed so it doesn't conflict. Maybe change the /usr/bin/ binary to drill-gtk

@yatima1460 yatima1460 added the external bug/can't fix Bug caused by an external software and not related to Drill label May 19, 2019
@yatima1460 yatima1460 self-assigned this May 20, 2019
@yatima1460
Copy link
Owner

I don't know what to do with this, it truly seems an AppImage bug exporting the wrong environment variables

@yatima1460
Copy link
Owner

@probonopd any news about this?
Is it an AppImage bug or a Linux Mint bug?
Meanwhile I added a warning notice on my website
Thanks

@yatima1460
Copy link
Owner

I'm starting to believe the real culprit here is Python,
it seems if some environment variables are messed up, some Python software will not start

@yatima1460
Copy link
Owner

Linux Mint is the only distro that gave me problems with AppImage
The AppImage even works on Arch

@probonopd
Copy link

If an AppImage produces

then it is a bug in that AppImage and needs to be fixed by the creator of that AppImage (by bundling Python and all Python modules the application needs to run).

@yatima1460
Copy link
Owner

@probonopd The problem is that when a user finds a txt file on Linux Mint and double clicks it on Drill I open the file using xdg-open filepath and I get that error because the default text editor on Linux Mint is written in Python

@yatima1460
Copy link
Owner

So it seems like xdg-open still opens the Python software like it was in the AppImage and not outside?

That's where my knowledge about this ends

@probonopd
Copy link

Sorry, from your description I can't follow you. Can you describe, step-by-step, how to reproduce the issue using, e.g., linuxmint-19.1-cinnamon-64bit.iso?

@yatima1460
Copy link
Owner

yatima1460 commented Jun 12, 2019

Search for a text file on Drill on Linux Mint and double click it.
Nothing happens.

And the real error behind the scenes is:
image
(you could maybe see it if you run the AppImage from terminal, maybe not)

So the TL;DR is: using xdg-open path/to/textfile.txt on Linux Mint does not work because the default editor is written in Python and it seems the AppImage exports the wrong environment variables

@pizzadude
Copy link
Author

pizzadude commented Jun 12, 2019

It's a problem with directories also, not just text files.

Steps to reproduce:
Install Linux Mint 19.1 Cinnamon
Open Drill AppImage
Search for a folder or text file
Notice that it won't open

@yatima1460
Copy link
Owner

xed is written in Python but I wonder why directories don't open too, nemo is written in C no?
@pizzadude Can you reconfirm it on the latest AppImage?

https://github.com/yatima1460/Drill/releases/download/1.237/Drill-GTK-linux-x86_64-release-1.237.AppImage

@pizzadude
Copy link
Author

pizzadude commented Jun 12, 2019

@yatima1460 That appimage doesn't launch at all.


(AppImageLauncher:26782): GdkPixbuf-CRITICAL **: 19:13:42.216: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(AppImageLauncher:26782): GdkPixbuf-CRITICAL **: 19:13:42.216: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
/tmp/.mount_Drill-SiByZR/usr/bin//drill-search-gtk: line 2: /opt/drill-search-gtk/drill-search-gtk: No such file or directory

@yatima1460
Copy link
Owner

The fact that only Linux Mint has problems really makes me think about the entire distro not following Linux standards.

@pizzadude
Copy link
Author

I'm not too sure about that...

@probonopd
Copy link

Looks like the AppImage is seriously broken if it tries to open stuff from /opt:

/opt/drill-search-gt

@yatima1460
Copy link
Owner

yatima1460 commented Jun 13, 2019

@probonopd found a part of the problem

Creating the AppImage using pkg2appimage with a local .deb file results in a broken AppImage

Previously creating the AppImage manually worked, so first part of the problem is with pkg2appimage

The second part is still the AppImage exporting the wrong variables and not being able to run xed with xdg-open

@yatima1460
Copy link
Owner

@yatima1460
Copy link
Owner

@pizzadude
Copy link
Author

It launches, and I can search for stuff, but it has the same problem opening text files and folders as before. However, I noticed something. If I have xed already open, and try to open a text file, the text file opens. If xed is not open, it doesn't work and I get the encodings error.

@pizzadude
Copy link
Author

If you can't fix this that's okay with me as the deb version works fine.

@probonopd
Copy link

the AppImage exporting the wrong variables

Can you explain in one post what "wrong variables" are being exported so that I don't have to read through the whole long thread? Thanks. Likely you need to change the AppRun file or replace it with a custom launcher script.

@yatima1460
Copy link
Owner

@probonopd I will try to make a minimal AppImage that causes this bug

@yatima1460
Copy link
Owner

@pizzadude

Try this version, now I use gnome-open first if it's available instead of xdg-open.
gnome-open is how probably SoulSeekQt opens files

https://github.com/yatima1460/Drill/releases/download/1.251/Drill-GTK-linux-x86_64-release-1.251.AppImage

@pizzadude
Copy link
Author

pizzadude commented Jun 15, 2019

gnome-open is deprecated it seems.

See 'gio help open' for more info.

Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f0a84671f00 (most recent call first):
This tool has been deprecated, use 'gio open' instead.
See 'gio help open' for more info.

Failed to register: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
This tool has been deprecated, use 'gio open' instead.
See 'gio help open' for more info.

Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

@daviddoc
Copy link

daviddoc commented Jul 1, 2019

From version 1.245 I can't open folders, or some files. Other files (jpg) open flawlessly.
Versions 1.244 and below work.
Tried with Appimage, deb package and portable.
I'm using Kubuntu 19.04
I get this error:
Failed to launch preferred application for category "FileManager".
Failed to execute child process "/usr/lib/x86_64-linux-gnu/xfce/exo-1/exo-helper-1"

@yatima1460
Copy link
Owner

yatima1460 commented Jul 1, 2019

@daviddoc I know what causes this and it's very interesting, I now do that Drill first prefers the file opener of the system, like exo-open in the case of Kubuntu and then if everything fails it fallbacks to xdg-open

But it's funny how xdg-open actually works everywhere and the preferred system file opener does not

I think I will revert this change 🤔

@yatima1460 yatima1460 changed the title Folders and some files don't open when double clicked AppImage: folders and some files don't open when double clicked Jul 19, 2019
@yatima1460
Copy link
Owner

yatima1460 commented Jul 19, 2019

@probonopd @pizzadude

I confirm it happens only with the combination of AppImage + xed

So it's not a Linux Mint bug, but actually xed being complete garbage
(And a bit of Linux Mint's fault for choosing xed)

Any other text editor works flawlessly with AppImages

I installed xed on Fedora, set it as default text editor, with the binary it works, with the AppImage xed crashes

xed killed by SIGABRT

when calling with Drill:

xdg-open path/to/textfile.txt

The reason is probably xed using a global environment variable to launch (bad design) and at the same time the AppImage exporting a wrong one or something, pretty cursed

@probonopd
Copy link

Please see AppImage/AppImageKit#396

@yatima1460 yatima1460 reopened this Aug 1, 2019
@pizzadude
Copy link
Author

pizzadude commented Aug 15, 2019

btw i don't use mint cinnamon anymore, been using fedora kde for over a month and drill works fine on it...

...but this bug should probably still be fixed in case there's another mint cinnamon user in this universe who downloads this

@yatima1460
Copy link
Owner

This still bugs me to this day

@yatima1460
Copy link
Owner

yatima1460 commented Feb 7, 2020

@probonopd so any updates?
it's a Mint problem, Python problem, both?

Can I close this as not related to Drill?
Or can I do some black magic before running a file to maybe fix this at runtime?

@probonopd
Copy link

  • On Ubuntu 19.04 I can open txt files using Drill-v566-x86_64.AppImage just fine
  • Inside the Drill AppImage, I see no Python code

So I cannot reproduce the issue. (Maybe I don't understand what the issue is.)

Note that the AppRun file inside the AppImage does export the environment variables PYTHONHOME, PYTHONPATH, PYTHONDONTWRITEBYTECODE, and PYTHONPATH. If The Drill AppImage is used to launch a Python-based application, then this might cause trouble. Hence, using a custom bash script as AppRun which does not touch those variables might be preferable.

@yatima1460
Copy link
Owner

@probonopd The issue is when xed (a software written in python) is used as default text editor.
And even worse, it's the default text editor on Mint

@probonopd
Copy link

probonopd commented Feb 8, 2020

Try a custom AppRun bash script to launch Drill (inside the AppImage) instead of the current AppRun, I think that should solve it then.

yatima1460 added a commit that referenced this issue Jul 29, 2022
new crawling algorithm
AppImage fixes #20
fix #37
yatima1460 added a commit that referenced this issue Jul 29, 2022
new crawling algorithm
AppImage fixes #20
fix #37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external bug/can't fix Bug caused by an external software and not related to Drill high priority
Projects
None yet
Development

No branches or pull requests

4 participants