Ubuntu

client doing wicked ipv6 stuff and failing

Reported by Carl Karsten on 2010-12-07
52
This bug affects 11 people
Affects Status Importance Assigned to Milestone
avahi (Ubuntu)
Undecided
Unassigned
squid-deb-proxy (Ubuntu)
High
Unassigned

Bug Description

Binary package hint: squid-deb-proxy

(veyepar)juser@dhcp42:~$ sudo apt-get install atftp
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  atftp
0 upgraded, 1 newly installed, 0 to remove and 55 not upgraded.
Need to get 30.5 kB of archives.
After this operation, 119 kB of additional disk space will be used.
Err http://us.archive.ubuntu.com/ubuntu/ natty/universe atftp i386 0.7.dfsg-9.2
  Something wicked happened resolving 'fe80::208:2ff:fea0:abcf:8000' (-9 - Address family for hostname not supported)
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/universe/a/atftp/atftp_0.7.dfsg-9.2_i386.deb Something wicked happened resolving 'fe80::208:2ff:fea0:abcf:8000' (-9 - Address family for hostname not supported)
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

(veyepar)juser@dhcp42:~$ apt-cache policy squid-deb-proxy-client
squid-deb-proxy-client:
  Installed: 0.3.3
  Candidate: 0.3.3
  Version table:
 *** 0.3.3 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty/universe i386 Packages
        100 /var/lib/dpkg/status

On the squid-deb-proxy server:
juser@g2:~$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:08:02:a0:ab:cf
          inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0
          inet6 addr: fe80::208:2ff:fea0:abcf/64 Scope:Link

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: squid-deb-proxy-client 0.3.3
ProcVersionSignature: Ubuntu 2.6.37-7.19-generic 2.6.37-rc3
Uname: Linux 2.6.37-7-generic i686
Architecture: i386
Date: Mon Dec 6 18:14:13 2010
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US
 SHELL=/bin/bash
SourcePackage: squid-deb-proxy

Carl Karsten (carlfk) wrote :
dennygoot@gmail.com (dennygoot) wrote :

I am also getting an error whenever i use apt-get to install a package or update, as well as an error with mpg123 when streaming shoutcast stations, which i lump together simple because a, both of these errors showed up at the same time, and b, both seem to be an error with the hosts's address, i think.

here's apt-get's error:

Something wicked happened resolving 'us.archive.ubuntu.com:http'

Micah Cowan (micahcowan) wrote :

It looks to me like apt-avahi-discover is broken for IPv6, as it tries to parse out the IP address, and then sets its results to "$IP:$PORT". For IPv6, it should be "[$IP]:$PORT". Not sure if my implementation is the ideal way to detect IPv4 versus IPv6, but here's a diff attempting to fix this. Try it out (I don't actually know the output format for avahi-browse, and don't have the proxy set up on my machine, so I don't know for sure this thing works).

Apply this against apt-avahi-discover, and see if you get better results.

Carl Karsten (carlfk) wrote :

