System-config-printer keeps asking for network printer credentials

Bug #1917941 reported by Plecton
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
system-config-printer (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Hello.

I think I found a small bug in the printing process of Xubuntu 20.04.02 LTS. I have a networked laser printer (Xerox Phaser 3250) that requires username/password credentials to print. The device is present in the CUPS page (see the Printers page in http://localhost:631) and uses the IPP protocol set to "ipp://192.168.1.10:631/ipp" URI. It is also visible in the system-config-printer window (XFCE Start button => Settings => Printers) and is set as default printer. The printer username/password are different than my PC username/password.

Anyway, I noticed that the OS will sometimes pester me to enter the same credentials each time I try to print something. I recall the printing authorization window does have a "Remember password" checkbox that seemingly does nothing. Now why I am mentioning that this happens only sometimes? It's because I noticed that different programs will use different authorization windows to get printer credentials. For example, Mousepad will try to get credentials by using a CUPS popup dialog (I think). LibreOffice seems to popup its own small password entry window. This bug only applies to the cases where the printing is done via system-config-printer that uses its own authorization dialog. The printing works fine after credentials are entered though.

So, after a short debug session I managed to narrow down the problem to this file: /usr/share/system-config-printer/jobviewer.py. I ran the applet.py and scp-dbus-service.py with the --debug option from command line to get some extra debug messages. Printing from Mousepad did not trigger any debug messages, but it did bring up the printing authorization dialog regardless. Like I've previously stated, Mousepad seems to use a different auth dialog, and I've verified (via seahorse) that this dialog works properly because it correctly stores the credentials into the keyring, and, if the Remember password checkbox is ticked, remembers them next time I try to print something. The problem only applies to the auth dialog triggered from jobviewer.py of system-config-printer. I managed to trigger the jobviewer auth dialog by trying to print something in LibreOffice Writer and then hitting Cancel in the small window that pops up. This will then trigger the *proper* jobviewer.py auth window to show up. It also triggers upon boot when there is something queued to be printed.

It can also be reliably triggered queueing a print job, killing scp-dbus-service.py and applet.py and re-running them in this order:
1) /usr/share/system-config-printer/scp-dbus-service.py --debug
2) /usr/share/system-config-printer/applet.py --debug

Though this jobviewer.py auth dialog will successfully save the printer credentials to the keyring, if the checkbox is ticked (verified with Seahorse), it will fail to read them next time, assume the credentials are missing, and ask the user to enter them. The error appears to happen in jobviewer.py:

Line 1056: search_obj = ItemSearch(service, attrs)

This line causes the following error to appear in the terminal:
GLib-GIO-CRITICAL **: 19:28:31.663: g_dbus_connection_call_internal: assertion 'G_IS_DBUS_CONNECTION (connection)' failed

The call fails to fetch any credentials and instead returns an empty result. I've written a short python script (see test.py) that reproduces the issue and triggers the same error.

Related libsecret documentation:
https://developer.gnome.org/libsecret/0.20/

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: system-config-printer 1.5.12-0ubuntu1.1
ProcVersionSignature: Ubuntu 5.4.0-66.74-generic 5.4.86
Uname: Linux 5.4.0-66-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu27.16
Architecture: amd64
CasperMD5CheckResult: skip
CupsErrorLog:

CurrentDesktop: XFCE
Date: Fri Mar 5 19:34:54 2021
InstallationDate: Installed on 2020-01-20 (409 days ago)
InstallationMedia: Xubuntu 19.10 "Eoan Ermine" - Release amd64 (20191017)
Lpstat: device for Phaser-3250: ipp://192.168.1.10:631/ipp
Lsusb:
 Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
 Bus 001 Device 002: ID 046d:c069 Logitech, Inc. M-U0007 [Corded Mouse M500]
 Bus 001 Device 003: ID 8087:0aaa Intel Corp.
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Lsusb-t:
 /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/8p, 10000M
 /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/16p, 480M
     |__ Port 4: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
     |__ Port 14: Dev 3, If 0, Class=Wireless, Driver=btusb, 12M
     |__ Port 14: Dev 3, If 1, Class=Wireless, Driver=btusb, 12M
