michaelrsweet / lprint

A Label Printer Application
https://www.msweet.org/lprint
Apache License 2.0
227 stars 31 forks source link

Ubuntu 22 - Avahi error loading server #89

Closed a10kiloham closed 1 year ago

a10kiloham commented 1 year ago

I've got Avahi running and am currently using CUPS to act as an Airprint server for my Zebra GX printer. I can add the printer via socket://192.168.x.x and test page printing works from lprint. However I'm trying to start the server and failing every time. I've tried reinstalling everyting including lprint via CUPS. The debug log is as follows (macmini is the local hostname of the Ubuntu server). It also failed with running sudo. Any ideas?

bash$ lprint server

I [2022-12-10T20:23:15.883Z] Starting log, system up 0 second(s), 0 printer(s), listening for connections on 'macmini.local:0'.
D [2022-12-10T20:23:15.883Z] Adding 'image/jpeg' to 'image/pwg-raster' filter.
D [2022-12-10T20:23:15.883Z] Adding 'image/png' to 'image/pwg-raster' filter.
I [2022-12-10T20:23:15.883Z] Listening for connections on '*:8004'.
I [2022-12-10T20:23:15.883Z] Listening for connections on '*:8004'.
D [2022-12-10T20:23:15.883Z] Adding 'application/vnd.lprint-test' to 'image/pwg-raster' filter.
D [2022-12-10T20:23:15.883Z] Adding resource for '/favicon.png'.
D [2022-12-10T20:23:15.883Z] Adding resource for '/navicon.png'.
D [2022-12-10T20:23:15.883Z] Adding resource for '/de.strings'.
D [2022-12-10T20:23:15.883Z] Adding resource for '/en.strings'.
D [2022-12-10T20:23:15.883Z] Adding resource for '/es.strings'.
D [2022-12-10T20:23:15.883Z] Adding resource for '/fr.strings'.
D [2022-12-10T20:23:15.883Z] Adding resource for '/it.strings'.
lprint: statefile='/var/snap/lprint/211/lprint.conf'
I [2022-12-10T20:23:15.883Z] Loading system state from '/var/snap/lprint/211/lprint.conf'.
D [2022-12-10T20:23:15.883Z] papplSystemFindPrinter(system=0x55a69a0de380, resource="/ipp/print/Zebra300dpi", printer_id=0, device_uri="(null)")
D [2022-12-10T20:23:15.883Z] papplSystemFindPrinter: Returning (nil)(none)
I [2022-12-10T20:23:15.883Z] Printer 'Zebra300dpi' at resource path '/ipp/print/Zebra300dpi'.
D [2022-12-10T20:23:15.883Z] [Printer Zebra300dpi] media-default=na_index-4x6_4x6in
D [2022-12-10T20:23:15.883Z] [Printer Zebra300dpi] orientation-requested-default=7(none)
D [2022-12-10T20:23:15.883Z] [Printer Zebra300dpi] print-color-mode-default=monochrome(0x0010)
D [2022-12-10T20:23:15.883Z] [Printer Zebra300dpi] print-content-default=auto(0x0001)
D [2022-12-10T20:23:15.883Z] [Printer Zebra300dpi] print-quality-default=4(normal)
D [2022-12-10T20:23:15.883Z] [Printer Zebra300dpi] print-scaling-default=auto(0x0001)
D [2022-12-10T20:23:15.883Z] [Printer Zebra300dpi] printer-resolution-default=300x300dpi
D [2022-12-10T20:23:15.883Z] [Printer Zebra300dpi] sides-default=one-sided(0x0001)
W [2022-12-10T20:23:15.883Z] [Printer Zebra300dpi] Driver does not support identification.
D [2022-12-10T20:23:15.883Z] [Printer Zebra300dpi] Driver supports raw printing of 'application/vnd.eltron-epl' files.
D [2022-12-10T20:23:15.883Z] [Printer Zebra300dpi] Driver reports ppm 60.
D [2022-12-10T20:23:15.883Z] [Printer Zebra300dpi] Driver reports ppm_color 0.
D [2022-12-10T20:23:15.883Z] [Printer Zebra300dpi] Driver provides small-48x48 icon in memory (5964 bytes).
D [2022-12-10T20:23:15.883Z] [Printer Zebra300dpi] Driver provides medium-128x128 icon in memory (6491 bytes).
D [2022-12-10T20:23:15.883Z] [Printer Zebra300dpi] Driver provides large-512x512 icon in memory (24908 bytes).
D [2022-12-10T20:23:15.883Z] [Printer Zebra300dpi] pdf-supported=false
D [2022-12-10T20:23:15.883Z] Adding resource for '/Zebra300dpi/icon-sm.png'.
D [2022-12-10T20:23:15.883Z] Adding resource for '/Zebra300dpi/icon-md.png'.
D [2022-12-10T20:23:15.883Z] Adding resource for '/Zebra300dpi/icon-lg.png'.
D [2022-12-10T20:23:15.883Z] Adding resource for '/Zebra300dpi/'.
D [2022-12-10T20:23:15.883Z] Adding resource for '/Zebra300dpi/cancel'.
D [2022-12-10T20:23:15.883Z] Adding resource for '/Zebra300dpi/cancelall'.
D [2022-12-10T20:23:15.883Z] Adding resource for '/Zebra300dpi/delete'.
D [2022-12-10T20:23:15.883Z] Adding resource for '/Zebra300dpi/config'.
D [2022-12-10T20:23:15.883Z] Adding resource for '/Zebra300dpi/jobs'.
D [2022-12-10T20:23:15.883Z] Adding resource for '/Zebra300dpi/media'.
D [2022-12-10T20:23:15.883Z] Adding resource for '/Zebra300dpi/printing'.
I [2022-12-10T20:23:15.884Z] Listening for connections on '/var/snap/lprint/common/lprint.sock'.
D [2022-12-10T20:23:15.884Z] Adding resource for '/style.css'.
D [2022-12-10T20:23:15.884Z] Adding resource for '/'.
D [2022-12-10T20:23:15.884Z] Adding resource for '/addprinter'.
D [2022-12-10T20:23:15.884Z] Adding resource for '/config'.
D [2022-12-10T20:23:15.884Z] Adding resource for '/security'.
I [2022-12-10T20:23:15.884Z] Starting system.
D [2022-12-10T20:23:15.884Z] Registering DNS-SD name 'LPrint' on 'macmini.local'
E [2022-12-10T20:23:15.884Z] Unable to register system, is the Avahi daemon running?
D [2022-12-10T20:23:15.884Z] [Printer Zebra300dpi] Registering DNS-SD name 'Zebra300dpi' on 'macmini.local'
E [2022-12-10T20:23:15.884Z] [Printer Zebra300dpi] Unable to register printer, is the Avahi daemon running?
michaelrsweet commented 1 year ago

