Unable to start snap applications if user's home directory is not /home/$USER

Bug #1776800 reported by Omegamormegil
116
This bug affects 21 people
Affects Status Importance Assigned to Milestone
snapd
Confirmed
High
Unassigned
chromium-browser (Ubuntu)
Confirmed
Undecided
Unassigned
firefox (Ubuntu)
Confirmed
Undecided
Unassigned
lxd (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Users with home directories in /home/$USER can run snap application, but users in /home/users/$USER can't.

nate@WorkstationC:~$ snap --version
snap 2.32.8+18.04
snapd 2.32.8+18.04
series 16
ubuntu 18.04
kernel 4.15.0-22-generic
nate@WorkstationC:~$ echo $HOME
/home/users/nate
nate@WorkstationC:~$ which hello-world
/snap/bin/hello-world
nate@WorkstationC:~$ hello-world
cannot create nate data directory: /home/users/nate/snap/hello-world/27: Permission denied

Revision history for this message
Omegamormegil (omegamormegil) wrote :
Revision history for this message
R_volkmann (r-volkmann) wrote :

Affects me too in /local/home/$USER

$ snap --version
snap 2.32.9
snapd 2.32.9
series 16
ubuntu 16.04
kernel 4.4.0-128-generic

Revision history for this message
Bryan Quigley (bryanquigley) wrote :
Michael Vogt (mvo)
Changed in snapd:
importance: Undecided → High
Changed in snapd:
status: New → Triaged
Revision history for this message
Aivars Lauzis [LV] (lauzis) wrote :

- have related issue...

have git hook, that logs all commits from all projects into one log file splitted by date.
this works fine with git, and gui interfaces that are installed via apt-get, but snap package in this case "Git Kraken" is trying to write in different path, looks like that $HOME for snap application is not users home.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

This is a known limitation. We have some plans on how to change that but this is not something we can commit to this ubuntu cycle.

This is also listed on https://forum.snapcraft.io/t/limitations-in-snapd/9718

Changed in snapd:
status: Triaged → Confirmed
Revision history for this message
Erik Lönroth (erik-lonroth) wrote :
Revision history for this message
Olivier Tilloy (osomon) wrote :

This is becoming very visible with the default browser in Ubuntu (firefox) becoming a snap in 22.04. Can the snapd team comment on whether this is (still) on the roadmap?

Revision history for this message
Stefan Fleischmann (sfleischmann) wrote :

How can this be sitting around here for 3 years unassigned with *high* priority? And then apparently it's not even considered a blocker for replacing Firefox in Ubuntu 22.04 with the snap. Is it really that hard to fix or is just nobody paying attention to it?

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in chromium-browser (Ubuntu):
status: New → Confirmed
Changed in firefox (Ubuntu):
status: New → Confirmed
Changed in lxd (Ubuntu):
status: New → Confirmed
Paul White (paulw2u)
tags: added: bionic focal jammy
Alberto Mardegan (mardy)
Changed in snapd:
assignee: nobody → Alberto Mardegan (mardy)
status: Confirmed → In Progress
Revision history for this message
C. Jeffery Small (loyhz2ay-jeff-h670zbts) wrote :

Just to make sure the note is here, my home directory is not in /home at all, but located under /u which is a mount point for an external volume on another disk. I experienced the same problem trying to run a snap. Whatever the solution, it should be generalized to any $HOME location.

Revision history for this message
Erik Meitner (eamuwmath) wrote :

Any solution needs to work with multiple home folder locations that can be located anywhere. We've got 540 users spread among four different folders: /fac/, /grad/, /staff/, /visitor/.

Revision history for this message
Alberto Mardegan (mardy) wrote :

Hi Jeffrey and Erik!
  You are being heard :-) But this is not an easy task, and the amount of work required to support the case of home directories nested somewhere deeper inside /home is very different (read: lower) than that required to support home directories located elsewhere in the system.

We are first tackling the first problem, and this bug will be closed once that part is fixed. The bug that best describe your use-case is https://bugs.launchpad.net/snappy/+bug/1620771, so I recommend you to subscribe to that one.

Revision history for this message
Stefan Fleischmann (sfleischmann) wrote :

Hi Alberto, I'm glad to hear that there is some progress. Happy to test patches if you need feedback on something.

Revision history for this message
jelka (jlk-mb) wrote :

I can add to this one, same problems with remote directories for "home" that is not mounted as /home.
Weird that snap is that rigid, that it requires users to be mounted in /home/$USER and even more weird that there was not made an alternative firefox version, that does not run inside snap container in Ubuntu 22.04 LTS???
Large multi-user setups mostly run on remote directories for home and it would be unwise to use /home, due to potential clash with default location of local users home.

Revision history for this message
Darko Veberic (darko-veberic-kit) wrote :

this is a major showstopper at our institute. we have 60+ ubuntu desktops with nfs-mounted homes and were postponing the switch from the last lts to this one for a while. but this cannot go on forever while availability of firefox is, obviously, crucial. i would classify this bug as "critical" and "urgent".

