snap fails when the home directory path contains a symbolic link
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
New
|
Undecided
|
Unassigned |
Bug Description
I'm using microk8s and when it calls snap to run kubectl i get:
"cannot create user data directory: /home/user0815/
In strace we can see the truth:
...
4030046 openat(AT_FDCWD, "/", O_RDONLY|
4030046 mkdirat(4, "home", 0755) = -1 EEXIST (File exists)
4030046 openat(4, "home", O_RDONLY|
4030046 close(4) = 0
4030046 mkdirat(5, "user0815", 0755) = -1 EEXIST (File exists)
4030046 openat(5, "user0815", O_RDONLY|
4030046 close(5) = 0
4030046 write(2, "cannot create user data directory: /home/user0815/
...
and snap is actually the culprit (see the PID):
4030046 execve(
It wants to create my home directory (!?!?!?
Symlinks in the home directory path are quite common. Probably not at "snapcraft" or "ubuntu one".
So there are several flaws:
The program should not try to create the home directory
The algorithm to determine, if the directory exists, is inappropriate.
The error message is misleading as the issue does not have to do with the entire path /home/user0815/
An i don't want a visible application-
Snapd does not support using symlinks for home directories, in order to continue using snaps you need to setup a bind mount from /home/user0815 to wherever you actually have your home directory located. This can be done in /etc/fstab, etc.