Avahi reports IPv6/IPv4 and "dnssd" CUPS backend only tries IPv6, no IPv4 fallback

Bug #1099184 reported by MagnusPI
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
avahi (Ubuntu)
Invalid
High
Unassigned

Bug Description

lsb_release -rd
Description: Ubuntu 12.04.1 LTS
Release: 12.04
---------------------------------
avahi-daemon 0.6.30-5ubuntu2
cups 1.5.3-0ubuntu6
--------------------------------

Avahi for default publishes services also in IPv6 as in /etc/avahi/avahi-daemon.conf there is
use-ipv6=yes

At the same time services are listening on IPv4 addresses only.

Cups is able to discover published printers via dnssd protocol but its ipp backend prints only on the IPv6 resolved address which does not answer and it does not try the IPv4 address.

------------------------------------
Excerpt from "avahi-browse -a -t -r" to show the IPv6 and IPv4 addresses

+ wlan0 IPv6 Hewlett-Packard HP LaserJet 1100 @ hjemme Internet Printer local
+ wlan0 IPv4 Hewlett-Packard HP LaserJet 1100 @ hjemme Internet Printer local
+ wlan0 IPv6 MobilIgor5a [00:26:82:9d:b9:6d] Workstation local
+ wlan0 IPv6 hjemme [00:40:f4:ff:55:32] Workstation local

[....]

= wlan0 IPv6 Hewlett-Packard HP LaserJet 1100 @ hjemme Internet Printer local
   hostname = [hjemme.local]
   address = [fe80::240:f4ff:feff:5532]
   port = [631]
   txt = ["printer-type=0x900E" "printer-state=3" "Scan=F" "Sort=F" "Bind=F" "Punch=F" "Collate=F" "Copies=F" "Staple=F" "Duplex=F" "Color=T" "Fax=F" "Binary=F" "Transparent=F" "TLS=1.2" "UUID=1577ef95-eecb-3eae-6d02-aa29003eb546" "URF=DM3" "pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/urf" "product=(HP LaserJet 1100xi Printer)" "priority=0" "note=hjemme" "adminurl=http://hjemme.local:631/printers/Hewlett-Packard-HP-LaserJet-1100" "ty=HP LaserJet 1100, hpcups 3.12.2" "rp=printers/Hewlett-Packard-HP-LaserJet-1100" "qtotal=1" "txtvers=1"]
= wlan0 IPv6 hjemme Remote Disk Management local
   hostname = [hjemme.local]
   address = [fe80::240:f4ff:feff:5532]
   port = [22]
   txt = []
= wlan0 IPv6 hjemme [00:40:f4:ff:55:32] Workstation local
   hostname = [hjemme.local]
   address = [fe80::240:f4ff:feff:5532]
   port = [9]
   txt = []
= wlan0 IPv4 Hewlett-Packard HP LaserJet 1100 @ hjemme Internet Printer local
   hostname = [hjemme.local]
   address = [192.168.1.2]
   port = [631]
   txt = ["printer-type=0x900E" "printer-state=3" "Scan=F" "Sort=F" "Bind=F" "Punch=F" "Collate=F" "Copies=F" "Staple=F" "Duplex=F" "Color=T" "Fax=F" "Binary=F" "Transparent=F" "TLS=1.2" "UUID=1577ef95-eecb-3eae-6d02-aa29003eb546" "URF=DM3" "pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/urf" "product=(HP LaserJet 1100xi Printer)" "priority=0" "note=hjemme" "adminurl=http://hjemme.local:631/printers/Hewlett-Packard-HP-LaserJet-1100" "ty=HP LaserJet 1100, hpcups 3.12.2" "rp=printers/Hewlett-Packard-HP-LaserJet-1100" "qtotal=1" "txtvers=1"]

----------------
Excerpt from /var/log/cups/error_log to show that only IPv6 address is tried

