Locally installed snaps have wrong permissions

$ sudo snap install eclipse_*_amd64.snap --classic --dangerous
eclipse 2024-09 installed

Starting it up fails:

/snap/eclipse/x2/bin/eclipse-wrapper: line 9: /snap/eclipse/x2/eclipse: Permission denied
/snap/eclipse/x2/bin/eclipse-wrapper: line 9: exec: /snap/eclipse/x2/eclipse: cannot execute: Permission denied

Permissions are set to root without read access for other users:

$ ls -l
total 723
-rw-r--r--  1 root root 507032 Nov 26 12:50 artifacts.xml
drwxr-xr-x  2 root root     38 Nov 26 12:51 bin
drwx------  4 root root    105 Nov 26 12:58 configuration
drwx------  2 root root      3 Nov 26 12:50 dropins
-rw-r--r--  1 root root  90144 Nov 26 12:50 eclipse
-rw-r--r--  1 root root    911 Nov 26 12:50 eclipse.ini
drwxr-xr-x  4 root root     40 Nov 26 12:58 etc
drwx------ 66 root root   3911 Nov 26 12:58 features
-rw-r--r--  1 root root 140566 Nov 26 12:50 icon.xpm
drwxr-xr-x  3 root root     43 Nov 26 12:51 meta
drwx------  5 root root    128 Nov 26 12:58 p2
drwx------ 13 root root  30573 Nov 26 12:58 plugins
drwx------  2 root root     42 Nov 26 12:58 readme
drwxr-xr-x  6 root root     89 Nov 26 12:58 usr

This does not happen when I snap install eclipse from the repository. I am on KUbuntu 24.10 and snapcraft 8.4.4 installed via snap.

1 Like

What happens when you do snap run eclipse with the locally installed snap?

/snap/eclipse/x2/bin/eclipse-wrapper: line 9: /snap/eclipse/x2/eclipse: Permission denied
/snap/eclipse/x2/bin/eclipse-wrapper: line 9: exec: /snap/eclipse/x2/eclipse: cannot execute: Permission denied

Well, the content of that snap is definitely broken, the binaries should surely have execution permission… Where did you get that snap file from ? (And why are you installing it that way (though this is irrelevant for the issue which is clearly on the packaging side, just out of curiosity))

It’s under Snapcrafters sadly. I am looking into it.

Well, the OP said it doesn’t happen when installing from the store, so let’s wait for an answer first, if the snap in the store works but this one doesn’t, there must be something wrong with that local snap (which is why I want to know where it comes from)

If I rebuilt without changes, I also get the wrong permissions. When I try to move files into FHS style folders or fix the permissions during priming, they are still wrong when installed. I have no idea why snapcraft behaves this erratic, but it means I can’t test anything because I can never launch the application.

Ah, so you built it yourself then, i wonder how the snapcrafters version in the store keeps the executable bits set then…

How exactly do you build it, what commands do you use?

I just typed snapcraft in the git root folder.

I had a working Eclipse installation under Ubuntu 24.04 until about an hour ago. I got some stupid message telling me to close the program so that it could apply an update, then when it completed with ā€œEclipse was updated.ā€ ā€œYou can open it now.ā€ it looks like I can’t open it now.

$ eclipse To override eclipse.ini, copy the default file to ā€˜/home/carlb/snap/eclipse/106/eclipse.ini’ and modify to suit. /snap/eclipse/106/bin/eclipse-wrapper: line 9: /snap/eclipse/106/usr/lib/eclipse/eclipse: Permission denied /snap/eclipse/106/bin/eclipse-wrapper: line 9: exec: /snap/eclipse/106/usr/lib/eclipse/eclipse: cannot execute: Permission denied

$ ls -l /snap/eclipse/106/usr/lib/eclipse/eclipse -rw-r–r-- 1 root root 90144 Nov 27 04:51 /snap/eclipse/106/usr/lib/eclipse/eclipse $ chmod a+x /snap/eclipse/106/usr/lib/eclipse/eclipse chmod: changing permissions of ā€˜/snap/eclipse/106/usr/lib/eclipse/eclipse’: Read-only file system

Removing and reinstalling the package fixes nothing.

$ mv /home/carlb/snap/eclipse /home/carlb/snap/eclipse.old $ sudo snap remove eclipse eclipse removed $ sudo snap install eclipse --classic eclipse 2024-09 from Eclipse Foundation (eclipsefoundationāœ“) installed $ eclipse To override eclipse.ini, copy the default file to ā€˜/home/carlb/snap/eclipse/106/eclipse.ini’ and modify to suit. /snap/eclipse/106/bin/eclipse-wrapper: line 9: /snap/eclipse/106/usr/lib/eclipse/eclipse: Permission denied /snap/eclipse/106/bin/eclipse-wrapper: line 9: exec: /snap/eclipse/106/usr/lib/eclipse/eclipse: cannot execute: Permission denied

So now I’ve gone from a working setup to something which will not launch at all, no fault of my own. Oh snap, it broke my computer…

Doing a snap revert worked for me. I’m back running again

$ snap revert eclipse

2 Likes

Could you please open a new topic (in the snap category I guess) instead of posting here, your issue is completely unrelated to building eclipse…

[Edit] oops, sorry @carlb I only glanced over the errors and saw the wrapper script error but not it’s cause, indeed your post is correct here… mea culpa

This is upstream issue. The snap is broken, and I think it’s due to wrong permissions in the files. Even rebuilding the snap from source will not get fixed, until the source itself is fixed!

Well, you can temporarily add a chmod +x in an override to work around the issue on a packaging level… Or at least unrelease the broken snap so people do not have to roll back

It’s not even shipped by us anymore. It’s under eclipse themselves.

1 Like

I can confirm that reverting gets it running again.

I have raised an issue on the new GitHub project page for eclipse-ide-snap: Latest eclipse snap doesn't launch Ā· Issue #1 Ā· eclipse-linuxtools/eclipse-ide-snap Ā· GitHub

The tarball has the correct permission, so this isn’t an upstream problem. Also, you can’t easily change permissions on /snap as a user because it is a read-only file system. I bodged this around quickly in the snap manifest now because so many people were affected. Sorry for that. We were testing permissions as the Eclipse foundation staff set everything up. I didn’t know that we were already in release mode, as I don’t have access to the https://snapcraft.io/snaps backend. Also, still not sure why snapcraft behaves this wonky, how to debug its behavior properly and where to report that.

1 Like

I could imagine that it tries to avoid having execution permissions in files underneath usr/lib for security reasons, but OTOH I’d also expect it to simply unpack the tarball and use it as is… Perhaps @mr_cal could shed some light on this, if it is in any way expected that files lose execution permission during snap build

/usr/lib was organized, it’s not originally from the tarball.