Thanks mate. Yes, absolutely I have installed the cups snap on Ubuntu Core because, as you said, CUPS is not included in the immutable core of the OS.
I have investigated the things you mentioned.
On Ubuntu Core I ran:
snap connect printer-admin:cups-control cups:cups-control
and I got the same error:
error: snap "cups" has no slot named "cups-control"
Since my snap runs automatic checks using some cups admin commands, the log file /var/snap/cups/current/var/log/error_log
repeatedly shows this:
D [26/Jun/2023:23:36:16 +0200] [Client 12243] POST / HTTP/1.1
D [26/Jun/2023:23:36:16 +0200] cupsdSetBusyState: newbusy="Active clients", busy="Not busy"
D [26/Jun/2023:23:36:16 +0200] [Client 12243] Read: status=200, state=6
D [26/Jun/2023:23:36:16 +0200] [Client 12243] Authorized as root using PeerCred.
D [26/Jun/2023:23:36:16 +0200] [Client 12243] 2.0 CUPS-Get-Devices 1
D [26/Jun/2023:23:36:16 +0200] CUPS-Get-Devices
D [26/Jun/2023:23:36:16 +0200] cupsdIsAuthorized: username="root"
D [26/Jun/2023:23:36:16 +0200] [Client 12243] AppArmor profile is 'snap.printer-admin.printer-init'.
E [26/Jun/2023:23:36:16 +0200] [Client 12243] Unable to check snap context: (null): error running snapctl: cannot use --apparmor-label check with cups:cups-control
E [26/Jun/2023:23:36:16 +0200] [Client 12243] Returning HTTP Forbidden for CUPS-Get-Devices (no URI) from localhost
D [26/Jun/2023:23:36:16 +0200] [Client 12243] cupsdSendHeader: code=403, type="text/html", auth_type=0
D [26/Jun/2023:23:36:16 +0200] [Client 12243] HTTP_STATE_WAITING Closing for error 32 (Broken pipe)
D [26/Jun/2023:23:36:16 +0200] [Client 12243] Closing connection.
D [26/Jun/2023:23:36:16 +0200] cupsdSetBusyState: newbusy="Not busy", busy="Active clients"
I confirm that connecting to the cups-server
interface works. I ran the command:
snap connect printer-admin:cups-control cups:cups-server
and as you can see I successfully connect to the cups-server
interface
Interface Plug Slot Notes
cups printer-admin:cups cups:cups -
cups-control printer-admin:cups-control cups:cups-server manual
Now something seems happening but the server closes the connection with the client due to broken pipe errors:
D [27/Jun/2023:00:08:16 +0200] cupsdSetBusyState: newbusy="Active clients", busy="Not busy"
D [27/Jun/2023:00:08:16 +0200] [Client 12260] Server address is "/var/snap/cups/common/run/cups.sock".
D [27/Jun/2023:00:08:16 +0200] [Client 12260] Accepted from localhost (Domain)
D [27/Jun/2023:00:08:16 +0200] [Client 12260] Waiting for request.
D [27/Jun/2023:00:08:16 +0200] Expiring subscriptions...
D [27/Jun/2023:00:08:16 +0200] [Client 12260] POST / HTTP/1.1
D [27/Jun/2023:00:08:16 +0200] cupsdSetBusyState: newbusy="Active clients", busy="Active clients"
D [27/Jun/2023:00:08:16 +0200] [Client 12260] Read: status=200, state=6
D [27/Jun/2023:00:08:16 +0200] [Client 12260] No authentication data provided.
D [27/Jun/2023:00:08:16 +0200] [Client 12260] 2.0 CUPS-Get-Devices 1
D [27/Jun/2023:00:08:16 +0200] CUPS-Get-Devices
D [27/Jun/2023:00:08:16 +0200] cupsdIsAuthorized: username=""
D [27/Jun/2023:00:08:16 +0200] [Client 12260] Returning HTTP Unauthorized for CUPS-Get-Devices (no URI) from localhost
D [27/Jun/2023:00:08:16 +0200] [Client 12260] cupsdSendHeader: code=401, type="text/html", auth_type=0
D [27/Jun/2023:00:08:16 +0200] [Client 12260] WWW-Authenticate: Basic realm=\"CUPS\", PeerCred, Local trc=\"y\"
D [27/Jun/2023:00:08:16 +0200] [Client 12260] HTTP_STATE_WAITING Closing for error 32 (Broken pipe)
D [27/Jun/2023:00:08:16 +0200] [Client 12260] Closing connection.
D [27/Jun/2023:00:08:16 +0200] cupsdSetBusyState: newbusy="Not busy", busy="Active clients"
D [27/Jun/2023:00:08:16 +0200] cupsdSetBusyState: newbusy="Active clients", busy="Not busy"
D [27/Jun/2023:00:08:16 +0200] [Client 12261] Server address is "/var/snap/cups/common/run/cups.sock".
D [27/Jun/2023:00:08:16 +0200] [Client 12261] Accepted from localhost (Domain)
D [27/Jun/2023:00:08:16 +0200] [Client 12261] Waiting for request.
D [27/Jun/2023:00:08:16 +0200] cupsdSetBusyState: newbusy="Active clients", busy="Active clients"
D [27/Jun/2023:00:08:16 +0200] [Client 12262] Server address is "/var/snap/cups/common/run/cups.sock".
D [27/Jun/2023:00:08:16 +0200] [Client 12262] Accepted from localhost (Domain)
D [27/Jun/2023:00:08:16 +0200] [Client 12262] Waiting for request.
D [27/Jun/2023:00:08:16 +0200] [Client 12261] HTTP_STATE_WAITING Closing for error 32 (Broken pipe)
D [27/Jun/2023:00:08:16 +0200] [Client 12261] Closing connection.
D [27/Jun/2023:00:08:16 +0200] cupsdSetBusyState: newbusy="Not busy", busy="Active clients"
D [27/Jun/2023:00:08:16 +0200] cupsdSetBusyState: newbusy="Active clients", busy="Not busy"
D [27/Jun/2023:00:08:16 +0200] [Client 12263] Server address is "/var/snap/cups/common/run/cups.sock".
D [27/Jun/2023:00:08:16 +0200] [Client 12263] Accepted from localhost (Domain)
D [27/Jun/2023:00:08:16 +0200] [Client 12263] Waiting for request.
D [27/Jun/2023:00:08:16 +0200] [Client 12262] HTTP_STATE_WAITING Closing for error 32 (Broken pipe)
D [27/Jun/2023:00:08:16 +0200] [Client 12262] Closing connection.
D [27/Jun/2023:00:08:16 +0200] cupsdSetBusyState: newbusy="Not busy", busy="Active clients"
D [27/Jun/2023:00:08:16 +0200] [Client 12263] POST / HTTP/1.1
D [27/Jun/2023:00:08:16 +0200] cupsdSetBusyState: newbusy="Active clients", busy="Not busy"
D [27/Jun/2023:00:08:16 +0200] [Client 12263] Read: status=200, state=6
D [27/Jun/2023:00:08:16 +0200] [Client 12263] Authorized as root using PeerCred.
D [27/Jun/2023:00:08:16 +0200] [Client 12263] 2.0 CUPS-Get-Devices 1
D [27/Jun/2023:00:08:16 +0200] CUPS-Get-Devices
D [27/Jun/2023:00:08:16 +0200] cupsdIsAuthorized: username="root"
D [27/Jun/2023:00:08:16 +0200] [Client 12263] AppArmor profile is 'snap.printer-admin.printer-init'.
E [27/Jun/2023:00:08:16 +0200] [Client 12263] Unable to check snap context: (null): error running snapctl: cannot use --apparmor-label check with cups:cups-control
E [27/Jun/2023:00:08:16 +0200] [Client 12263] Returning HTTP Forbidden for CUPS-Get-Devices (no URI) from localhost
D [27/Jun/2023:00:08:16 +0200] [Client 12263] cupsdSendHeader: code=403, type="text/html", auth_type=0
D [27/Jun/2023:00:08:16 +0200] [Client 12263] HTTP_STATE_WAITING Closing for error 32 (Broken pipe)
D [27/Jun/2023:00:08:16 +0200] [Client 12263] Closing connection.
D [27/Jun/2023:00:08:16 +0200] cupsdSetBusyState: newbusy="Not busy", busy="Active clients"
D [27/Jun/2023:00:08:17 +0200] Expiring subscriptions...