Installed network printer removed automatically when turned off

Bug #1731417 reported by Alberto Donato
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cups-filters (Ubuntu)
Fix Released
High
Unassigned

Bug Description

After installing artful, I configured my HP LaserJet M1212nf via network as usual via hp-setup.
Installation worked and I could print/scan via network, but next time I needed to print, the printer was gone from the system.
Basically, every time I need to print, I have to install the printer again.
I'm not sure when the printer disappears, but I can reproduce consistently.

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: hplip-gui 3.17.7+repack0-3
ProcVersionSignature: Ubuntu 4.8.0-59.64-generic 4.8.17
Uname: Linux 4.8.0-59-generic x86_64
NonfreeKernelModules: zfs zunicode zcommon znvpair zavl
ApportVersion: 2.20.7-0ubuntu3.1
Architecture: amd64
CupsErrorLog:

CurrentDesktop: GNOME
Date: Fri Nov 10 09:33:12 2017
InstallationDate: Installed on 2017-07-30 (102 days ago)
InstallationMedia: Ubuntu-Server 17.10 "Artful Aardvark" - Alpha amd64 (20170730)
Lpstat: Error: command ['lpstat', '-v'] failed with exit code 1: lpstat: No destinations added.
MachineType: Gigabyte Technology Co., Ltd. To be filled by O.E.M.
PackageArchitecture: all
Papersize: a4
ProcKernelCmdLine: BOOT_IMAGE=/@/boot/vmlinuz-4.8.0-59-generic.efi.signed root=UUID=c2e94423-ace9-437c-ab5b-6dd78d6a052a ro rootflags=subvol=@ quiet splash vt.handoff=7
SourcePackage: hplip
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 10/23/2013
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: F15
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: B75M-D3H
dmi.board.vendor: Gigabyte Technology Co., Ltd.
dmi.board.version: To be filled by O.E.M.
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: Gigabyte Technology Co., Ltd.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrF15:bd10/23/2013:svnGigabyteTechnologyCo.,Ltd.:pnTobefilledbyO.E.M.:pvrTobefilledbyO.E.M.:rvnGigabyteTechnologyCo.,Ltd.:rnB75M-D3H:rvrTobefilledbyO.E.M.:cvnGigabyteTechnologyCo.,Ltd.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.name: To be filled by O.E.M.
dmi.product.version: To be filled by O.E.M.
dmi.sys.vendor: Gigabyte Technology Co., Ltd.

Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Alberto Donato (ack) wrote :

It seems the issue is due to suspend/resume.
After resuming the system, I noticed the following entries in CUPS access_log:

localhost - - [10/Nov/2017:18:59:39 +0100] "POST /admin/ HTTP/1.1" 401 185 CUPS-Delete-Printer successful-ok
localhost - root [10/Nov/2017:18:59:40 +0100] "POST /admin/ HTTP/1.1" 200 185 CUPS-Delete-Printer successful-ok

and the printer is gone. I'm not sure what's performing the delete.

summary: - Installed printer disappears after a while
+ Installed printer disappears after suspend/resume
Alberto Donato (ack)
summary: - Installed printer disappears after suspend/resume
+ Installed printer removed after suspend/resume
Revision history for this message
Alberto Donato (ack) wrote : Re: Installed printer removed after suspend/resume

The issue persists on bionic

tags: added: bionic
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Please do the following:

Edit /etc/cups/cups-browsed.conf so that it has a line

DebugLogging file

without "#" in the beginning. Do not modify the other lines. Attach your /etc/cups/cups-browsed.conf and your /etc/cups/cupsd.conf files to this bug report.

Reboot your system.

Run lpstat -v and post the output here.

Set up your printer with hp-setup as you are used to.

immediately afterwards run the command

lpstat -v

and poste the output here. Copy also the file /etc/cups/printers.conf (you will need "sudo") and post its contents here.

Print a job and do "lpstat -v" and copy printers.conf again. Post the output of "lpstat -v" and the contents of the file here again.