I [13/Jan/2013:18:02:55 +0100] [Job 61] Started backend /usr/lib/cups/backend/dnssd (PID 7179)
D [13/Jan/2013:18:02:55 +0100] [Job 61] Resolving "Hewlett-Packard HP LaserJet 1100 @ hjemme._ipp._tcp.local"...
D [13/Jan/2013:18:02:55 +0100] [Job 61] STATE: +connecting-to-device
D [13/Jan/2013:18:02:55 +0100] [Job 61] Resolving "Hewlett-Packard HP LaserJet 1100 @ hjemme", regtype="_ipp._tcp", domain="local."...
D [13/Jan/2013:18:02:55 +0100] [Job 61] PPD uses qualifier 'Gray.Plain.'
D [13/Jan/2013:18:02:55 +0100] [Job 61] Calling FindDeviceById(LaserJet_1100xi_Printer)
D [13/Jan/2013:18:02:55 +0100] [Job 61] Failed to send: org.freedesktop.ColorManager.Failed:device id 'LaserJet_1100xi_Printer' does not exists
D [13/Jan/2013:18:02:55 +0100] [Job 61] Failed to get profile filename!
I [13/Jan/2013:18:02:55 +0100] [Job 61] no profiles specified in PPD
D [13/Jan/2013:18:02:55 +0100] [Job 61] Set job-printer-state-message to "no profiles specified in PPD", current level=INFO
D [13/Jan/2013:18:02:55 +0100] [Job 61] Ghostscript command line: /usr/bin/gs -dQUIET -dPARANOIDSAFER -dNOPAUSE -dBATCH -dNOINTERPOLATE -sDEVICE=cups -sstdout=%stderr -sOutputFile=%stdout -sMediaType=Plain -sOutputType=0 -r600x600 -dMediaPosition=7 -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=841 -dcupsBitsPerColor=1 -dcupsColorOrder=0 -dcupsColorSpace=3 -dcupsRowCount=1 -dcupsRowStep=2 -dcupsInteger0=26 -scupsPageSizeName=A4 -I/usr/share/cups/fonts -c -f -_
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[0]="CUPS_CACHEDIR=/var/cache/cups"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[1]="CUPS_DATADIR=/usr/share/cups"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[2]="CUPS_DOCROOT=/usr/share/cups/doc-root"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[3]="CUPS_FONTPATH=/usr/share/cups/fonts"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[4]="CUPS_REQUESTROOT=/var/spool/cups"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[5]="CUPS_SERVERBIN=/usr/lib/cups"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[6]="CUPS_SERVERROOT=/etc/cups"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[7]="CUPS_STATEDIR=/var/run/cups"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[8]="HOME=/var/spool/cups/tmp"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[9]="PATH=/usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[10]="SERVER_ADMIN=root@MobilIgor5a"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[11]="SOFTWARE=CUPS/1.5.3"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[12]="USER=root"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[13]="CUPS_SERVER=/var/run/cups/cups.sock"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[14]="CUPS_ENCRYPTION=IfRequested"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[15]="IPP_PORT=631"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[16]="CHARSET=utf-8"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[17]="LANG=en_US.UTF-8"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[18]="PPD=/etc/cups/ppd/LaserJet_1100xi_Printer.ppd"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[19]="RIP_MAX_CACHE=128m"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[20]="CONTENT_TYPE=application/pdf"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[21]="DEVICE_URI=dnssd://Hewlett-Packard%20HP%20LaserJet%201100%20%40%20hjemme._ipp._tcp.local/cups"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[22]="PRINTER_INFO=LaserJet_1100xi_Printer"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[23]="PRINTER_LOCATION=MobilIgor5a"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[24]="PRINTER=LaserJet_1100xi_Printer"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[25]="PRINTER_STATE_REASONS=none"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[26]="CUPS_FILETYPE=document"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[27]="FINAL_CONTENT_TYPE=printer/LaserJet_1100xi_Printer"
D [13/Jan/2013:18:02:55 +0100] [Job 61] envp[28]="AUTH_INFO_REQUIRED=none"
I [13/Jan/2013:18:02:55 +0100] [Job 61] Start rendering...
D [13/Jan/2013:18:02:55 +0100] [Job 61] Set job-printer-state-message to "Start rendering...", current level=INFO
I [13/Jan/2013:18:02:55 +0100] [Job 61] Processing page 1...
D [13/Jan/2013:18:02:55 +0100] [Job 61] Set job-printer-state-message to "Processing page 1...", current level=INFO
D [13/Jan/2013:18:02:55 +0100] [Job 61] Resolved as "ipp://[fe80::240:f4ff:feff:5532]:631/printers/Hewlett-Packard-HP-LaserJet-1100"...
D [13/Jan/2013:18:02:55 +0100] [Job 61] STATE: -connecting-to-device,offline-report
D [13/Jan/2013:18:02:55 +0100] [Job 61] Executing backend "/usr/lib/cups/backend/ipp"...
D [13/Jan/2013:18:02:55 +0100] [Job 61] Sending stdin for job...
D [13/Jan/2013:18:02:55 +0100] [Job 61] update_reasons(attr=0(), s="+connecting-to-device")
d [13/Jan/2013:18:02:55 +0100] [Job 61] op='+', new_reasons=1, state_reasons=1
D [13/Jan/2013:18:02:55 +0100] [Job 61] STATE: +connecting-to-device
D [13/Jan/2013:18:02:55 +0100] [Job 61] Looking up "fe80::240:f4ff:feff:5532"...
D [13/Jan/2013:18:02:55 +0100] [Job 61] PAGE: 1 1
D [13/Jan/2013:18:02:57 +0100] [Job 61] prnt/hpcups/HPCupsFilter.cpp 686: First raster data plane..DEBUG2: hrDeviceDesc="Unknown"
D [13/Jan/2013:18:02:59 +0100] [Job 61] prtGeneralCurrentLocalization type is 0, expected 2!
D [13/Jan/2013:18:02:59 +0100] [Job 61] backendWaitLoop(snmp_fd=6, addr=0x7f9b29cfde68, side_cb=0x7f9b28cb8040)
D [13/Jan/2013:18:02:59 +0100] [Job 61] Connecting to fe80::240:f4ff:feff:5532:631
I [13/Jan/2013:18:02:59 +0100] [Job 61] Connecting to printer.
D [13/Jan/2013:18:02:59 +0100] [Job 61] Set job-printer-state-message to "Connecting to printer.", current level=INFO
D [13/Jan/2013:18:02:59 +0100] [Job 61] Connection error: Invalid argument
E [13/Jan/2013:18:02:59 +0100] [Job 61] The printer is not responding.
D [13/Jan/2013:18:02:59 +0100] [Job 61] Set job-printer-state-message to "The printer is not responding.", current level=ERROR