Is "avahi-daemon" running? "ps ax | grep avahi" will show...

a10kiloham commented 1 year ago

Yep runs fine. I restarted it before and after each try but it's running without error always

michaelrsweet commented 1 year ago

Can you try the latest version of the LPrint snap?

a10kiloham commented 1 year ago

Hm, I tried to upgrade the snap and still seems to add the same message to my syslog

7387:Jan  3 14:09:58 thishost lprint.lprint-server[12848]: E [2023-01-03T14:09:58.844Z] Unable to register system, is the Avahi daemon running?
7388:Jan  3 14:09:58 thishost lprint.lprint-server[12848]: E [2023-01-03T14:09:58.844Z] [Printer Zebra300dpi] Unable to register printer, is the Avahi daemon running?

Any further debugging tips? I noticed a message earlier about apparmor but have since disabled that without any result.

audit: type=1107 audit(1672754998.838:34): pid=836 uid=103 auid=4294967295 ses=4294967295 subj=? msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/" interface="org.freedesktop.DBus.Peer" member="Ping" mask="send" name="org.freedesktop.Avahi" pid=12848 label="snap.lprint.lprint-server" peer_pid=828 peer_label="unconfined"
michaelrsweet commented 1 year ago

Hmm, how about:

sudo snap connect lprint:avahi-control
a10kiloham commented 1 year ago

Hm that seems to eliminate the error! I don't quite unerstand snap well enough but is there a way to make the persist across reboots? many thanks!!

michaelrsweet commented 1 year ago

That should persist across reboots. If not it is a snap bug (arguably all of the connect stuff should be done automatically when you install a snap, but apparently that isn't the snap folks' opinion...)