Revision history for this message
Gabriel Devenyi (ace-staticwave) wrote :

@Darko, we had the same blocking issues for an institutional deployment. We ended up removing snapd and making modifications similar to this to install a deb version https://www.omgubuntu.co.uk/2022/04/how-to-install-firefox-deb-apt-ubuntu-22-04

Revision history for this message
reetp (jcrisp) wrote :

> You are being heard :-)

Really?

> But this is not an easy task

Alberto, it's not our fault that Ubuntu are having problems solving it. Ubuntu created the problem, not us.

They should have got it right from the start, but I guess it was difficult so they just chose to ignore it instead.

And now they are defaulting apps to snaps that *we can't run* because of their bugs that they created. Ridiculous.

Fundamentally a duplicate of https://bugs.launchpad.net/snapd/+bug/1620771 which was opened in September 2016.

That's 6 years ago, and I guess demonstrates the Ubuntu priorities and willingness to fix things.

Clearly the rush to foist snaps on people is a higher priority than that of those who can't install them.

Revision history for this message
Klaus Jaensch (klausj) wrote (last edit ):

We are using Autofs/NFSv4 mounted homes on mountpoint /homes on 25+ multi-user client computers. We decided to use a separate mountpoint to be able to use both NFS mounted and local homes.
The bug blocks an update to 22.04 LTS on these computers.

Revision history for this message
Alberto Mardegan (mardy) wrote :

Small update: we have now merged a change that allows snaps to work on system where the users' home directories are not /home/<user>/ but /home/<some>/<path>/<user/

If you are running such a system, you are welcome to try out snapd from our edge channel:

    snap refresh --channel=latest/edge snapd

then configure the homedirs location using the command

    # Real homes are located in /home/users/tom, /home/losers/dick,...
    snap set system homedirs=/home/users,/home/losers

Please report back on your (mis)fortunes. :-)

If your home directories are located somewhere else (not under /home), please subscribe to https://bugs.launchpad.net/snapd/+bug/1620771 instead.

Revision history for this message
Ubay Dorta Guerra (ubay) wrote :

Thanks Alberto, last update works for local users with local home directories.
Unfortunately keeps failing for nfs-mounted homes, even if the directories are /home/users/<user>.

The system tested is Ubuntu 22.04.

Revision history for this message
Michael Utech (mutech1234567890) wrote :
Download full text (7.8 KiB)

It's 2023 now, and I just ran across this problem. What is the solution?

I searched on Google and found people having variations of this or similar problems since 2018. That FIVE years.

The newest discussion I found on Google (and don't find anymore) explained that this is an issue with the Kernel and some cgroups. When upgrading the release to 22.10 and installing proposed kernels didn't help, I was about to uninstall Ubuntu that I just used to replace the outdated Macos on my kids computers. I told them Linux is faster, just as beautiful and there are no issues with random stuff not working.

By replacing APT packages with snaps you are forcing your users to use snaps. I have no quarrels with snap. Go ahead and replace Debian with it. But at least make them work for Gods sake.

If you don't care for human users and want to get big in cloud enterprise, that's fine too, just tell us that we're no longer relevant as users. I choose ubuntu exactly because I did not want to be bothered by having to fix my kids computers. I choose ubuntu for my work environment because it worked so far. I'm using Linux since it was first published. I have no sensibility that creating home directories in a place other than /home is a problem that will lead to basic programs such as browsers not working anymore.

When I see an error message "Permission denied", I expect to see a filesystem object with permissions denying access, not a directory to which that very user actually has full access.

This is the output of `mount`:

```

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=3874748k,nr_inodes=968687,mode=755,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=787660k,mode=755,inode64)
/dev/mapper/ubuntu--vg-ubuntu--lv on / type ext4 (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k,inode64)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=19470)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
ramfs on /run/credentials/systemd-sysusers.service type ramfs (ro,nosuid...

Read more...

Changed in snapd:
assignee: Alberto Mardegan (mardy) → nobody
status: In Progress → Confirmed
Revision history for this message
reetp (jcrisp) wrote :

> Small update: we have now merged a change that allows snaps to work on system where the users' home directories are not /home/<user>/ but /home/<some>/<path>/<user/

> If you are running such a system, you are welcome to try out snapd from our edge channel:
> snap refresh --channel=latest/edge snapd

sudo snap refresh --channel=latest/edge snapd
error: snap "snapd" is not installed

 systemctl status snapd
● snapd.service - Snap Daemon
     Loaded: loaded (/lib/systemd/system/snapd.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2023-03-21 14:26:26 CET; 28min ago
TriggeredBy: ● snapd.socket
   Main PID: 24213 (snapd)
      Tasks: 47 (limit: 4915)
     Memory: 421.5M
     CGroup: /system.slice/snapd.service
             └─24213 /usr/lib/snapd/snapd

> Please report back on your (mis)fortunes. :-)

They are manifold.

Worst release upgrade experience ever.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.