MachineType: Acer Predator PH317-52
PackageArchitecture: all
Papersize: a4
PpdFiles:
 Error: command ['fgrep', '-H', '*NickName', '/etc/cups/ppd/Phaser.ppd', '/etc/cups/ppd/Phaser-3250.ppd'] failed with exit code 2: grep: /etc/cups/ppd/Phaser.ppd: Permission denied
 grep: /etc/cups/ppd/Phaser-3250.ppd: Permission denied
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.4.0-66-generic root=UUID=b1b80b22-4e8a-4fe5-9c0a-7716a49283e2 ro cryptdevice=/dev/disk/by-partlabel/LUKS:cryptroot:allow-discards noresume quiet splash vt.handoff=7
SourcePackage: system-config-printer
UpgradeStatus: Upgraded to focal on 2020-07-15 (233 days ago)
dmi.bios.date: 03/27/2019
dmi.bios.vendor: Insyde Corp.
dmi.bios.version: V1.26
dmi.board.asset.tag: Type2 - Board Serial Number
dmi.board.name: Sienna_CFS
dmi.board.vendor: CFL
dmi.board.version: V1.26
dmi.chassis.type: 10
dmi.chassis.vendor: Acer
dmi.chassis.version: V1.26
dmi.modalias: dmi:bvnInsydeCorp.:bvrV1.26:bd03/27/2019:svnAcer:pnPredatorPH317-52:pvrV1.26:rvnCFL:rnSienna_CFS:rvrV1.26:cvnAcer:ct10:cvrV1.26:
dmi.product.family: Predator Helios 300
dmi.product.name: Predator PH317-52
dmi.product.sku: 0000000000000000
dmi.product.version: V1.26
dmi.sys.vendor: Acer

Revision history for this message
Plecton (northend) wrote :
Revision history for this message
Plecton (northend) wrote :
Revision history for this message
Plecton (northend) wrote :

I've attached a picture how the three different authentication dialogs look like.

Revision history for this message
Plecton (northend) wrote :

Here is a picture of my keyring viewed from Seahorse. Notice that there are *two* entries in it for the same printer. One is stored by the "Mousepad" authentication dialog and the other by system-config-printer dialog. The libreoffice one doesn't seem to have an option to remember the credentials, so I haven't tested it.

This proves that system-config-printer is storing the password in the keyring after all. Still, I wonder... Why do there have to be two entries like this? Shouldn't one suffice for all programs wanting to print?

Revision history for this message
Plecton (northend) wrote :

Okay, after doing some more debugging and digging, I found out that this may be happening due to some Gdk features getting deprecated and changed. Apparently, the asynchronous calls did not trigger the callback functions, and thus the code failed to return any data.

It would seem that this bug has already been fixed upstream.

https://github.com/OpenPrinting/system-config-printer/commits/master/jobviewer.py
00177768ca1464c694acde4cdbabc1a18420c176
152b617f511cd44757d2db4d730067aca8cf69a9
b74c701feb52a1d2865fe1d33c393f71ae3ac47a

Package maintainer, can you please bump the version of system-config-printer to 1.5.15?

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in system-config-printer (Ubuntu):
status: New → Confirmed
Revision history for this message
Robert (rom2) wrote :

Storing the password from printer system dialog was running well for me with ubuntu 20.04 lts.

Now, with ubuntu 22.04 lts the dialog is looking the same: with the 'remember password' checkbox. But, the password will be not stored any more.

The dialog appears every time you print, regardless of whether you save the password.

I have tested the behavior with a newly installed ubuntu 20.04 and 22.04. I printed from firefox with the printer system dialog.

Any ideas how to make this work again?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.