Snap.cups.cupsd service failing to start

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.

While there is no way to prevent the cups snap from being pulled in, you can always disable it using the snap disable ... command (see snap help for details) that should at least quieten the log spam…

1 Like

Oh wow, thanks! I didn’t know about snap disable. That’s very helpful.

Now I need to decide how much I care about fixing the underlying issue in the cups snap or not.

You should definitely file a bug, it should not fail inside lxd… I sadly do not know where @till.kamppeter records bugs for the snap though, perhaps he can chime in pointing to the right place…

The snapping of CUPS is hosted at OpenPrinting, as for some time already CUPS itself. The snapping is separate, as it was started when CUPS was still at Apple. Here we go:

1 Like

Great thanks! gonna make an issue there.

https://github.com/OpenPrinting/cups-snap/issues/15 issue created here.