Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUPS does not auto-discover IPP printers for temporary queues #47

Closed
tillkamppeter opened this issue Nov 17, 2020 · 16 comments
Closed

CUPS does not auto-discover IPP printers for temporary queues #47

tillkamppeter opened this issue Nov 17, 2020 · 16 comments
Assignees
Labels
bug Something isn't working platform issue Issue is specific to an OS or desktop priority-medium
Milestone

Comments

@tillkamppeter
Copy link
Member

I am using CUPS from this repository here at OpenPrinting, in an Ubuntu 20.10 environment with Avahi 0.8. cups-browsed is not running, also no CUPS Snap, the driverless utility used is of cups-filters 1.28.5.

I have several local IPP print services running: ipp-usb (with HP OfficeJet Pro 8730 connected to USB), the PostScript Printer Application (with printers "test", "test2", "test3", "test4", "test5", and "xxx") and ippeveprinter (started with ippeveprinter -p 8001 evetest).

The HP OfficeJet Pro 8730 is also connected to the network, so its IPP print service appears this way, too.

The running CUPS daemon (not the CUPS Snap) has several local CUPS queues.

Output of lpstat -e:

$ lpstat -e
authtest
drvlessfax
faxtest
HP-OfficeJet-Pro-8730
ippusbtest
office-local
OfficeJet-Pro-8730
pappl-test
pappl-test-e
Printer
Printer-HPLIP
snap-label
snap-test
test-tray2

The output shows only my permanent CUPS queues, no entries from the three local IPP print services.

$ lpstat -l -e
authtest permanent ipp://localhost/printers/authtest /dev/null
drvlessfax permanent ipp://localhost/printers/drvlessfax ipps://HP%20OfficeJet%20Pro%208730%20%5B08C229%5D._ipps._tcp.local/
faxtest permanent ipp://localhost/printers/faxtest ipp://localhost:60001/ipp/faxout
HP-OfficeJet-Pro-8730 permanent ipp://localhost/printers/HP-OfficeJet-Pro-8730 ipps://HP%20OfficeJet%20Pro%208730%20%5B08C229%5D._ipps._tcp.local/
ippusbtest permanent ipp://localhost/printers/ippusbtest ipp://HP%20OfficeJet%20Pro%208730%20%5B08C229%5D%20(USB)._ipp._tcp.local/
office-local permanent ipp://localhost/printers/office-local ipp://Office%20Printer._ipp._tcp.local/
OfficeJet-Pro-8730 permanent ipp://localhost/printers/OfficeJet-Pro-8730 ipps://HP%20OfficeJet%20Pro%208730%20%5B08C229%5D._ipps._tcp.local/
pappl-test permanent ipp://localhost/printers/pappl-test ipp://till-x1yoga.local:8000/ipp/print/Inkjet%20Printer
pappl-test-e permanent ipp://localhost/printers/pappl-test-e ipp://Inkjet%20Printer._ipp._tcp.local/
Printer permanent ipp://localhost/printers/Printer ipps://HP%20OfficeJet%20Pro%208730%20%5B08C229%5D._ipp._tcp.local/
Printer-HPLIP permanent ipp://localhost/printers/Printer-HPLIP hp:/usb/HP_OfficeJet_Pro_8730?serial=CN783F60W1
snap-label permanent ipp://localhost/printers/snap-label ipp://Label%20Printer._ipp._tcp.local/
snap-test permanent ipp://localhost/printers/snap-test ipp://HP%20OfficeJet%20Pro%208730%20%5B08C229%5D._ipp._tcp.local/
test-tray2 permanent ipp://localhost/printers/test-tray2 ipp://localhost:631/printers/test-tray
$ lpstat -l -e | grep -v permanent

Here one also sees that all entries in the output are "permanent", none "temporary".

So no temporary queues are listed for the local IPP services, which is the issue I want to report here.

More info:

$ ippfind
ipp://till-x1yoga.local:631/printers/OfficeJet-Pro-8730
ipp://till-x1yoga.local:631/printers/HP-OfficeJet-Pro-8730
ipp://HP18602408C229.local:631/ipp/print
ipp://till-x1yoga.local:60000/ipp/print
ipp://till-x1yoga.local:631/printers/faxtest
ipp://till-x1yoga.local:631/printers/Printer-HPLIP
ipp://till-x1yoga.local:631/printers/pappl-test-e
ipp://till-x1yoga.local:631/printers/office-local
ipp://till-x1yoga.local:631/printers/Printer
ipp://till-x1yoga.local:631/printers/authtest
ipp://till-x1yoga.local:631/printers/drvlessfax
ipp://till-x1yoga.local:8001/ipp/print
ipp://till-x1yoga.local:631/printers/ippusbtest
ipp://till-x1yoga.local:631/printers/pappl-test
ipp://till-x1yoga.local:631/printers/snap-label
ipp://till-x1yoga.local:631/printers/snap-ps
ipp://till-x1yoga.local:8000/ipp/print/test
ipp://till-x1yoga.local:631/printers/test-tray2
ipp://till-x1yoga.local:8000/ipp/print/test2
ipp://till-x1yoga.local:8000/ipp/print/test3
ipp://till-x1yoga.local:8000/ipp/print/test4
ipp://till-x1yoga.local:8000/ipp/print/test5
ipp://till-x1yoga.local:8000/ipp/print/xxx
$ driverless
ipp://HP%20OfficeJet%20Pro%208730%20%5B08C229%5D%20(USB)._ipp._tcp.local/
ipps://HP%20OfficeJet%20Pro%208730%20%5B08C229%5D._ipps._tcp.local/
ipps://evetest._ipps._tcp.local/
ipps://test._ipps._tcp.local/
ipps://test2._ipps._tcp.local/
ipps://test3._ipps._tcp.local/
ipps://test4._ipps._tcp.local/
ipps://test5._ipps._tcp.local/
ipps://xxx._ipps._tcp.local/

ippfind and driverless list all these services correctly, so they are correctly DNS-SD registered and CUPS should list them as destinations for temporary queues.

@tillkamppeter
Copy link
Member Author

This seems to be a timeout issue. If I do the following change (set timeout for all DNS-SD-advertised printers to be found from 250 msec to 5 sec)

diff --git a/cups/dest.c b/cups/dest.c
index 2017792a7..c91ea9c0f 100644
--- a/cups/dest.c
+++ b/cups/dest.c
@@ -57,7 +57,7 @@
 #endif /* __APPLE__ */
 
 #if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
-#  define _CUPS_DNSSD_GET_DESTS 250     /* Milliseconds for cupsGetDests */
+#  define _CUPS_DNSSD_GET_DESTS 5000     /* Milliseconds for cupsGetDests */
 #  define _CUPS_DNSSD_MAXTIME  50      /* Milliseconds for maximum quantum of time */
 #else
 #  define _CUPS_DNSSD_GET_DESTS 0       /* Milliseconds for cupsGetDests */

All printers appear in the output of lpstat -e, but lpstat -e takes 5 sec to complete.

@tillkamppeter
Copy link
Member Author

I can also print to the Printer Application with CUPS, using a command like

lp -d test3 ~/ghostscript/testfiles/CityMap.pdf

only the command takes several seconds for sending this small job.

@michaelrsweet
Copy link
Member

I'm guessing this is probably libcups trying to filter out local queues. I can update it to look at the TXT record and only exclude CUPS queues.

@michaelrsweet michaelrsweet self-assigned this Nov 18, 2020
@michaelrsweet michaelrsweet added bug Something isn't working priority-medium labels Nov 18, 2020
@michaelrsweet michaelrsweet added this to the v2.3.3op1 milestone Nov 18, 2020
@tillkamppeter
Copy link
Member Author

tillkamppeter commented Nov 18, 2020

It seems not to filter out queues at all. The output of lpstat -e with the longer timeout looks like this:

$ lpstat -e
authtest
drvlessfax
drvlessfax_till_x1yoga
faxtest
HP-OfficeJet-Pro-8730
HP_OfficeJet_Pro_8730_08C229_
HP_OfficeJet_Pro_8730_08C229_till_x1yoga
HP_OfficeJet_Pro_8730_08C229_USB_
HP_OfficeJet_Pro_8730_fully_driverless_till_x1yoga
HP_OfficeJet_Pro_8730_till_x1yoga
HPLIP_Test_till_x1yoga
Inkjet_Printer_till_x1yoga
ippusbtest
ippusbtest_till_x1yoga
office-local
Office_Printer_till_x1yoga
OfficeJet-Pro-8730
pappl-test
pappl-test-e
pappl_test_till_x1yoga
Printer
Printer-HPLIP
Printer_till_x1yoga
snap-label
snap-test
snap_label_till_x1yoga
test
test-tray2
test2
test3
test4
test5
test_tray_till_x1yoga
xxx

You see that the queue of the PostScript Printer Application show up now (I did not have ippeveprinter running this time).
Also the two IPP incarnations (network and IPP-over-USB) of my HP OfficeJet Pro 8730 show (HP_OfficeJet_Pro_8730_08C229_ and HP_OfficeJet_Pro_8730_08C229_USB_ appear.
Each CUPS queue apears twice, once directly (for example Printer) and once picked up through DNS-SD (for example Printer_till_x1yoga and all the others ending with _till_x1yoga), the latter should be suppressed.

With the original timeout setting all DNS-SD-discovered entries disappear for me, only having the direct CUPS queue entries remaining.

So there are two problems:

  • DNS-SD discovery takes too long
  • Suppressing of local CUPS queues does not work

Note also that not all local services should be suppressed, only local CUPS queues (safest is to compare UIID with direct CUPS queue entries, this I do in cups-browsed).

@michaelrsweet
Copy link
Member

OK, so I did some initial testing on macOS and it works as expected with mDNSResponder. Now testing on Ubuntu 20.04 (what my XPS13 is loaded with at the moment) to see how things work with Avahi 0.8...

@michaelrsweet
Copy link
Member

OK, my XPS13 (again, running Ubuntu 20.04) is able to list my local printers. If I run ippeveprinter in another window it appears as expected, and if I terminate it, it disappears from the list as expected.

As for the duplicate queues, I checked the code and we are looking for local (permanent/temporary) queues with the same name as the auto-generated queue name from libcups - I'm guessing your permanent queues (created with the driverless utility) aren't following the same naming conventions... I think we have the printer-uuid information accessible to the browse callbacks so that we can eliminate dupes that way as well.

We definitely cannot increase the timeout to 5 seconds - that is way too long. The most we can justify is 1 second, and it should return faster than that if we stop getting data updates before then... FWIW, the Bonjour spec calls for a 100ms response time for queries/browsing...

@tillkamppeter
Copy link
Member Author

The CUPS queues are all manually created (cups-browsed is NOT running and "driverless" does not create queues) for each manually created (and so permanent) CUPS queue, for example my queue "Printer", lpstat -e lists an extra queue with "_till_x1yoga" (the host name of my machine is "till-x1yoga") added, for "Printer" being "Printer_x1_yoga", Here you see it in the output lpstst -l -e with "Printer" being "permanent" and "Printer_till_x1yoga" being "network" (temporary), same for all the other "permanent" queues:

$ lpstat -l -e
authtest permanent ipp://localhost/printers/authtest /dev/null
drvlessfax permanent ipp://localhost/printers/drvlessfax ipps://HP%20OfficeJet%20Pro%208730%20%5B08C229%5D._ipps._tcp.local/
drvlessfax_till_x1yoga network none ipps://drvlessfax%20%40%20till-x1yoga._ipps._tcp.local/cups
faxtest permanent ipp://localhost/printers/faxtest ipp://localhost:60001/ipp/faxout
HP-OfficeJet-Pro-8730 permanent ipp://localhost/printers/HP-OfficeJet-Pro-8730 ipps://HP%20OfficeJet%20Pro%208730%20%5B08C229%5D._ipps._tcp.local/
HP_OfficeJet_Pro_8730_08C229_ network none ipps://HP%20OfficeJet%20Pro%208730%20%5B08C229%5D._ipps._tcp.local/
HP_OfficeJet_Pro_8730_08C229_till_x1yoga network none ipps://HP%20OfficeJet%20Pro%208730%20%5B08C229%5D%20%40%20till-x1yoga._ipps._tcp.local/cups
HP_OfficeJet_Pro_8730_08C229_USB_ network none ipp://HP%20OfficeJet%20Pro%208730%20%5B08C229%5D%20(USB)._ipp._tcp.local/
HP_OfficeJet_Pro_8730_fully_driverless_till_x1yoga network none ipps://HP%20OfficeJet%20Pro%208730%20(fully%20driverless)%20%40%20till-x1yoga._ipps._tcp.local/cups
HP_OfficeJet_Pro_8730_till_x1yoga network none ipps://HP%20OfficeJet%20Pro%208730%20%40%20till-x1yoga._ipps._tcp.local/cups
HPLIP_Test_till_x1yoga network none ipps://HPLIP%20Test%20%40%20till-x1yoga._ipps._tcp.local/cups
Inkjet_Printer_till_x1yoga network none ipps://Inkjet%20Printer%20%40%20till-x1yoga._ipps._tcp.local/cups
ippusbtest permanent ipp://localhost/printers/ippusbtest ipp://HP%20OfficeJet%20Pro%208730%20%5B08C229%5D%20(USB)._ipp._tcp.local/
ippusbtest_till_x1yoga network none ipps://ippusbtest%20%40%20till-x1yoga._ipps._tcp.local/cups
office-local permanent ipp://localhost/printers/office-local ipp://Office%20Printer._ipp._tcp.local/
Office_Printer_till_x1yoga network none ipps://Office%20Printer%20%40%20till-x1yoga._ipps._tcp.local/cups
OfficeJet-Pro-8730 permanent ipp://localhost/printers/OfficeJet-Pro-8730 ipps://HP%20OfficeJet%20Pro%208730%20%5B08C229%5D._ipps._tcp.local/
pappl-test permanent ipp://localhost/printers/pappl-test ipp://till-x1yoga.local:8000/ipp/print/Inkjet%20Printer
pappl-test-e permanent ipp://localhost/printers/pappl-test-e ipp://Inkjet%20Printer._ipp._tcp.local/
pappl_test_till_x1yoga network none ipps://pappl-test%20%40%20till-x1yoga._ipps._tcp.local/cups
Printer permanent ipp://localhost/printers/Printer ipps://HP%20OfficeJet%20Pro%208730%20%5B08C229%5D._ipp._tcp.local/
Printer-HPLIP permanent ipp://localhost/printers/Printer-HPLIP hp:/usb/HP_OfficeJet_Pro_8730?serial=CN783F60W1
Printer_till_x1yoga network none ipps://Printer%20%40%20till-x1yoga._ipps._tcp.local/cups
snap-label permanent ipp://localhost/printers/snap-label ipp://Label%20Printer._ipp._tcp.local/
snap-test permanent ipp://localhost/printers/snap-test ipp://HP%20OfficeJet%20Pro%208730%20%5B08C229%5D._ipp._tcp.local/
snap_label_till_x1yoga network none ipps://snap-label%20%40%20till-x1yoga._ipps._tcp.local/cups
test network none ipps://test._ipps._tcp.local/
test-tray2 permanent ipp://localhost/printers/test-tray2 ipp://localhost:631/printers/test-tray
test2 network none ipps://test2._ipps._tcp.local/
test3 network none ipps://test3._ipps._tcp.local/
test4 network none ipps://test4._ipps._tcp.local/
test5 network none ipps://test5._ipps._tcp.local/

This means that DNS-SD records from CUPS queues are picked up and temporary queue entries with a queue name composed of the original queue name and the network host name of the server (should this not be "localhost"?) are created.
These temporary queue entries need to get suppressed, in a way that the entries of other local services, like Printer Applications and ipp-usb, do not go away. I suggest using UUIDs here, as this works perfectly for me to solve the same problem in cups-browsed.
For the timeout issue I fear that this is a bug in Avahi and I do not want to wait another 3 years to get it fixed.
So one question: Is the mDNSResponder which Apple uses free software? Is it well maintained? Would it make sense for Linux distros to switch to it?

@tillkamppeter
Copy link
Member Author

I have done a test now: On my Ubuntu 20.10 I have installed the Avahi packages (0.7) of 20.04 and now I do not need to extend the timeout any more, Avahi is answering quick enough to list all the printers and I can print out of CUPS on the PostScript Printer Application, no need of cups-browsed, nor of manually creating a CUPS queue, all works as intended now.
But note that the Avahi downgrade only solves the timeout problem. The temporary queue entries for the permanent CUPS queues are still there. So the UUID checking is still needed.

@tillkamppeter
Copy link
Member Author

The "driverless" utility is also much faster after the downgrade ...

@tillkamppeter
Copy link
Member Author

Another hint for the Avahi timing issue. In the release notes of Avah 0.8 it is written:

Notable Changes: [...] avahi-daemon: Delay sending results on an object for 10ms in an attempt to
give clients enough time to subscribe to signals from the new object after
receiving it's path in response so the New call. See "API Changes" for more
info

API Changes: The avahi-core API and D-Bus API have implemented a new API where
a call to the "New" method can now be split into a "Prepare" and then "Start"
method for some objects. The previous "New" API is still fully supported and
there is no intention to deprecate it.

This change affects the the following objects: AsyncAddressResolver,
AsyncHostNameResolver, AsyncServiceResolver, DomainBrowser, RecordBrowser,
ServiceBrowser, ServiceTypeBrowser

This is because the D-Bus implementation in some languages would only bind to
signals of an object after it was created and had received the new object's
path. This led to such languages missing the initial results sent between the
time the object was created and it had setup a filter to receive it's signals.
This primarily occured in languages that create dynamic bindings for D-Bus
objects using introspection such as Python. The avahi-client C api was not
affected as it globally binds to all avahi signals without specifying
individual object paths and still makes use of the V1 API.

The v2 Prepare/Start API is available under the new
org.freedesktop.Avahi.Server2 D-Bus interface and also has corresponding
avahi_s_* calls for users of the embedded avahi-core library.

The old org.freedesktop.Avahi.Server interface is still supported and there is
no intention to remove this API. Additionally this problem has also been solved
for old clients by adding a very small 10ms delay before we start sending
results to give the client time to bind to the signals which should silently
fix the issue in most cases without introducing a noticable or impactful delay.

Clients implementing the new org.freedesktop.Avahi.Server2 D-Bus interface will
not work with older Avahi daemons. It is suggested that clients may wish to
either check for and fallback to the older API version, or continue to use the
OLD API and rely on the 10ms timer to resolve the issue.

Could the 10ms delay mentioned here causing the problem and should CUPS perhaps use the new API here then?

@michaelrsweet
Copy link
Member

Till,

10ms shouldn't make a difference, and we are using the higher-level client API which should insulate us from these differences. I will clone and upgrade one of my VMs to 20.10 so I can duplicate this issue and come up with a fix.

@michaelrsweet michaelrsweet added the platform issue Issue is specific to an OS or desktop label Nov 23, 2020
@michaelrsweet
Copy link
Member

@tillkamppeter I can't reproduce on my 20.10 VM. What kind of system are you testing on? Wi-Fi or Ethernet or both?

@tillkamppeter
Copy link
Member Author

It is both Wi-Fi and Ethernet, and it has several internal interfaces of VM platforms.

$ ifconfig 
enp0s31f6: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 54:ee:75:ee:51:a5  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0xec300000-ec320000  

enx00e04c043270: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.0.15  netmask 255.255.255.0  broadcast 10.0.0.255
        inet6 fe80::b917:ab4:a3c4:970  prefixlen 64  scopeid 0x20<link>
        ether 00:e0:4c:04:32:70  txqueuelen 1000  (Ethernet)
        RX packets 20449462  bytes 9676517979 (9.6 GB)
        RX errors 0  dropped 53769  overruns 0  frame 0
        TX packets 17868581  bytes 4357372453 (4.3 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 1072264  bytes 174571471 (174.5 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1072264  bytes 174571471 (174.5 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lxdbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.249.158.1  netmask 255.255.255.0  broadcast 0.0.0.0
        inet6 fe80::68f0:a2ff:fe47:4fab  prefixlen 64  scopeid 0x20<link>
        ether fe:dd:7c:57:52:bd  txqueuelen 1000  (Ethernet)
        RX packets 23579  bytes 1703257 (1.7 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 185972  bytes 170678693 (170.6 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

mpqemubr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 10.136.159.1  netmask 255.255.255.0  broadcast 10.136.159.255
        inet6 fe80::4c97:31ff:fe0c:7ae0  prefixlen 64  scopeid 0x20<link>
        ether 12:e0:e5:89:6c:68  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 125  bytes 127026 (127.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tap-6253d6b6957: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 4e:97:31:0c:7a:e0  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tap-df3e83ac11d: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 12:e0:e5:89:6c:68  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vethFDTYB9: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::fcdd:7cff:fe57:52bd  prefixlen 64  scopeid 0x20<link>
        ether fe:dd:7c:57:52:bd  txqueuelen 1000  (Ethernet)
        RX packets 23579  bytes 2033363 (2.0 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 218509  bytes 199133044 (199.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:22:65:88  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::530d:50bb:a232:568b  prefixlen 64  scopeid 0x20<link>
        ether f8:94:c2:2f:2c:ae  txqueuelen 1000  (Ethernet)
        RX packets 667427  bytes 199165733 (199.1 MB)
        RX errors 0  dropped 35017  overruns 0  frame 0
        TX packets 117159  bytes 82818750 (82.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

@michaelrsweet
Copy link
Member

I still can't reproduce, and the DNS-SD support has changed since the original report. Closing for now but let me know if this resurfaces (we have a related issue #176 I've asked you to double-check...)

@tillkamppeter
Copy link
Member Author

To get all IPP print destinations listed by lpstat -l -e, including those for which CUPS creates a temporay queue on-demand, I have to set

#  define _CUPS_DNSSD_GET_DESTS 1000     /* Milliseconds for cupsGetDests */

(1-sec timeout instead of 250 msec) in cups/dest.c. I have applied this change to the CUPS package (DEB, not Snap) in the upcoming Ubuntu 24.04 LTS. In the CUPS Snap I had set this already earlier.

Once having done so, everything is correct. I see all the IPP print destinations: My HP OfficeJet Pro 8730, both on network and IPP-over-USB, my Printer Applications, and neturally also my permanent CUPS queues:

$ lpstat -l -e
abc network none ipps://abc._ipps._tcp.local/
Canon network none ipps://Canon._ipps._tcp.local/
dnssd network none ipps://dnssd._ipps._tcp.local/
hostname network none ipps://hostname._ipps._tcp.local/
hp4050 network none ipps://hp4050._ipps._tcp.local/
HP_OfficeJet_Pro_8730_5B78A3 network none ipps://HP%20OfficeJet%20Pro%208730%20%5B5B78A3%5D._ipps._tcp.local/
HP_OfficeJet_Pro_8730_5B78A3_USB network none ipp://HP%20OfficeJet%20Pro%208730%20%5B5B78A3%5D%20(USB)._ipp._tcp.local/
Printer permanent ipp://localhost/printers/Printer ipps://HP%20OfficeJet%20Pro%208730%20%5B5B78A3%5D._ipps._tcp.local/
PrinterVV permanent ipp://localhost/printers/PrinterVV ipps://HP14CB19D68D1E.local:631/ipp/print
psc2500_E313F0 network none ipps://psc2500%20(E313F0)._ipps._tcp.local/
snmp network none ipps://snmp._ipps._tcp.local/
test network none ipps://test._ipps._tcp.local/
test10_D7FE90 network none ipps://test10%20(D7FE90)._ipps._tcp.local/
test2_460BFB network none ipps://test2%20(460BFB)._ipps._tcp.local/
test3_CN783F60W1_interface_1 network none ipps://test3%20(CN783F60W1&interface=1)._ipps._tcp.local/
test4_F7866E network none ipps://test4%20(F7866E)._ipps._tcp.local/
test5_9EA687 network none ipps://test5%20(9EA687)._ipps._tcp.local/
test6_59CD60 network none ipps://test6%20(59CD60)._ipps._tcp.local/
test_query network none ipps://test-query._ipps._tcp.local/
testprinter permanent ipp://localhost/printers/testprinter file:/tmp/printout
usb network none ipps://usb._ipps._tcp.local/
utax network none ipps://utax._ipps._tcp.local/
x network none ipps://x._ipps._tcp.local/
xyz123 network none ipps://xyz123._ipps._tcp.local/
$ 

And the permanent CUPS queues are NOT accompanied by temporary ghost queues any more. So no "Printer_till_x1yoga" and so on any more!

Seems something in recent 2.4.x CUPS (I use 2.4.7) seems to have fixed that. The only thing I need is the 1-sec timeout now.

@tillkamppeter
Copy link
Member Author

Sorry, I was too fast. I forgot to turn on printer sharing. With the above setup, after giving the command

$ cupsctl --share-printers
$ cupsctl
_debug_logging=1
_remote_admin=0
_remote_any=0
_share_printers=1
_user_cancel_any=0
BrowseLocalProtocols=dnssd
DefaultAuthType=Basic
ErrorPolicy=retry-job
JobPrivateAccess=default
JobPrivateValues=default
MaxLogSize=0
PageLogFormat=
SubscriptionPrivateAccess=default
SubscriptionPrivateValues=default
WebInterface=Yes
$

I get the ghost queues again:

$ lpstat -l -e
abc network none ipps://abc._ipps._tcp.local/
Canon network none ipps://Canon._ipps._tcp.local/
dnssd network none ipps://dnssd._ipps._tcp.local/
hostname network none ipps://hostname._ipps._tcp.local/
hp4050 network none ipps://hp4050._ipps._tcp.local/
HP_OfficeJet_Pro_8730_5B78A3 network none ipps://HP%20OfficeJet%20Pro%208730%20%5B5B78A3%5D._ipps._tcp.local/
HP_OfficeJet_Pro_8730_5B78A3_USB network none ipp://HP%20OfficeJet%20Pro%208730%20%5B5B78A3%5D%20(USB)._ipp._tcp.local/
Printer permanent ipp://localhost/printers/Printer ipps://HP%20OfficeJet%20Pro%208730%20%5B5B78A3%5D._ipps._tcp.local/
Printer_till_x1nano network none ipps://Printer%20%40%20till-x1nano._ipps._tcp.local/cups
PrinterVV permanent ipp://localhost/printers/PrinterVV ipps://HP14CB19D68D1E.local:631/ipp/print
PrinterVV_till_x1nano network none ipps://PrinterVV%20%40%20till-x1nano._ipps._tcp.local/cups
psc2500_E313F0 network none ipps://psc2500%20(E313F0)._ipps._tcp.local/
snmp network none ipps://snmp._ipps._tcp.local/
test network none ipps://test._ipps._tcp.local/
test10_D7FE90 network none ipps://test10%20(D7FE90)._ipps._tcp.local/
test2_460BFB network none ipps://test2%20(460BFB)._ipps._tcp.local/
test3_CN783F60W1_interface_1 network none ipps://test3%20(CN783F60W1&interface=1)._ipps._tcp.local/
test4_F7866E network none ipps://test4%20(F7866E)._ipps._tcp.local/
test5_9EA687 network none ipps://test5%20(9EA687)._ipps._tcp.local/
test6_59CD60 network none ipps://test6%20(59CD60)._ipps._tcp.local/
test_query network none ipps://test-query._ipps._tcp.local/
testprinter permanent ipp://localhost/printers/testprinter file:/tmp/printout
testprinter_till_x1nano network none ipps://testprinter%20%40%20till-x1nano._ipps._tcp.local/cups
usb network none ipps://usb._ipps._tcp.local/
utax network none ipps://utax._ipps._tcp.local/
x network none ipps://x._ipps._tcp.local/
xyz123 network none ipps://xyz123._ipps._tcp.local/
$

See Printer, PrinterVV, and testprinter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform issue Issue is specific to an OS or desktop priority-medium
Projects
None yet
Development

No branches or pull requests

3 participants