Ubuntu

can't bind to ::1

Reported by lirel on 2009-07-09
72
This bug affects 12 people
Affects Status Importance Assigned to Milestone
apr (Debian)
Fix Released
Unknown
apr (Ubuntu)
Medium
Andrew Mitchell

Bug Description

Binary package hint: apache2

the configuration directive
     Listen [::1]:3000
in Server Configuration context in ports.conf line 12 fails with:
 [crit] (EAI 9)Address family for hostname not supported: alloc_listener: failed to set up sockaddr for ::1
 Syntax error on line 12 of <snip>ports.conf:
 Listen setup failed

omitting the address and only specifying the port works seamlessly but lets apache2 only bind to ipv4 addresses
the ipv6 kernel module is loaded and ping6 ::1 works

i'm running the apache instance as normal user with ServerRoot in my homedir

this: http://ubuntuforums.org/showthread.php?t=935955 didn't help

ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 8.10
Package: apache2-mpm-prefork 2.2.9-7ubuntu3.1
ProcEnviron:
 PATH=/ehome/User Name/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
SourcePackage: apache2
Uname: Linux 2.6.27-14-generic x86_64

lirel (m8r-lcodw5) wrote :
description: updated

I am seeing this behaviour exactly as described. I've updated the status to confirmed.

Changed in apache2 (Ubuntu):
status: New → Confirmed
Francis Upton (francisu) wrote :

Happens also on Jaunty:

uname -a
Linux berlioz 2.6.28-15-generic #49-Ubuntu SMP Tue Aug 18 19:25:34 UTC 2009 x86_64 GNU/Linux

Let me know if you need more information about my configuration.

Chuck Short (zulcss) on 2009-10-14
Changed in apache2 (Ubuntu):
status: Confirmed → Triaged
lirel (m8r-lcodw5) wrote :

this is not only related to ::1, but happens to fe80::217:<snip>:<snip>:3a85 and [::] , too.
with etc hosts:
127.0.0.1 localhost
127.0.1.1 bradley.lan bradley

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

and
[Fri Oct 16 03:04:49 2009] [crit] (EAI 9)Address family for hostname not supported: alloc_listener: failed to set up sockaddr for ::
as startup-error

Chuck Short (zulcss) wrote :

My research is leading me to the believe that the nework interface is not up when this is happening. Are you using network manager, and if possible can you try this on karmic?

Thanks
chuck

lirel (m8r-lcodw5) wrote :

the interface is always up, but: sometimes there is an routing advertise daemon available and sometimes not

Jean-Pierre (jpierre) wrote :

I'm affected by this bug. Apache2 seems completely unable to bind to IPv6. Even specifying only port doesn't bind to IPv6 in any way.

Rémy Sanchez (thenux) wrote :

I've got the problem as well, Apache is not listening to IPv6 and any attempt to add "Listen [::]:80" or anything of the like results in an error.

FYI, Debian's Apache runs IPv6 with no problem at all, and by default (did not have to change anything in the conf to get it to listen to tcp6).

Kolargol00 (kolargol00) wrote :

Same problem on Lucid with apache2 2.2.14-5ubuntu8.3.

Logain Smith (logainsmith) wrote :

Same problem with Ubuntu 10.04 and latest Apache with IPv6 enabled:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.2 LTS
Release: 10.04
Codename: lucid

$ uname -a
Linux 2.6.32-24-generic #39-Ubuntu SMP Wed Jul 28 06:07:29 UTC 2010 i686 GNU/Linux

$ apache2 -v
Server version: Apache/2.2.14 (Ubuntu)
Server built: Nov 18 2010 21:17:19

$ cat /etc/apache2/apache2.conf | grep Listen
Listen 0.0.0.0:81 #this line works
Listen [::]:8765 #this line breaks

$ sudo /etc/init.d/apache2 start
[crit] (EAI 9)Address family for hostname not supported: alloc_listener: failed to set up sockaddr for ::
Syntax error on line 41 of /etc/apache2/apache2.conf:
Listen setup failed

$ ping6 ::1
PING ::1(::1) 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=0.005 ms
64 bytes from ::1: icmp_seq=2 ttl=64 time=0.004 ms
64 bytes from ::1: icmp_seq=3 ttl=64 time=0.005 ms
64 bytes from ::1: icmp_seq=4 ttl=64 time=0.000 ms
--- ::1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 0.000/0.000/0.000/0.000 ms

Changed in apache2 (Ubuntu):
assignee: nobody → Andrew Mitchell (ajmitch)
Dave Walker (davewalker) wrote :

@ajmitch Hi, i just wondered how this was progressing? Thanks.

Andrew Mitchell (ajmitch) wrote :

Sorry I hadn't got back to this sooner, but this looks to be due to a specific patch in eglibc which had been disabled due to issues, but was subsequently re-enabled to fix #417757
Apache uses getaddrinfo with AI_ADDRCONFIG to check whether it can use ipv6, which has been problematic with libc6 due to broken routers.

Changed in apr (Debian):
status: Unknown → Confirmed
Clint Byrum (clint-fewbar) wrote :

Reassigning to apr in Ubuntu, as the problem has been identified as in apr, not apache.

affects: apache2 (Ubuntu) → apr (Ubuntu)
Changed in apr (Ubuntu):
importance: Undecided → Medium
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apr - 1.4.6-3

---------------
apr (1.4.6-3) unstable; urgency=low

  * Fix some issues with resolving loopback addresses of a protocol family
    that is not otherwise configured on a host. Many thanks to Jean-Michel
    Vourgère and Aurelien Jarno for debugging this.
    Closes: #500558, #629899 LP: #397393
  * Pull updates from upstream branch 1.4.x up to r1343251
  * Add some debug output in order to debug test failures on kfreebsd-i386.

 -- Stefan Fritsch <email address hidden> Mon, 28 May 2012 16:02:12 +0200

Changed in apr (Ubuntu):
status: Triaged → Fix Released
Changed in apr (Debian):
status: Confirmed → Fix Released
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

Remote bug watches

Bug watches keep track of this bug in other bug trackers.