AirPrint only works with "ServerAlias *" in /etc/cups/cupsd.conf

Bug #801306 reported by Alan Pope 🍺🐧🐱 🦄
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cups (Ubuntu)
Fix Released
Undecided
Unassigned
Natty
Fix Released
Undecided
Unassigned

Bug Description

I followed the mail from Till on the -devel-discuss list to enable airprint on iPad 1. I am able to see the printer in Safari, but when I print it goes to the "Print center" on iPad and waits. Printer (HP 6310) is switched on and connected via USB. Switching to Print Center on iPad I can see the job in status "waiting" then it briefly switches to "Printing", but switches immediately back to "Waiting". Nothing prints. Will attach screenshots.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: cups 1.4.6-5ubuntu1.2
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
Uname: Linux 2.6.38-8-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Thu Jun 23 20:46:05 2011
Lpstat: device for HP-Officejet-6300-series: hp:/net/Officejet_6300_series?zc=HP4337AB
MachineType: System manufacturer System Product Name
Papersize: a4
PpdFiles: HP-Officejet-6300-series: HP Officejet 6300 Series, hpcups 3.11.1
ProcEnviron:
 LANGUAGE=en_GB:en
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.38-8-generic root=UUID=d1f525b4-6e5e-4485-9fd0-397b2ff2213f ro quiet splash vt.handoff=7
SourcePackage: cups
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 04/24/2009
dmi.bios.vendor: Phoenix Technologies, LTD
dmi.bios.version: ASUS P5N32-E SLI ACPI BIOS Revision 1801
dmi.board.name: P5N32-E SLI
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: 1.XX
dmi.chassis.asset.tag: 123456789000
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnPhoenixTechnologies,LTD:bvrASUSP5N32-ESLIACPIBIOSRevision1801:bd04/24/2009:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnP5N32-ESLI:rvr1.XX:cvnChassisManufacture:ct3:cvrChassisVersion:
dmi.product.name: System Product Name
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer

Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :
Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Can you follow the instructions on https://wiki.ubuntu.com/DebuggingPrintingProblems, especially of the sections "CUPS error_log" and "Capturing print job data"? Thanks.

Changed in cups (Ubuntu):
status: New → Incomplete
Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :

Thanks for the prompt response as always Till, much appreciated.

Attaching the error_log. It looks like it never gets to the computer, so I was unable to capture the job data.

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

This error message appears in your error_log repeatedly:

E [23/Jun/2011:21:52:47 +0100] Request from "[v1.fe80::baff:61ff:fe9e:300e+eth0]" using invalid Host: field "wopr.local"

First off: Is your router making up an IPv6 network?

It looks like that a remote machine (probably your iPad) with the IPv6 IP address fe80::baff:61ff:fe9e:300e is sending a request but with an invaluid host name ("wopr.local"). Can you run the following commands in a terminal window

host wopr.local
host wopr
host <IP address of your computer>

and post their output?

Your error_log contains also this message:

Failed to update TXT record for HP Officejet 6300 series @ wopr: -2

Perhaps it is cause by the other proble, but I am not completely sure.

Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :

Looking at https://wiki.ubuntu.com/IPv6 it seems fe80::/10 is a local-link self-assigned IPv6 address. My router doesn't do ipv6, so I guess this is Ubuntu giving itself an address. I'm using a pretty standard install of Ubuntu - fairly new in fact, and a pretty standard domestic cable modem and router, with nothing special configured, certainly no IPv6.

Whilst I could go through the process of blacklisting the ipv6 module or editing my grub.conf to disable ipv6, this seems very extreme for a normal user just to get printing working?

alan@wopr:~$ host wopr
Host wopr not found: 3(NXDOMAIN)

alan@wopr:~$ host wopr.local
Host wopr.local not found: 3(NXDOMAIN)

alan@wopr:~$ host 10.10.10.110
Host 110.10.10.10.in-addr.arpa. not found: 3(NXDOMAIN)

eth0 Link encap:Ethernet HWaddr 00:1b:fc:22:83:22
          inet addr:10.10.10.110 Bcast:10.10.10.255 Mask:255.255.255.0
          inet6 addr: fe80::21b:fcff:fe22:8322/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:21501453 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10879144 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:29271085392 (29.2 GB) TX bytes:951522611 (951.5 MB)
          Interrupt:22 Base address:0x6000

From another machine on the network:-

alan@hatar:~$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:15:b7:22:79:5d
          inet addr:10.10.10.103 Bcast:10.10.10.255 Mask:255.255.255.0
          inet6 addr: fe80::215:b7ff:fe22:795d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:62765120 errors:0 dropped:0 overruns:0 frame:0
          TX packets:103467537 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1608737968 (1.6 GB) TX bytes:1504557566 (1.5 GB)
          Interrupt:16 Memory:ffae0000-ffb00000

