Snaps in multiuser system with NFS home


#21

The connection error is gone, but the permission error is still an issue.

 $  snap restore 1
 error: cannot perform the following tasks:
    - Restore data of snap "snappy-debug" from snapshot set #1 (stat /home/schneider/snap/snappy-debug/.snapshotPto8K6L8/common: permission denied)
    - Restore data of snap "snapcraft" from snapshot set #1 (stat /home/sauer/snap/snapcraft/.snapshotzJqIVdJo/common: permission denied)
    - Restore data of snap "rdplot" from snapshot set #1 (tar failed: context canceled)

and the debug output

2019/01/11 14:59:36.372535 daemon.go:296: DEBUG: pid=14458;uid=1459;socket=/run/snapd.socket;@ POST /v2/snapshots 3.51406749s 202
2019/01/11 14:59:36.373684 taskrunner.go:420: DEBUG: Running task 22971 on Do: Restore data of snap "rdplot" from snapshot set #1
2019/01/11 14:59:36.373723 taskrunner.go:420: DEBUG: Running task 22972 on Do: Restore data of snap "core" from snapshot set #1
2019/01/11 14:59:36.373755 taskrunner.go:420: DEBUG: Running task 22970 on Do: Restore data of snap "snapcraft" from snapshot set #1
2019/01/11 14:59:36.373792 taskrunner.go:420: DEBUG: Running task 22969 on Do: Restore data of snap "snappy-debug" from snapshot set #1
2019/01/11 14:59:36.466158 reader.go:277: DEBUG: Restoring "archive.tgz" from "/var/lib/snapd/snapshots/1_core_16-2.37~pre1_6233.zip" into "/var/snap/core/.snapshotwQeKRlhn".
2019/01/11 14:59:36.471698 reader.go:277: DEBUG: Restoring "archive.tgz" from "/var/lib/snapd/snapshots/1_snappy-debug_0.31.7-snapd2.34_243.zip" into "/var/snap/snappy-debug/.snapshotxv8C5LGY".
2019/01/11 14:59:36.482671 reader.go:277: DEBUG: Restoring "user/root.tgz" from "/var/lib/snapd/snapshots/1_snappy-debug_0.31.7-snapd2.34_243.zip" into "/root/snap/snappy-debug/.snapshotaC9efYsz".
2019/01/11 14:59:36.490467 reader.go:277: DEBUG: Restoring "user/sauer.tgz" from "/var/lib/snapd/snapshots/1_snapcraft_2.42.1_1594.zip" into "/home/sauer/snap/snapcraft/.snapshotzJqIVdJo".
2019/01/11 14:59:36.503722 reader.go:277: DEBUG: Restoring "user/meyer.tgz" from "/var/lib/snapd/snapshots/1_rdplot_v1.2.0+git6.3c8a530_18.zip" into "/home/meyer/snap/rdplot/.snapshot6niqcnr8".
2019/01/11 14:59:36.508912 reader.go:277: DEBUG: Restoring "user/schneider.tgz" from "/var/lib/snapd/snapshots/1_snappy-debug_0.31.7-snapd2.34_243.zip" into "/home/schneider/snap/snappy-debug/.snapshotPto8K6L8".
2019/01/11 14:59:36.519614 reader.go:182: Restore of snapshot "/var/lib/snapd/snapshots/1_snapcraft_2.42.1_1594.zip" failed (stat /home/sauer/snap/snapcraft/.snapshotzJqIVdJo/common: permission denied); undoing.
2019/01/11 14:59:36.528665 reader.go:182: Restore of snapshot "/var/lib/snapd/snapshots/1_snappy-debug_0.31.7-snapd2.34_243.zip" failed (stat /home/schneider/snap/snappy-debug/.snapshotPto8K6L8/common: permission denied); undoing.
2019/01/11 14:59:36.528683 restorestate.go:79: DEBUG: Removing "/var/snap/snappy-debug/common".
2019/01/11 14:59:36.528721 restorestate.go:79: DEBUG: Removing "/var/snap/snappy-debug/243".
2019/01/11 14:59:36.528741 restorestate.go:79: DEBUG: Removing "/root/snap/snappy-debug/common".
2019/01/11 14:59:36.528762 restorestate.go:79: DEBUG: Removing "/root/snap/snappy-debug/243".
2019/01/11 14:59:36.528810 restorestate.go:91: DEBUG: Restoring "/var/snap/snappy-debug/common.~G9V9YmgX2~" to "/var/snap/snappy-debug/common".
2019/01/11 14:59:36.528828 restorestate.go:91: DEBUG: Restoring "/var/snap/snappy-debug/243.~5bMgmHvB4~" to "/var/snap/snappy-debug/243".
2019/01/11 14:59:36.528842 restorestate.go:91: DEBUG: Restoring "/root/snap/snappy-debug/common.~6rqCS3yDn~" to "/root/snap/snappy-debug/common".
2019/01/11 14:59:36.528855 restorestate.go:91: DEBUG: Restoring "/root/snap/snappy-debug/243.~2cyNkMw9Y~" to "/root/snap/snappy-debug/243".
2019/01/11 14:59:36.587361 task.go:303: DEBUG: 2019-01-11T14:59:36+01:00 ERROR stat /home/sauer/snap/snapcraft/.snapshotzJqIVdJo/common: permission denied
2019/01/11 14:59:36.699198 task.go:303: DEBUG: 2019-01-11T14:59:36+01:00 ERROR stat /home/schneider/snap/snappy-debug/.snapshotPto8K6L8/common: permission denied
2019/01/11 14:59:36.912163 task.go:303: DEBUG: 2019-01-11T14:59:36+01:00 INFO Cannot clean up temporary directory "/home/meyer/snap/rdplot/.snapshot6niqcnr8": context canceled.
2019/01/11 14:59:37.023696 reader.go:182: Restore of snapshot "/var/lib/snapd/snapshots/1_rdplot_v1.2.0+git6.3c8a530_18.zip" failed (tar failed: context canceled); undoing.
2019/01/11 14:59:37.025956 task.go:303: DEBUG: 2019-01-11T14:59:37+01:00 ERROR tar failed: context canceled
2019/01/11 14:59:37.124783 taskrunner.go:420: DEBUG: Running task 22972 on Undo: Restore data of snap "core" from snapshot set #1
2019/01/11 14:59:37.239255 restorestate.go:79: DEBUG: Removing "/var/snap/core/common".
2019/01/11 14:59:37.239436 restorestate.go:79: DEBUG: Removing "/var/snap/core/6233".
2019/01/11 14:59:37.239555 restorestate.go:91: DEBUG: Restoring "/var/snap/core/common.~l7bBxNPmG~" to "/var/snap/core/common".
2019/01/11 14:59:37.239662 restorestate.go:91: DEBUG: Restoring "/var/snap/core/6233.~r46hCRjWF~" to "/var/snap/core/6233".

#22

Ah. Drat. That’s bad news.

I’ve just talked about this in the standup, and I’ll try to get to this towards the end of this cycle, but it won’t be part of 2.37 nor 2.38 I’m afraid.

In the meanwhile, one workaround for you (which might not be palatable…) would be to have snapd with the same snaps on the nfs server, refresh things there, and then refresh them in the clients while home is unmounted.

It’s increasingly hacky, I know. Sorry.


#23

Ok, thank you very much for your help. I think, we cannot do it like you proposed since the NFS server is running on a proprietary filer and this one will most probably not run snap out of the box.
I think I simple wait until these issues are solved;-).