I asked dennygoot to post his details here thinking it showed this problem was more general than squid-deb-proxy, but now that I think about it I may be wrong: same error does not mean same bug (like "file not found" isn't a problem with fopen() is it a problem with whatever is calling fopen.)

He didn't have any more details, the problem fixed itself, so I am not sure there is any point trying to re-post his report as a separate bug.

tags: added: patch
Carl Karsten (carlfk) wrote :

re: #3: patch won't help.

The added line was meant to wrap IPv6 addresses with [], but it will only be looking for them in IPv4 addresses, so it will never find anything.

 out=$(avahi-browse -kprt $SERVICE|grep '^=;.*;IPv4;.*'|head -n1)
 IP=$(echo "$out"|cut -d';' -f8)
+echo "$IP" | grep -q : >/dev/null >&1 && IP="[$IP]"

Carl Karsten (carlfk) wrote :

here is some examples of avahi-browse output - notice that it isn't consistent - my guess is this is related to getting different results although these 2 examples

juser@dhcp16:~$ avahi-browse -kprt _apt_proxy._tcp
+;wlan0;IPv6;Squid\032deb\032proxy;_apt_proxy._tcp;local
+;wlan0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local
=;wlan0;IPv6;Squid\032deb\032proxy;_apt_proxy._tcp;local;g2.local;fe80::208:2ff:fea0:abcf;8000;
=;wlan0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local;g2.local;192.168.1.20;8000;

juser@dhcp16:~$ avahi-browse -kprt _apt_proxy._tcp
+;wlan0;IPv6;Squid\032deb\032proxy;_apt_proxy._tcp;local
=;wlan0;IPv6;Squid\032deb\032proxy;_apt_proxy._tcp;local;g2.local;fe80::208:2ff:fea0:abcf;8000;
+;wlan0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local
=;wlan0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local;g2.local;192.168.1.20;8000;

Michael Vogt (mvo) on 2010-12-17
Changed in squid-deb-proxy (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Michael Vogt (mvo) wrote :

I sometimes see a issue like this, but I'm struggling to figure out what is causing this. The apt-avahi-discover script is really simple and should never give out ipv6 adresses for the proxy.

Carl Karsten (carlfk) wrote :

So I don't have to go look it up again:

/usr/share/squid-deb-proxy-client/apt-avahi-discover
#!/bin/sh
#
# use avahi to find a _apt_proxy._tcp provider and return
# a http proxy string suitable for apt

SERVICE="_apt_proxy._tcp"

out=$(avahi-browse -kprt $SERVICE|grep '^=;.*;IPv4;.*'|head -n1)
IP=$(echo "$out"|cut -d';' -f8)
PORT=$(echo "$out"|cut -d';' -f9)
echo "http://$IP:$PORT/"

Michael Vogt (mvo) wrote :

I finally got the output that I was looking for:

$ avahi-browse -kprt _apt_proxy._tcp
+;eth0;IPv6;Squid\032deb\032proxy;_apt_proxy._tcp;local
+;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local
=;eth0;IPv6;Squid\032deb\032proxy;_apt_proxy._tcp;local;top.local;fe80::6ef0:49ff:fe1f:bd4b;8000;
=;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local;top.local;fe80::6ef0:49ff:fe1f:bd4b;8000;

Note that the IPv4 address does not really look like a ipv4 address.

Michael Vogt (mvo) wrote :

It looks like upstream is of the opinion that this is valid behavior a workaround needs to be found:
http://<email address hidden>/msg01326.html

Mark Fraser (launchpad-mfraz) wrote :

I seem to be hitting this bug more often than I'm not. Must've tried to update about 10 times tonight and finally got everything refreshing.

mfraser@Rachael:~$ avahi-browse -kprt _apt_proxy._tcp
+;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local
=;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local;Server.local;192.168.2.109;8000;
mfraser@Rachael:~$ avahi-browse -kprt _apt_proxy._tcp
+;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local
=;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local;Server.local;fe80::d685:64ff:fec8:c6bf;8000;
mfraser@Rachael:~$ avahi-browse -kprt _apt_proxy._tcp
+;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local
=;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local;Server.local;fe80::d685:64ff:fec8:c6bf;8000;
mfraser@Rachael:~$ avahi-browse -kprt _apt_proxy._tcp
+;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local
=;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local;Server.local;fe80::d685:64ff:fec8:c6bf;8000;
mfraser@Rachael:~$ avahi-browse -kprt _apt_proxy._tcp
+;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local
=;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local;Server.local;fe80::d685:64ff:fec8:c6bf;8000;
mfraser@Rachael:~$ avahi-browse -kprt _apt_proxy._tcp
+;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local
=;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local;Server.local;fe80::d685:64ff:fec8:c6bf;8000;
^[[Amfraser@Rachael:~$ avahi-browse -kprt _apt_proxy._tcp
+;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local
=;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local;Server.local;fe80::d685:64ff:fec8:c6bf;8000;
mfraser@Rachael:~$ avahi-browse -kprt _apt_proxy._tcp
+;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local
=;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local;Server.local;fe80::d685:64ff:fec8:c6bf;8000;
mfraser@Rachael:~$ avahi-browse -kprt _apt_proxy._tcp
+;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local
=;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local;Server.local;fe80::d685:64ff:fec8:c6bf;8000;
mfraser@Rachael:~$ avahi-browse -kprt _apt_proxy._tcp
+;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local
=;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local;Server.local;fe80::d685:64ff:fec8:c6bf;8000;
mfraser@Rachael:~$ avahi-browse -kprt _apt_proxy._tcp
+;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local
=;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local;Server.local;fe80::d685:64ff:fec8:c6bf;8000;
mfraser@Rachael:~$ avahi-browse -kprt _apt_proxy._tcp
+;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local
=;eth0;IPv4;Squid\032deb\032proxy;_apt_proxy._tcp;local;Server.local;192.168.2.109;8000;

As you can see from above, out of 12 attempts only 2 of them gave an IPv4 address.

tags: added: patch-needswork
removed: patch
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package squid-deb-proxy - 0.4

---------------
squid-deb-proxy (0.4) natty; urgency=low

  * mirror-dstdomain.acl:
    - add ddebs.ubuntu.com to default mirrors
  * apt-avahi-discover:
    - use avahi-resolve to workaround the issue that avahi-browse
      sometimes hands out ipv6 even when asked for ipv4 only,
      many thanks to Andrew Simpson (LP: #686265)
  * contrib/squid-deb-proxy.init:
    - add sysv init script, thanks to Andrew Simpson
  * debian/squid-deb-proxy.upstart:
    - write avahi services file on post-start and kill it again
      on pre-stop (LP: #695937)
  * debian/squid-deb-proxy.squid-deb-proxy-avahi.upstart:
    - removed, this is part of squid-deb-proxy.upstart now
  * Makefile:
    - fix permission of 30autoproxy (LP: #697955)
  * debian/squid-deb-proxy.logrotate:
    - add logrotate file (LP: #718923), thanks to
      Johan van Dijk and Andrew Simpson
 -- Michael Vogt <email address hidden> Wed, 23 Mar 2011 21:53:11 +0100

Changed in squid-deb-proxy (Ubuntu):
status: Confirmed → Fix Released
Changed in avahi (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers