After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 695286 - Printer tool of GNOME Control Center does not get info about available printer devices from CUPS
Printer tool of GNOME Control Center does not get info about available printe...
Status: RESOLVED DUPLICATE of bug 693182
Product: gnome-control-center
Classification: Core
Component: Printers
3.6.x
Other Linux
: Normal normal
: ---
Assigned To: Marek Kašík
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-03-06 12:42 UTC by Till Kamppeter
Modified: 2013-03-14 14:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
monitor-session.log (707 bytes, text/plain)
2013-03-07 15:54 UTC, Till Kamppeter
Details
monitor-system.log (2.01 KB, text/plain)
2013-03-07 15:55 UTC, Till Kamppeter
Details
monitor-system-root.log (2.01 KB, text/plain)
2013-03-07 15:55 UTC, Till Kamppeter
Details
testbackend (3.28 KB, text/plain)
2013-03-07 15:56 UTC, Till Kamppeter
Details
gdbus-call.log (3.69 KB, text/plain)
2013-03-07 15:56 UTC, Till Kamppeter
Details
gdbus-call-empty-list.log (5.62 KB, text/plain)
2013-03-07 15:58 UTC, Till Kamppeter
Details

Description Till Kamppeter 2013-03-06 12:42:57 UTC
I am using Ubuntu Raring and if I choose the "Printers" section in the Control Center I get GNOME's printer setup tool. There I click the "+" button in the lower left for adding a printer.

A pop-up comes up telling me that it is searching for printers. After some seconds I get a list of only network printers, no USB printers. So there are much less printers than I get with "lpinfo -v" on the command line or when starting system-config-printer on the command line.

For me it seems that the new tool is using different detection methods, once direct detection of network-connected printers (Bonjour, SNMP, ...) and asking CUPS through D-Bus, via cups-pk-helper (org.opensuse.CupsPkHelper.Mechanism DevicesGet). The direct network detection seems to work, but the cups-pk-helper detection seems not to work, resulting in the USB printers (and the cups-pdf pseudo printer) missing.
Comment 1 Marek Kašík 2013-03-07 11:55:32 UTC
Hi Till,

does "/usr/lib/cups/backend/usb" or "gdbus call --system --dest org.opensuse.CupsPkHelper.Mechanism --object-path / --method org.opensuse.CupsPkHelper.Mechanism.DevicesGet 0 0 '["usb"]' []" list the usb printer?

Regards

Marek
Comment 2 Till Kamppeter 2013-03-07 12:20:03 UTC
Calling single backends works correctly, showing the printers detected by the appropriate backend.

If logged in via SSH calling the "gdbus call ..." command as a normal user errors:

Error: GDBus.Error:org.opensuse.CupsPkHelper.Mechanism.NotPrivileged: Not Authorized for action: org.opensuse.cupspkhelper.mechanism.devices-get
(According to introspection data, you need to pass `iiasas')

Calling the same command as root lists the results of the specified backend.

If being in a terminal on the desktop of the machine the "gdbus call ..." command works also as a normal user.
Comment 3 Marek Kašík 2013-03-07 13:26:43 UTC
Could you send me what does "dbus-monitor --session --monitor &> ./monitor.log" gives you during running of the new printer dialog? This will show me order of calling of DBus functions.
Also, could you post here result of the "gdbus call --system --dest
org.opensuse.CupsPkHelper.Mechanism --object-path / --method
org.opensuse.CupsPkHelper.Mechanism.DevicesGet 0 0 '["usb"]' []". I would like to see whether it returns all required fields.

Marek
Comment 4 Till Kamppeter 2013-03-07 15:53:41 UTC
I have run the following three commands and during eachj of them I have run the add-printer dialog, always getting no detected printers:

dbus-monitor --session --monitor &> ./monitor-session.log
dbus-monitor --system --monitor &> ./monitor-system.log
sudo dbus-monitor --system --monitor &> ./monitor-system-root.log

Then I have run the following command:

gdbus call --system --dest
org.opensuse.CupsPkHelper.Mechanism --object-path / --method
org.opensuse.CupsPkHelper.Mechanism.DevicesGet 0 0 '["testbackend"]' [] > gdbus-call.log

Note that I am on a virtual machine with no physical USB printers assigned to it. /usr/lib/cups/backend/testbackend is simply writing out autodetection results in the syntax expected from a CUPS backend. "lpinfo -v" and the above command seem to produce correct output.

I have also run the command with an empty backend list:

gdbus call --system --dest
org.opensuse.CupsPkHelper.Mechanism --object-path / --method
org.opensuse.CupsPkHelper.Mechanism.DevicesGet 0 0 [] [] > gdbus-call-empty-list.log

This seems to assume the listing for all backends to be requested and the output looks appropriately.

Is it possible that the GNOME tool is hard-listing a certain collection of backends and so manufacturer- or driver-supplied backends will get ignored, making it impossible to set up printers with certain third-party driver suites? This would also be a bug.

All log files and testbackend are attached.
Comment 5 Till Kamppeter 2013-03-07 15:54:27 UTC
Created attachment 238312 [details]
monitor-session.log
Comment 6 Till Kamppeter 2013-03-07 15:55:01 UTC
Created attachment 238313 [details]
monitor-system.log
Comment 7 Till Kamppeter 2013-03-07 15:55:31 UTC
Created attachment 238315 [details]
monitor-system-root.log
Comment 8 Till Kamppeter 2013-03-07 15:56:03 UTC
Created attachment 238316 [details]
testbackend
Comment 9 Till Kamppeter 2013-03-07 15:56:50 UTC
Created attachment 238317 [details]
gdbus-call.log
Comment 10 Till Kamppeter 2013-03-07 15:58:08 UTC
Created attachment 238318 [details]
gdbus-call-empty-list.log
Comment 11 Till Kamppeter 2013-03-07 16:11:52 UTC
Seems that my assumption of the hard-listed backends is true, as now I have forwarded one of the host's USB printers to the VM so that the "usb" backend detects a printer and not only the unknown-to-GNOME "testbackend". With this I get this one printer listed, but as the "hplip" backend detects it, too, even twice, but indistinguishable for the user, which is another bug (should the list of detected printers not be sent to scp-dbus-service to sort out such duplicates?).

I have tip for you how to ask for CUPS' autodetection results in a better way:

Simply polling all backends at once by using the empty list will probably take to long time as the network detector backends snmp, dnssd, and bluetooth need a rather long time.

Therefore I use a two-pass solution in system-config-printer: I make a list of "slow backends", currently snmp, dnssd, and bluetooth. Then I do two requests for detected printers, first a request with all but the slow backends and second, a request with only the slow backends. The CUPS API supports this by allowing to supply either a white list of backends, then all these are used, or a blacklist of backends, then all but these are used. Perhaps you should proceed the same way in the GNOME tool.
Comment 12 Till Kamppeter 2013-03-14 14:47:33 UTC

*** This bug has been marked as a duplicate of bug 693182 ***