Snap apps don't start, when /home is provided by a remote NFS server

Bug #1782873 reported by Michal Kukuča
This bug report is a duplicate of:  Bug #1662552: snaps don't work with NFS home. Edit Remove
32
This bug affects 7 people
Affects Status Importance Assigned to Milestone
snapd (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

My setup:
A server running Ubuntu 18.04, with LDAP, Kerberos and NFS.
Desktop clients running Ubuntu 18.04, with SSSD. Home directories are mounted via autofs from the server.

Everything seems to be working as expected: LDAP/Kerberos users can login, their home directory is available. idmapd works as expected.

Issue: Snap application fail to start. No error is displayed. Journal reports (in this particular case the gnome-calculator was launched):
júl 21 09:30:44 paulus gnome-calculator_gnome-calculator.desktop[2919]: cannot create user data directory: /home/michalmaria/snap/gnome-calculator/180: Stale file handle
júl 21 09:30:44 paulus kernel: nfs: RPC call returned error 13
júl 21 09:30:44 paulus kernel: nfs: RPC call returned error 13
júl 21 09:30:44 paulus kernel: audit: type=1400 audit(1532158244.380:70): apparmor="DENIED" operation="sendmsg" profile="/usr/lib/snapd/snap-confine" pid=2919 comm="snap-confine" laddr=10.0.1.99 lport=758 faddr=
júl 21 09:30:44 paulus kernel: audit: type=1400 audit(1532158244.380:71): apparmor="DENIED" operation="sendmsg" profile="/usr/lib/snapd/snap-confine" pid=2919 comm="snap-confine" laddr=10.0.1.99 lport=758 faddr=

The directory from the first line does exist (and will be created on launch if not present)
michalmaria@paulus:~$ ls -la /home/michalmaria/snap/gnome-calculator/180/
celkom 8
drwxr-xr-x 2 michalmaria domainadmins 4096 júl 21 08:52 .
drwxr-xr-x 4 michalmaria domainadmins 4096 júl 21 08:52 ..
---
ProblemType: Bug
ApportVersion: 2.20.9-0ubuntu7.2
Architecture: amd64
CurrentDesktop: GNOME
DistroRelease: Ubuntu 18.04
InstallationDate: Installed on 2018-05-14 (67 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
NonfreeKernelModules: wl
Package: snapd 2.33.1+18.04ubuntu2
PackageArchitecture: amd64
ProcEnviron:
 TERM=screen-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=sk_SK.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 4.15.0-23.25-generic 4.15.18
Tags: bionic
Uname: Linux 4.15.0-23-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:

_MarkForUpload: True

Revision history for this message
Michal Kukuča (michalmaria) wrote : Dependencies.txt

apport information

tags: added: apport-collected bionic
description: updated
Revision history for this message
Michal Kukuča (michalmaria) wrote : ProcCpuinfoMinimal.txt

apport information

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

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

Changed in snapd (Ubuntu):
status: New → Confirmed
Revision history for this message
Andrew Conway (acubuntuone) wrote :

This seems similar to https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1662552

The "fix" there is I believe only activated if you nfs mount /home at boot, not by using autofs.

I have the same problem - I also use autofs to mount particular users rather than all users (I want one local user who can log in in case of network problems)

My workaround is not to use any snap applications :-(

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

@Andrew, can you file a new bug about snapd not being autofs NFS aware? I recall when the NFS-awareness was implemented, autofs was called out as not being supported yet. A new bug would allow that work to be properly prioritized.

Revision history for this message
Andrew Conway (acubuntuone) wrote :

Jamie, I filed a new bug 1784774 as you requested. It feels like a duplicate of this bug.

Revision history for this message
Gabriel A. Devenyi (gadevenyi) wrote :

This bug is still present for AutoFS mounted homedirs.

The issue is NFS detection only happens at snapd start, and on boot no NFS shares are mounted yet.

If an AutoFS NFS user logs in, and then snapd is restarted, NFS support is enabled

Revision history for this message
tylerecouture (tylerecouture) wrote :

AutoFS mounted home drives using the process described here: https://help.ubuntu.com/community/Autofs#Wildcard_characters

Chromium won't run and I get a similar error: https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1884299

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.