I have several LXD containers running Ubuntu 20.04 and 22.04 (on hosts running on both 20.04 and 22.04 as well) And all seem to have the same issue with the snap cups service failing to start:
[ubuntu:~] 6s 141 $ journalctl -u snap.cups.cupsd.service
Feb 20 15:59:34 lxd-container systemd[1]: Started Service for snap application cups.cupsd.
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/872/var/spool/tmp
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/872/var/run/certs
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/872/var/log
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/872/var/cache/fontconfig
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/common/etc/cups/ppd
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/common/etc/cups/ssl
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/common/run
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -m 0755 -p /run/cups
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + export LC_ALL=C.UTF-8
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + export LANG=C.UTF-8
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + export TMPDIR=/var/snap/cups/872/tmp
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/872/tmp
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + CUPSTMPDIR=/var/snap/cups/872/var/spool/tmp
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + [ -d /var/snap/cups/872/tmp ]
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + chown -R root.root /var/snap/cups/872/tmp
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + chmod -R u+rwX /var/snap/cups/872/tmp
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + rm -rf /var/snap/cups/872/tmp
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + [ -d /var/snap/cups/872/tmp ]
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + [ -d /var/snap/cups/872/var/spool/tmp ]
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + chown -R root.root /var/snap/cups/872/var/spool/tmp
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + chmod -R u+rwX /var/snap/cups/872/var/spool/tmp
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + rm -rf /var/snap/cups/872/var/spool/tmp
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + [ -d /var/snap/cups/872/var/spool/tmp ]
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/872/tmp
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + chown -R root.root /var/snap/cups/872/tmp
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + chmod -R 1777 /var/snap/cups/872/tmp
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/872/var/spool/tmp
Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + chown -R root.snap_daemon /var/snap/cups/872/var/spool/tmp
Feb 20 15:59:35 lxd-container cups.cupsd[6386]: chown: changing ownership of '/var/snap/cups/872/var/spool/tmp': Invalid argument
Feb 20 15:59:35 lxd-container systemd[1]: snap.cups.cupsd.service: Main process exited, code=exited, status=1/FAILURE
Feb 20 15:59:35 lxd-container systemd[1]: snap.cups.cupsd.service: Failed with result 'exit-code'.
Hostname and the directory name vary (the 872 is some other number) but the issue is the same.
I tried uninstalling the cups snap because I don’t need to print from these containers, but it gets pulled back in by the chromium (and firefox?) snap which I do need.
Having failed systemd services is causing headaches with our alerting/monitoring system so I would like to get to the bottom of why this is happening even if I don’t need cups itself.
Failing that if there’s a way to blacklist a particular snap from being pulled in by another snap that would be helpful. I couldn’t find anything relevant but I may have searched for the wrong terms.
I have only run into this issue on LXD containers, not on the hosts themselves, which also run both the chromium and firefox snaps, but where snap.cups.cupsd seems to load just fine.