alan@hatar:~$ host wopr
Host wopr not found: 3(NXDOMAIN)

alan@hatar:~$ host wopr.local
Host wopr.local not found: 3(NXDOMAIN)

alan@hatar:~$ ping wopr
ping: unknown host wopr

alan@hatar:~$ ping wopr.local
PING wopr.local (10.10.10.110) 56(84) bytes of data.
64 bytes from wopr.local (10.10.10.110): icmp_req=1 ttl=64 time=0.093 ms
64 bytes from wopr.local (10.10.10.110): icmp_req=2 ttl=64 time=0.099 ms

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

Can you check whether your /etc/cups/cupsd.conf contains the following:

ServerAlias *
Port 631
Listen /var/run/cups/cups.sock

Edit it appropriately if something is missing and rrestart CUPS:

sudo restart cups

Does it work now?

See also

http://hartlessbydesign.com/blog/view/197-airprint-with-ubuntu-1010

More links:

bug 711779
http://www.finnie.org/2010/11/13/airprint-and-linux/

Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :

Woohoo!

The missing line from cupsd.conf was "ServerAlias *". After adding that I restarted cups and tried printing.

I have tested this from iPad 1 running iOS 4.3.3, and an iPhone 4 running iOS beta 5.0 using Safari web browser. I printed plain text and colour images from a web page.

Works nicely. Thanks Till.

Changed in cups (Ubuntu):
status: Incomplete → Confirmed
summary: - Airprint from Safari on ipad doesn't print
+ Airprint only works with "ServerAlias *" in /etc/cups/cupsd.conf
Changed in cups (Ubuntu):
status: Confirmed → In Progress
Changed in cups (Ubuntu):
status: In Progress → Fix Committed
Changed in cups (Ubuntu Natty):
status: New → In Progress
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Uploaded the fix to the -proposed repository for Natty. Please test it and report back here as soon as it gets approved. We post instructions here then. A debdiff of the fix is attached.

Changed in cups (Ubuntu Natty):
status: In Progress → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted cups into natty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

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

Anyone who tests the proposed package for Natty, please edit /etc/cups/cupsd.conf removing (or commenting out) the line

ServerAlias *

or any ServerAlias line with a name with ".local" at its end.

Then restart CUPS via

sudo restart cups

and after that try out whether you can print from your mobile device when you are using the proposed CUPS package.

summary: - Airprint only works with "ServerAlias *" in /etc/cups/cupsd.conf
+ AirPrint only works with "ServerAlias *" in /etc/cups/cupsd.conf
Revision history for this message
Andrew Manson (real_ate) (real-ate) wrote :

I have installed the proposed cups update and now I can print fine from my iPad. I have selectively installed cups, cups-client and cups-bad from the proposed repo and made sure there are no ServerAlias lines in my cups configuration.

Hope this helps.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cups - 1.4.6-11

---------------
cups (1.4.6-11) unstable; urgency=low

  [ Till Kamppeter ]
  * debian/patches/cups-avahi.dpatch: Updated Avahi patch to fix places in
    the CUPS source code where libdns_sd is supported but not Avahi.
    especially accept being called with a hostname with ".local" domain
    so that AirPrint works without "ServerAlias *" in cupsd.conf (LP: #801306).

  [ Steve Langasek ]
  * Build for multiarch. (Closes: #631425)

cups (1.4.6-10) unstable; urgency=low

  * debian/patches/cups-avahi.dpatch: Updated Avahi patch so that it
    generates the DNS-SD service names also correctly if there is a very
    long server name. Before it could crash if the server name was longer than
    AVAHI_LABEL_MAX - 4 (60) characters (LP: #793265).
 -- Martin Pitt <email address hidden> Tue, 28 Jun 2011 18:03:26 +0100

Changed in cups (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I can also confirm that AirPrint works for me. I have tested with an iPad 1 (OS up-to-date) and a Natty server.

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

This bug was fixed in the package cups - 1.4.6-5ubuntu1.3

---------------
cups (1.4.6-5ubuntu1.3) natty-proposed; urgency=low

  * debian/patches/cups-avahi.dpatch: Updated Avahi patch to fix places in
    the CUPS source code where libdns_sd is supported but not Avahi.
    especially accept being called with a hostname with ".local" domain
    so that AirPrint works without "ServerAlias *" in cupsd.conf (LP: #801306).
 -- Till Kamppeter <email address hidden> Fri, 24 Jun 2011 13:30:59 +0200

Changed in cups (Ubuntu Natty):
status: Fix Committed → Fix Released
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.