Cannot assign requested address: AH00072: make_sock: could not bind to address
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apache2 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
systemd (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hello,
Let's first list my configuration items:
* apache2 2.4.29-1ubuntu4.14
* release: Ubuntu 18.04.5 LTS
Upon reboot, the following message is seen in apache2.service logs:
-- Unit apache2.service has begun starting up.
Oct 14 12:18:32 SERVER apachectl[3833]: (99)Cannot assign requested address: AH00072: make_sock: could not bind to address [REDACTED IPV6.33]:443
Oct 14 12:18:32 SERVER apachectl[3833]: no listening sockets available, shutting down
Oct 14 12:18:32 SERVER apachectl[3833]: AH00015: Unable to open logs
Oct 14 12:18:32 SERVER apachectl[3833]: Action 'start' failed.
Oct 14 12:18:32 SERVER apachectl[3833]: The Apache error log may have more information.
Oct 14 12:18:33 SERVER systemd[1]: apache2.service: Control process exited, code=exited status=1
Oct 14 12:18:33 SERVER systemd[1]: apache2.service: Failed with result 'exit-code'.
Oct 14 12:18:33 SERVER systemd[1]: Failed to start The Apache HTTP Server.
The apache2 configuration is using the ipv4 and ipv6 present on the server:
/etc/apache2/
/etc/apache2/
/etc/apache2/
/etc/apache2/
and the /etc/network/
# Additional IPs that are used to serve https traffic for
# releases.ubuntu.com so that archive doesn't respond on 443.
auto bond0:1
iface bond0:1 inet static
address <REDACTED IPV4>.247/32
# Using up/down to avoid LP:1347246.
up /sbin/ip addr add REDACTED IPV6::33/128 dev $IFACE preferred_lft 0
down /bin/ip addr del REDACTED IPV6::33/128 dev $IFACE preferred_lft 0
# Additional IPs that are used to serve *.clouds.
# with HTTPProtocolOptions unsafe, which is needed to work around
# cloud-init bug LP:1868232 (cRT#125271).
auto bond0:2
iface bond0:2 inet static
address <REDACTED IPV4>.245/32
# Using up/down to avoid LP:1347246.
up /sbin/ip addr add REDACTED IPV6::35/128 dev $IFACE preferred_lft 0
down /bin/ip addr del REDACTED IPV6::35/128 dev $IFACE preferred_lft 0
I was surprised that the apache2.service does not contain a
After=network-
$ systemctl show apache2.service | grep -E '(Wants|
RemainAfterExit=no
Requires=
Before=
After=basic.target sysinit.target systemd-
RequiresMountsF
$ systemctl show network.target | grep "^After"
After=network-
So I was wondering if the "ifup@bond0" was enough as a dependency here, to be sure to have the ipv6 up and running or if we would need something like "ifup@bond0:2" and "ifup@bond0:1" as part of the list of the services in the network.target "After" list.
Related branches
- Colin Misare: Approve
- Canonical IS Reviewers: Pending requested
-
Diff: 29 lines (+10/-0)2 files modifiedhooks/hooks.py (+5/-0)
templates/systemd-apache-override.tmpl (+5/-0)
description: | updated |
Hi, online. target" was discussed here:
the reason for "I was surprised that the apache2.service does not contain a
After=network-
https:/ /bugs.launchpad .net/ubuntu/ +source/ apache2/ +bug/1786675/ comments/ 8 /bugs.launchpad .net/ubuntu/ +source/ apache2/ +bug/1786675/ comments/ 9
https:/
(and plenty other cases).
A general config just won't work that way, an admin can modify it to that if he wants to for a specific system. But in general network- online. target is most of the time wrong for servers.