Now suspend your system, wait for the suspend to complete and resume again. Do "lpstat -v" and copy printers.conf again. Post the output of "lpstat -v" and the contents of the file here again.

Did your print queue go away again? If not, reboot your system. Did it go away now? If so, do "lpstat -v" and copy printers.conf again. Post the output of "lpstat -v" and the contents of the file here again.

Please attach the files /var/log/cups/error_log and /var/log/cups/cups-browsed_log to this bug report.

Please do not compress any files and do not package the files together when attaching them to this bug report, to make it easier to read the files right out of the browser.

Changed in cups (Ubuntu):
status: New → Incomplete
Changed in hplip (Ubuntu):
status: New → Incomplete
Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Alberto Donato (ack) wrote :

Added all logs. After suspend the printer is gone and lpstat -v reports "No destinations"

Revision history for this message
Alberto Donato (ack) wrote :

AFAICS from the cups-browserd_log, CUPS seems to be removing the printer when avahi doesn't see it anymore (because it's been turned off).
This didn't happen before, I would only install the printer once and it'd be there forever.
I think only avahi-discovered printers should be automatically removed.

Alberto Donato (ack)
Changed in cups (Ubuntu):
status: Incomplete → Confirmed
Changed in hplip (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Alberto Donato (ack) wrote :

Updated the bug title, as it's not really related to suspend/resume

summary: - Installed printer removed after suspend/resume
+ Installed network printer removed automatically when turned off
Revision history for this message
Alberto Donato (ack) wrote :

@Till do you have any insight on this bug?

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Please run the command

avahi-browse -v -t -r -a > avahi.txt 2>&1

and attach your file avahi.txt.

Changed in cups (Ubuntu):
status: Confirmed → Incomplete
Changed in hplip (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Alberto Donato (ack) wrote :

Attached output with printer powered on and bonjour enabled.

Alberto Donato (ack)
Changed in hplip (Ubuntu):
status: Incomplete → Confirmed
Changed in cups (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Alberto Donato (ack) wrote :

I can also confirm that if I disable bonjour, the printer no longer gets removed once it's turned off

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Please doi the following:

Make sure Bonjour is active in your printer and in your computer. With the printer turned on run the command

avahi-browse -v -t -r -a > avahi.txt 2>&1

again. Look into the avahi.txt file and check whether it contains entries from your printer. If not, keep the printer turned on and Bonjour active in both the printer and computer and run the command again later. Check again, does the avahi.txt contain entries for your printer now? If yes attach the file to this bug report.

If you still get no entry of your printer into the file, turn off and turn on the printer again. When the printer has started up, run the command again. Does the fiule contain an entry of the printer now? If so, attach the file to this bug report.

Changed in cups (Ubuntu):
status: Confirmed → Incomplete
Changed in hplip (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Alberto Donato (ack) wrote :

Sorry, I previously attached the output from the run with bonjour disabled. This is with it enabled.

Changed in cups (Ubuntu):
status: Incomplete → Confirmed
Changed in hplip (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Thank you very much for all the files. With this I could fix two bugs in cups-browsed which caused this problem.
Fixed version on the way to Bionic.

affects: cups (Ubuntu) → cups-filters (Ubuntu)
Changed in cups-filters (Ubuntu):
importance: Undecided → High
milestone: none → ubuntu-18.04
status: Confirmed → Fix Committed
no longer affects: hplip (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cups-filters - 1.20.2-0ubuntu1

---------------
cups-filters (1.20.2-0ubuntu1) bionic; urgency=medium

  * New upstream bug fix release
    - cups-browsed: If the user modifies/overwrites a print queue
      created by cups-browsed, it will now automatically released
      from the control of cups-browsed, so the modified queue does
      not get removed by cups-browsed on shutdown. (LP: #1731417).
    - cups-browsed: The configuration setting
      "CreateIPPPrinterQueues LocalOnly" suppressed also the
      automatic generation of local queues for remote CUPS
      printers whereas this option is only intended for physical
      IPP printers.
    - cups-browsed: Identify remote CUPS queues by the
      "printer-type" TXT record entry and not by the
      "ipp(s)://<host>/printers/<name>" URIs, there are also IPP
      network printers with such URIs (HP LaserJet Professional
      M1212nf MFP in LP: #1731417).
    - .gitignore: Added filter/braille/filters/brftopagedbrf
    - cups-browsed, foomatic-rip: Fixed several typos. Thanks to
      Didier Raboud for the patches.
  * Removed all patches with got merged upstream.

 -- Till Kamppeter <email address hidden> Sat, 31 Mar 2018 23:36:34 +0200

Changed in cups-filters (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Xavier Bosch (xbosch63) wrote :

I have the same problem in Ubuntu 18.04.1 with a Laserjet CP1025nw... very annoying,,, is there a fix for that bug? How can I get it?

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Xavier, do you have cups-filters 1.20.2-0ubuntu1 on your machine ("dpkg -l | grep cups-filters")?

Please follow my instructions of comment #4 in this bug report.

Revision history for this message
Xavier Bosch (xbosch63) wrote :

Hi Till, thanks for your answer. This is the result of dpkg:

 dpkg -l | grep cups-filter
ii cups-filters 1.20.2-0ubuntu3 i386 OpenPrinting CUPS Filters - Main Package
ii cups-filters-core-drivers 1.20.2-0ubuntu3 i386 OpenPrinting CUPS Filters - Driverless printing
--------------------------------------------------------------------------------------
I also execute avahi-browse, and Laserjet appears, althougt it is not available for printing...
I attach the result

Revision history for this message
Xavier Bosch (xbosch63) wrote :
Revision history for this message
Alberto Donato (ack) wrote :

I'm seeing this issue again as well, on Bionic with latest packages

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Anyone who still has this problem, please follow the instructions of the comments #4, #18, and #22 in this bug report and attach all the files created by this. Thanks.

Revision history for this message
Alberto Donato (ack) wrote :

Attached avahi output

Revision history for this message
Alberto Donato (ack) wrote :

Attached lpstat -v output

Revision history for this message
Alberto Donato (ack) wrote :

Attached printers.conf

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Alberto, thanks for these files, but could you please also follow the instructions of comment #4, especially for the log file of cups-browsed?

Revision history for this message
Xavier Bosch (xbosch63) wrote :
Revision history for this message
Xavier Bosch (xbosch63) wrote :
Revision history for this message
Xavier Bosch (xbosch63) wrote :
Revision history for this message
Xavier Bosch (xbosch63) wrote :
Revision history for this message
Xavier Bosch (xbosch63) wrote :
Revision history for this message
Xavier Bosch (xbosch63) wrote :
Revision history for this message
Xavier Bosch (xbosch63) wrote :
Revision history for this message
Xavier Bosch (xbosch63) wrote :
Revision history for this message
Xavier Bosch (xbosch63) wrote :
Revision history for this message
Xavier Bosch (xbosch63) wrote :

these are all the files. there are 4 different lpstat files, corresponding to 1-initial situation, 2-after hp-setup 3-after printinf a file 4-after reboot

Revision history for this message
Alberto Donato (ack) wrote :

I'm seeing this again in Cosmic with the following versions:

ii cups 2.2.8-5ubuntu1.2 amd64 Common UNIX Printing System(tm) - PPD/driver support, web interface
ii cups-browsed 1.21.3-1 amd64 OpenPrinting CUPS Filters - cups-browsed
ii cups-bsd 2.2.8-5ubuntu1.2 amd64 Common UNIX Printing System(tm) - BSD commands
ii cups-client 2.2.8-5ubuntu1.2 amd64 Common UNIX Printing System(tm) - client programs (SysV)
ii cups-common 2.2.8-5ubuntu1.2 all Common UNIX Printing System(tm) - common files
ii cups-core-drivers 2.2.8-5ubuntu1.2 amd64 Common UNIX Printing System(tm) - driverless printing
ii cups-daemon 2.2.8-5ubuntu1.2 amd64 Common UNIX Printing System(tm) - daemon
ii cups-filters 1.21.3-1 amd64 OpenPrinting CUPS Filters - Main Package
ii cups-filters-core-drivers 1.21.3-1 amd64 OpenPrinting CUPS Filters - Driverless printing
ii cups-ipp-utils 2.2.8-5ubuntu1.2 amd64 Common UNIX Printing System(tm) - IPP developer/admin utilities
ii cups-pk-helper 0.2.6-1ubuntu3 amd64 PolicyKit helper to configure cups with fine-grained privileges
ii cups-ppdc 2.2.8-5ubuntu1.2 amd64 Common UNIX Printing System(tm) - PPD manipulation utilities
ii cups-server-common 2.2.8-5ubuntu1.2 all Common UNIX Printing System(tm) - server common files

Attaching logs as described in #4

Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Alberto Donato (ack) wrote :
Changed in cups-filters (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Alberto Donato (ack) wrote :

the "-after" files are (and logs) are taken after suspening and waking up the laptop, with the printer off.

the output of lpstat -v is empty after the printer has gone

tags: added: cosmic
Revision history for this message
Alberto Donato (ack) wrote :

Note that the issue persist in 19.04

Changed in cups-filters (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

According to the attached log files hp-setup has created a print queue with the same name as a queue created by cups-browsed, overwriting this queue. As cups-browsed removes all the queues it created when it shuts down, it also has removed this queue.

Normally cups-browsed gets a notification from CUPS on any queue modification and if one overwrites one of cups-browsed's queues, cups-browsed releases the queue from its control and so it does not get deleted on shutdown. Only here cups-browsed got shut down too quickly after the queue got overwritten, leaving no time for cups-browsed to receive the notification from CUPS and release the queue from its control. Probably hp-setup restarts CUPS right after creating a queue and this makes systemd restart cups-browsed.

To overcome this problem I have now added an additional check to cups-browsed that if it removes a print queue, independent on whether on shutdown or when a printer disappears from DNS-SD (printer turned off or so), it checks whether it perhaps got overwritten and refrains from removing in such a case.

I have committed the fix to the upstream GIT of cups-filters:

https://github.com/OpenPrinting/cups-filters/commit/4814a2238

If you are familiar with building software from source, please test.

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

This bug was fixed in the package cups-filters - 1.23.0-1

---------------
cups-filters (1.23.0-1) experimental; urgency=medium

  * New upstream version 1.23.0
    - cups-browsed: When removing a local queue on shutdown or
      when DNS-SD reports the printer as disappeared check whether
      the local queue got overwritten by an external process as
      sometimes the shutdown or disappearing event comes too close
      for cups-browsed receiving a printer-modified notification
      from CUPS before (LP: #1731417)

 -- Didier Raboud <email address hidden> Fri, 17 May 2019 10:01:20 +0200

Changed in cups-filters (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
FrankStefani (too-clever) wrote :

Where can I find and download "cups-filters (1.23.0-1)" right now?

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

The 1.23.0-1 version got uploaded to the development of 19.10 (Eoan). For getting it into an already released Ubuntu version, a Stable Release Update (SRU) would be needed. But note that if you are still using 18.10 (Cosmic), that in a few months (end-July) the support for Cosmic ends, so SRUs for this version do not make much sense. So I recommend you to upgrade to 19.04 (Disco) and try whether the problem still persists for you and report back here.

Revision history for this message
FrankStefani (too-clever) wrote :

Where can I find and download "cups-filters (1.23.0-1)" right now?

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I have now backported cups-filters 1.23.0 to Cosmic. To install it, go to my PPA

https://launchpad.net/~till-kamppeter/+archive/ubuntu/ppa

Follow the instructions under "Adding this PPA to your system" and then update your system. You will get the new cups-filters which contains my changes. Note that this version of cups-filters requires an update of QPDF which you will automatically get together with cups-filters.

Please tell whether this version solves your problem.

To post a comment you must log in.