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

snap version gets "Permission denied" #79

Closed
rubberneck opened this issue Dec 15, 2018 · 49 comments · Fixed by #138
Closed

snap version gets "Permission denied" #79

rubberneck opened this issue Dec 15, 2018 · 49 comments · Fixed by #138
Labels
help wanted Extra attention is needed kind/bug Something isn't working

Comments

@rubberneck
Copy link

rubberneck commented Dec 15, 2018

This is on ubuntu 18.04.1

Expected behavior

lsd to give a listing

Actual behavior

$ lsd
cannot open directory'.': Permission denied (os error 13)
@rubberneck rubberneck added the kind/bug Something isn't working label Dec 15, 2018
@Peltoche
Copy link
Collaborator

Hi @rubberneck,

Thanks for the report! As each snap run into a specific namespace (or vm I really don't master the subject) it possible that your lsd doesn't have access to your filesystem.

Can you try to reinstall it with the --classic option?

sudo snap remove lsd
sudo snap instal lsd --classic

@rubberneck
Copy link
Author

Yes that works.

@frankkusel
Copy link

Hello.
I have the same problem as the OP, but the problem does not go away with the "--classic" addition to the install command. (I'm using Ubuntu 18.04.2)

@marxjohnson
Copy link

I'm having the same issue on Ubuntu 18.04. Trying to install with --classic doesn't help:

mark@coachz:~$ sudo snap install lsd --classic
Warning: flag --classic ignored for strictly confined snap lsd

@Peltoche
Copy link
Collaborator

Peltoche commented Mar 4, 2019

Hi @frankkusel and @marxjohnson ,

Thanks for the report!

I think I made some error in this commit -> 596d205
I move the confinement from strict to classic. Hoping to be able to remove the --classic option but it appear I was wrong...

I fix that ASAP.

@wrapperband
Copy link

wrapperband commented Mar 11, 2019

I'm having the same issue with Ubuntu 18.10 and lsd 0.13.0

sudo snap install lsd --classic
Warning: flag --classic ignored for strictly confined snap lsd

and

$ lsd
cannot open directory'.': Permission denied (os error 13)

and

$ sudo lsd
cannot access '.': Permission denied (os error 13)

@Peltoche
Copy link
Collaborator

Hi @wrapperband ,

Thanks for the report, I reopen the issue.

It's curious because this solution to worked previously. I need to dig a little more into the snap documentation.

@wrapperband
Copy link

wrapperband commented Mar 11, 2019

I just got it "working" by installing it with --devmode.

$ sudo snap install lsd --devmode

If that helps

@Peltoche
Copy link
Collaborator

Hi @wrapperband ,

Thanks for the input but I don't think it's a good practice to install with the devmode because you remove all the jail limitations. On only need a full access to the filesystem but we don't need the access to the network for example.

@wrapperband
Copy link

Cheers, that's why I said "working", in inverted comma's

@Booteille
Copy link

Booteille commented Mar 19, 2019

I have the same issue. Can't install the snap in classic mode.

@thexavier666
Copy link

Same issue with me. Ubuntu 18.04.

@vilhelmprytz
Copy link

I have same issue on Ubuntu 18.04.

@airfield20
Copy link

same issue here ubuntu 18.04

@krejcar25
Copy link

I can confirm it, I am on Ubuntu Server 18.04.2. --classic option didn't help, managed to get it installed and working with the --devmode as @wrapperband said.

@Peltoche
Copy link
Collaborator

Peltoche commented Apr 3, 2019

I seriously dont know how to fix this issue... Does someone have some knowledges about the snap permissions system?

@Peltoche Peltoche added the help wanted Extra attention is needed label Apr 3, 2019
@ralight
Copy link

ralight commented Apr 3, 2019

(I'm no snap expert!)

You have the snap set to strict confinement, which severely limits what it can access. You probably need to change it to classic, and make a request on forum.snapcraft.io for it to be granted classic status, which means it is essentially unconfined.

An example request: https://forum.snapcraft.io/t/request-for-classic-confinement-classic-snap-analyzer/5057

@ralight
Copy link

ralight commented Apr 3, 2019

For debugging this sort of thing more generally, you can use sudo journalctl --output=short --follow --all | sudo snappy-debug which will give you suggestions of what might be needed:

Log: apparmor="DENIED" operation="open" profile="snap.lsd.lsd" name="/home/user" pid=8988 comm="lsd" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
File: /home/user/ (read)
Suggestion:
* add 'home' to 'plugs

You could add home to your plugs section as it suggests, but then you still wouldn't have access to non-home files, nor hidden files in the home directory.

@lucyllewy
Copy link

lucyllewy commented Apr 3, 2019

@ralight that's too much to remember. Simply snappy-debug.security scanlog will suffice. ;-)

I'm just about to go look at the snapcraft.yaml to see what plugs are applied and will report back.

@lucyllewy
Copy link

lucyllewy commented Apr 3, 2019

right, @Peltoche , so you don't define any plugs in .snapcraft.yaml, so there are no permissions granted to your snap meaning it can only do things within itself.

apps:
  lsd:
    command: bin/lsd

You likely need at the minimum home to allow users to access files in their home folders:

apps:
  lsd:
    command: bin/lsd
    plugs:
      - home

You can also allow access to removable disks with removable-media:

apps:
  lsd:
    command: bin/lsd
    plugs:
      - home
      - removable-media

@kumavis
Copy link

kumavis commented May 21, 2019

@Peltoche
Copy link
Collaborator

Peltoche commented May 21, 2019

Hi everyone,

Thanks for the help, I will try your recommendations.

I will try the "home" and "removeable-media" plug for started but I think there will still have some issues with the /tmp folder for example.

@kakasal
Copy link

kakasal commented May 21, 2019

This is still an unresolved issue.

@LeoJhonSong
Copy link

@Peltoche thanks for replying, but as you can see from my screenshot,I have already triedsudo lsd and it did not work...

@Peltoche
Copy link
Collaborator

Peltoche commented Sep 9, 2019

Arf, indeed, my bad... And /bin/ls does work or not? Does lsd work with some another folder?

@LeoJhonSong
Copy link

Hi, I have tested some more folders, lsd woorks with some of them, some not, while /bin/ls with all of them, sudo is not needed for any folder. Here are my results for lsd:

✔️ /dev
/etc
✔️ /home
✔️ /home/leo
/home/leo/snap/gnome-calculator
/home/leo/snap/gnome-system-monitor
✔️ /lib
/media
/media/Windows (this is the mounted partition of my Windows system)
/mnt
/opt
✔️ /proc
/snap
✔️ /tmp
/usr
✔️ /usr/bin
/usr/share

This seems quite confussing for me.. I believe there are more folders which lsd does not work with and just tell me if you want to check some more folders 👍

@Peltoche
Copy link
Collaborator

Thanks for the tests. I'm a little lost too. I guess this is related to the snap jail. Can you try to re-install it with the --classic flag please? It should give it full access to the file system

@LeoJhonSong
Copy link

@Peltoche Yep I have tried that but unfortunately I got the bug which you have worked on.
image

But with option --devmode it works well 🤷‍♂️

@iddm
Copy link

iddm commented Sep 16, 2019

Happened to me on a lot of different machines, have it installed either with snap or apt-get or make install, does not matter. Just now it happened again in just-cloned repository in /tmp/git-repo.

@Peltoche Peltoche reopened this Oct 11, 2019
@jsj1027
Copy link

jsj1027 commented Nov 13, 2019

Recording here that this issue persists on Pop_OS 19.10(closely based on Ubuntu 19.10)

@hegonfelipe
Copy link

I got the same problem and solved by install tje package with dpkg.

@Peltoche
Copy link
Collaborator

I think I will end up by removing the package from snap and it will solve all the issues.

@LeoJhonSong
Copy link

@Peltoche Hi as I found there is .deb package available, I uninstalled my lsd installed from snap and reinstalled lsd with the .deb package. And surprisingly lsd works really fine now:tada:

lsd now works fine with every path I mentioned above!

Hi, I have tested some more folders, lsd woorks with some of them, some not, while /bin/ls with all of them, sudo is not needed for any folder. Here are my results for lsd:

/dev
/etc
/home
/home/leo
/home/leo/snap/gnome-calculator
/home/leo/snap/gnome-system-monitor
/lib
/media
/media/Windows (this is the mounted partition of my Windows system)
/mnt
/opt
/proc
/snap
/tmp
/usr
/usr/bin
/usr/share

This seems quite confussing for me.. I believe there are more folders which lsd does not work with and just tell me if you want to check some more folders

Congratulation! 🎉 I think we could close this issue now.

zwpaper pushed a commit to zwpaper/lsd that referenced this issue Aug 15, 2020
zwpaper added a commit to zwpaper/lsd that referenced this issue Aug 15, 2020
zwpaper added a commit to zwpaper/lsd that referenced this issue Aug 26, 2020
meain pushed a commit that referenced this issue Aug 26, 2020
@jonas-frey
Copy link

I'm using kubuntu 20.20, and the buggy lsd is still available through snap. Can you please remove it? I think that would save a lot of people the trouble of rediscovering the problem and eventually switching to the deb

@zwpaper
Copy link
Member

zwpaper commented Oct 5, 2020

@Peltoche what's your idea? As we did not support snap anymore, shall we remove it?
I noticed that you are the developer for lsd on snapcraft, could you help to do this?

@bhechinger
Copy link

If this snap is not going to be updated to a version that works properly could you please remove it? It only causes confusion.

@meain
Copy link
Member

meain commented Nov 5, 2020

From what I could understand, an app once published cannot be removed from the snap store.
https://forum.snapcraft.io/t/how-can-a-developer-remove-her-his-app-from-snap-store/512

@davidromerot
Copy link

I see this same issue (permission denied) when using lsd on Ubuntu 20.04 on Windows (WSL).
I installed lsd, last release, with dpkg.
Just in case, I ran it with sudo (because the errors indicated "permission denied"). It still did not work. It took forever, and threw a few "No such file or directory (os error 2)" errors.

@meain meain mentioned this issue Aug 2, 2021
@notjames
Copy link

notjames commented Aug 18, 2021

I just installed this tool last night. It's a great tool, but the greatness of it is moot if you can't list things you should be able to list. I installed it via snap and --classic did not fix the problem. BTW, I'm using Ubuntu 20.04.2 LTS.

@meain
Copy link
Member

meain commented Aug 22, 2021

The snap version has been discontinued and as of now we don't have any plans to update it. If you are using a ubuntu or any other debian derivative refer this section(https://github.com/Peltoche/lsd#on-ubuntu) of the readme on how to install lsd.


An app once published cannot be removed from the snap store. That is why it is still there.
https://forum.snapcraft.io/t/how-can-a-developer-remove-her-his-app-from-snap-store/512

@lsd-rs lsd-rs locked and limited conversation to collaborators Aug 22, 2021
@zwpaper zwpaper pinned this issue Nov 23, 2021
@meain meain unpinned this issue Jul 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.