Revision history for this message
Alex Zhang (alexzhangh) wrote :

this occurs for me as well; disabling ipv6 broadcasting for avahi on the host machine connected to the printer resolved the issue

summary: - avahi publishes IPv6/IPv4 and ipp backend in cups uses only IPv6
+ Avahi reports IPv6/IPv4 and "dnssd" CUPS backend only tries IPv6, no
+ IPv4 fallback
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Reported problem to CUPS upstream as

https://www.cups.org/str.php?L4305

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

According to the CUPS upstream bug report

https://www.cups.org/str.php?L4305

this is an Avahi bug:

----------
This is an Avahi bug - there is no zone ID in the address, and the address is link-local (zone ID required).

Just using the hostname (and praying that the distro/OS that is using Avahi has bothered to setup Avahi to do resolution of .local names) isn't going to help, all it will do is create another bug report that printing is "slow" because we'll try IPv6 and then fall back to IPv4 when the IPv6 connection times out.
----------

Moving to the avahi package.

affects: cups (Ubuntu) → avahi (Ubuntu)
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

The IPv6 address reported by Avahi seems to be [fe80::240:f4ff:feff:5532] here.

Changed in avahi (Ubuntu):
importance: Undecided → High
milestone: none → ubuntu-13.04
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in avahi (Ubuntu):
status: New → Confirmed
Revision history for this message
Keith Wansbrough (keithw-lochan) wrote :

This affects me as well, using a Canon MG3250 over WiFi. The printer supports both IPv4 and IPv6, but CUPS is only able to connect to it when it chooses the IPv4 address, which appears to be about 50% of the time.

I was able to work around the problem by going to my printer's web control panel, going to the Network Settings page, and choosing "Disable IPv6". After a few seconds, Avahi (avahi-browse -a -t -r) no longer reports IPv6 support for my printer, and everything works splendidly.

Obviously a fix for Avahi or CUPS would be preferable.

/var/log/cups/error.log shows the following for success:

D [20/Dec/2013:23:05:05 +0000] [Job 1433] Connecting to 192.168.0.16:631
I [20/Dec/2013:23:05:05 +0000] [Job 1433] Connecting to printer.
D [20/Dec/2013:23:05:05 +0000] [Job 1433] Set job-printer-state-message to "Connecting to printer.", current level=INFO
D [20/Dec/2013:23:05:05 +0000] Discarding unused job-progress event...
D [20/Dec/2013:23:05:05 +0000] Discarding unused printer-state-changed event...
D [20/Dec/2013:23:05:05 +0000] [Job 1433] update_reasons(attr=0(), s="-cups-certificate-error")
D [20/Dec/2013:23:05:05 +0000] [Job 1433] update_reasons(attr=0(), s="-connecting-to-device")
D [20/Dec/2013:23:05:05 +0000] [Job 1433] STATE: -connecting-to-device
I [20/Dec/2013:23:05:05 +0000] [Job 1433] Connected to printer.
D [20/Dec/2013:23:05:05 +0000] [Job 1433] Set job-printer-state-message to "Connected to printer.", current level=INFO
D [20/Dec/2013:23:05:05 +0000] [Job 1433] Connected to 192.168.0.16:631...

and the following for failure:

D [20/Dec/2013:23:05:05 +0000] [Job 1433] Connecting to 192.168.0.16:631
I [20/Dec/2013:23:05:05 +0000] [Job 1433] Connecting to printer.
D [20/Dec/2013:23:05:05 +0000] [Job 1433] Set job-printer-state-message to "Connecting to printer.", current level=INFO
D [20/Dec/2013:23:05:05 +0000] Discarding unused job-progress event...
D [20/Dec/2013:23:05:05 +0000] Discarding unused printer-state-changed event...
D [20/Dec/2013:23:05:05 +0000] [Job 1433] update_reasons(attr=0(), s="-cups-certificate-error")
D [20/Dec/2013:23:05:05 +0000] [Job 1433] update_reasons(attr=0(), s="-connecting-to-device")
D [20/Dec/2013:23:05:05 +0000] [Job 1433] STATE: -connecting-to-device
I [20/Dec/2013:23:05:05 +0000] [Job 1433] Connected to printer.
D [20/Dec/2013:23:05:05 +0000] [Job 1433] Set job-printer-state-message to "Connected to printer.", current level=INFO
D [20/Dec/2013:23:05:05 +0000] [Job 1433] Connected to 192.168.0.16:631...

I am using CUPS 1.5.3 on Ubuntu 12.04LTS.

Revision history for this message
nim (nimpetro) wrote :

I have a Canon iX6820 printer. I have updated recommended driver for Ubuntu Linux. That was in Linux Mint 17.3. The printer worked flawlessly.

I upgraded to Linux Mint 18.2 and reinstalled the same driver. When I print a landscape print job, generated in LibreOffice Writer on legal paper, the text prints only the center of the text and rotated 90 degrees and at the top of the page. If I generate a .pdf of the page, it prints landscape in the center of a portrait page with the whole thing shrunk to fit. Not good unless I read it with a magnifying glass.
https://www.printererrorrepair.com/canon-customer-service/

Revision history for this message
Trent Lloyd (lathiat) wrote :

Hi Nim (nimpetro),

You've added a comment to an existing bug, which dopes not appear to be related to the problem you are having. This bug is about network issues with CUPS connecting to printers and not related to the page print formatting being incorrect.

Please either open a new bug for your issue or seek support through our forums or another public resource. You can find a list of such community support resources here (load the page then click "Find community support")
https://www.ubuntu.com/support/community-support

I would suggest they might be a better place to start than a new bug. Off hand, if I had to guess I would suggest checking your page size is set correctly when printing, it's possible it does not match your actual paper. Not sure about the 90 degree rotation please. But please don't reply to that guess in this bug and take information about that to a new thread on the forums/discourse.

Regards,
Trent

description: updated
description: updated
description: updated
summary: - Avahi reports IPv6/IPv4 and "dnssd" CUPS backend only tries IPv6, no
- IPv4 fallback
+ Buy Utram Online No Prescription | Tramadol For Joint Pain
Colin Watson (cjwatson)
summary: - Buy Utram Online No Prescription | Tramadol For Joint Pain
+ Avahi reports IPv6/IPv4 and "dnssd" CUPS backend only tries IPv6, no
+ IPv4 fallback
description: updated
Revision history for this message
Trent Lloyd (lathiat) wrote :

This is a bug in CUPS, CUPS needs to remember the address family of the advertised service (and preferably the interface ID). Avahi does know this interface and does provide it in the API responses to CUPS, but it's currently not using it.

For more detailed information please refer to here:
https://github.com/lathiat/avahi/issues/125

Changed in avahi (Ubuntu):
status: Confirmed → Invalid
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.