cups server connection worked nicely under 12.10 but fails on 13.04

Bug #1159213 reported by Christopher Barrington-Leigh
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
cups-filters (Ubuntu)
Fix Released
Medium
Till Kamppeter

Bug Description

I'm at McGill.
Under 12.04 I just typed (with sudo) once

cupsctl BrowsePoll=cups.ncs.mcgill.ca:631
cupsctl Browsing=On

and restarted the cups server and then lpstat -p listed the printers I could use, and lp -U... -d mcgill_mono etc would send my jobs to the printer.

This fails under 13.04.

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: cups 1.6.2-1ubuntu2
ProcVersionSignature: Ubuntu 3.8.0-13.23-generic 3.8.3
Uname: Linux 3.8.0-13-generic x86_64
ApportVersion: 2.9.2-0ubuntu2
Architecture: amd64
CupsErrorLog:
 E [23/Mar/2013:07:55:01 -0400] Unknown directive BrowsePoll on line 83 of /etc/cups/cupsd.conf.
 E [23/Mar/2013:08:53:15 -0400] Unknown directive BrowsePoll on line 83 of /etc/cups/cupsd.conf.
Date: Sat Mar 23 09:14:21 2013
InstallationDate: Installed on 2013-03-18 (4 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Alpha amd64 (20130318)
Lpstat: Error: command ['lpstat', '-v'] failed with exit code 1: lpstat: No destinations added.
MachineType: LENOVO 2901CTO
MarkForUpload: True
Papersize: letter
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.8.0-13-generic root=UUID=fcf8343d-2c1d-4f25-ab52-876891045ee9 ro quiet splash vt.handoff=7
SourcePackage: cups
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 04/25/2012
dmi.bios.vendor: LENOVO
dmi.bios.version: 6UET69WW (1.49 )
dmi.board.name: 2901CTO
dmi.board.vendor: LENOVO
dmi.board.version: Not Available
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Not Available
dmi.modalias: dmi:bvnLENOVO:bvr6UET69WW(1.49):bd04/25/2012:svnLENOVO:pn2901CTO:pvrThinkPadT410s:rvnLENOVO:rn2901CTO:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable:
dmi.product.name: 2901CTO
dmi.product.version: ThinkPad T410s
dmi.sys.vendor: LENOVO

Revision history for this message
Christopher Barrington-Leigh (cpbl) wrote :
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

The CUPS which comes with 13.04 does not support BrowsePoll any more. This feature got dropped upstream. Instead you can use the legacy server/client support of the new cups-browsed which comes with 13.04. First, update your system so that you get cups-browsed of at least version 1.0.31-0ubuntu2. Then edit the file /etc/cups/cups-browsed.conf adding the lines

BrowsePoll cups.ncs.mcgill.ca:631
Browsing On

and restart cups-browsed via

sudo restart cups-browsed

This activates the appropriate legacy functionality of cups-browsed.

Also note that you do not need to restart CUPS after using cupsctl. cupsctl already does it for you. And if you are in the account of the first user (or of any user who got granted admin rights) you can use cupsctl also without sudo.

Changed in cups (Ubuntu):
status: New → Won't Fix
Revision history for this message
Christopher Barrington-Leigh (cpbl) wrote :

Hi. Thank you!!
But this does not work:

$ apt-cache policy cups-browsed
cups-browsed:
  Installed: 1.0.31-0ubuntu2
  Candidate: 1.0.31-0ubuntu2
  Version table:
 *** 1.0.31-0ubuntu2 0
        500 http://ca.archive.ubuntu.com/ubuntu/ raring/main amd64 Packages
        100 /var/lib/dpkg/status

$ more /etc/cups/cups-browsed.conf
$ cat !$
cat /etc/cups/cups-browsed.conf
# Which protocols will we use to discover printers on the network?
# Can use DNSSD and/or CUPS, or 'none' for neither.
BrowseRemoteProtocols dnssd

# Use BrowsePoll to poll a particular CUPS server
# BrowsePoll cups.example.com

BrowsePoll cups.ncs.mcgill.ca:631
Browsing On

$ sudo restart cups-browsed
cups-browsed start/running, process 21545

$ lpstat -p
lpstat: No destinations added.

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

Try replacing

BrowseRemoteProtocols dnssd

by

BrowseRemoteProtocols dnssd cups

in /etc/cups/cups-browsed.conf

Does this work?

Tim, is the /etc/cups/cups-browsed.conf correct for doing BrowsePoll? What is exactly needed.

Revision history for this message
Christopher Barrington-Leigh (cpbl) wrote :

That does NOT work for me.
I changed that line, restarted browsed (and cups), and got the same result as before.
My /etc/cups/cups-browsed.conf looks like:

# Which protocols will we use to discover printers on the network?
# Can use DNSSD and/or CUPS, or 'none' for neither.
BrowseRemoteProtocols dnssd cups

# Use BrowsePoll to poll a particular CUPS server
# BrowsePoll cups.example.com

BrowsePoll cups.ncs.mcgill.ca:631
Browsing On

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

Christopher, can you try removing "Browsing On" and restarting cups-browsed and if this does not work, return the line "BrowseRemoteProtocols dnssd cups" back to "BrowseRemoteProtocols dnssd" and restart cups-browsed again? Does this work?

Revision history for this message
Christopher Barrington-Leigh (cpbl) wrote :

Removed "browsing on".
restarted cups-browsed.
No good:

$ lpstat -p
lpstat: No destinations added

Then I removed "cups" from the protocols line.
restarted

No good. Same as above.

Is there a more detailed/verbose query I can run? or is lpstat the best?

Thank you, Till.

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

Can you try

BrowsePoll cups.ncs.mcgill.ca

instead of

BrowsePoll cups.ncs.mcgill.ca:631

Does this work?

Revision history for this message
Christopher Barrington-Leigh (cpbl) wrote :

Bingo!

ie, that brings up the printers. So the correct new .conf format is as follows:

# Which protocols will we use to discover printers on the network?
# Can use DNSSD and/or CUPS, or 'none' for neither.
BrowseRemoteProtocols dnssd

# Use BrowsePoll to poll a particular CUPS server
# BrowsePoll cups.example.com

BrowsePoll cups.ncs.mcgill.ca

(1) If we were to advise McGill on an update to http://kb.mcgill.ca/?portalid=2&articleid=4762#tab:homeTab:crumb:7:artId:3297
are there cupsctl commands which would generate the above?

(2) For those carrying out an upgrade to 13.04, could the changes above be automated in the upgrade process?

Thank you!!

Revision history for this message
Christopher Barrington-Leigh (cpbl) wrote :

Oh, this works too:

BrowseRemoteProtocols cups
BrowsePoll cups.ncs.mcgill.ca

and so does this:

BrowseRemoteProtocols cups
BrowsePoll cups.ncs.mcgill.ca
Browsing On

but if I add the :631 to the hostname, it fails.
Therefore, the only problem was the :631.

Now, is this is a bug?

Revision history for this message
Christopher Barrington-Leigh (cpbl) wrote :

This works fine too, btw:

BrowseRemoteProtocols cups dnssd
BrowsePoll cups.ncs.mcgill.ca
Browsing On

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

Christopher, the BrowsePoll and CUPS Broadcastin/Browsing part is not written by me but contributed by Tim Waugh from Red Hat. It seems that in the config file the ":<port>" extension for server names is not supported but instead, always port 631 is used (works for 99 % of the users). Unknown directives (like "Browsing" seem to be ignored, and BrowsePoll works independently of whether CUPS Browsing ("BrowseRemoteProtocols cups") is activated or not.

Tim, can you add "...:<port>" support for server names?

Note that control via cupsctl is not possible as cupsctl only modifies /etc/cups/cupsd.conf by sending IPP commands to CUPS and CUPS actually doing the modifications. CUPS cannot modify any third-party file like /etc/cups/cups-browsed.conf.

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

Fix committed upstream. Tim, thank you very much for the quick patch.

no longer affects: cups (Ubuntu)
Changed in cups-filters (Ubuntu):
importance: Undecided → Medium
status: New → In Progress
milestone: none → ubuntu-13.04
assignee: nobody → Till Kamppeter (till-kamppeter)
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Tim, which lines of the /etc/cups/cupsd.conf of CUPS 1.5.x (or patched 1.6.x of Quantal) can we copy over to /etc/cups/cups-browsed.conf so that the user's CUPS Broadcasting/Browsing and BrowsePoll gets conserved as best as possible?

Revision history for this message
Tim Waugh (twaugh) wrote :

For Fedora we just copy over BrowsePoll. There's not much point in copying over anything else: DNS-SD is meant to "just work" anyway, and in any case it's the preferred option.

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

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

---------------
cups-filters (1.0.33-0ubuntu1) raring; urgency=low

  * New upstream bug fix release
     - cups-browsed: Added NULL check (Upstream bug #1106).

cups-filters (1.0.32-1) experimental; urgency=low

  * New upstream bug fix release
     - cups-browsed: Shared algorithm to generate local queues based on
       browsed remote queue data between Bonjour and CUPS browsing, as the
       simpler method used for CUPS browsing could overwrite local print
       queues and had de-duplication problems, for example if the server
       appears on two IPs in the network (connected by both ethernet and
       WLAN).
     - cups-browsed: CUPS broadcasting also broadcasted non-shared,
       especially cups-browsed-generated printers. Switched to detection
       of non-shared printers by the appropriate bit in the printer-type
       bit field IPP attribute.
     - cups-browsed: Made CUPS broadcasting work also without BrowseAllow
       lines in cups-browsed.conf. In this case we accept all remote
       printers (LP: #1163764).
     - README: Updated documentation for cups-browsed.
     - Added more comments and examples to /etc/cups/cups-browsed.conf.
     - cups-browsed: Added support for "...:<port>" extensions of
       BrowsePoll addresses. Thanks to Tim Waugh from Red Hat
       (LP: #1159213).

  [ Till Kamppeter ]
  * Let cups-browsed overtake browsing-related directives from
    /etc/cups/cupsd.conf into /etc/cups/cups-browsed.conf. Comment out
    directives which introduce CUPS broadcasting/browsing so that users
    use this deprecated method only if absolutely necessary. Add
    comments to tell the user about how to use the added lines.
    (LP: #1159213)

  [ Didier Raboud ]
  * Use the new fonts-freefont-ttf package name
  * Add simple cups-browsed init script (Closes: #700929)
 -- Till Kamppeter <email address hidden> Thu, 04 Apr 2013 17:33:06 +0200

Changed in cups-filters (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Krister Swenson (thekswenson) wrote :

Thanks Christopher for posting this.

Revision history for this message
Christopher Barrington-Leigh (cpbl) wrote :

Has something changed again? My printing using cups browsed went down again. The solution above no longer works after some recent (two weeks) update of 15.04. (See https://bugs.launchpad.net/ubuntu/+source/cups/+bug/1466157)

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.