Cannot assign requested address: AH00072: make_sock: could not bind to address

Bug #1899852 reported by Benjamin Allot on 2020-10-14
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apache2 (Ubuntu)
Undecided
Unassigned
systemd (Ubuntu)
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/ports.conf:Listen <REDACTED ipv4.245>:443
/etc/apache2/ports.conf:Listen <REDACTED ipv4.247>:443
/etc/apache2/ports.conf:Listen [REDACTED IPV6::33]:443
/etc/apache2/ports.conf:Listen [REDACTED IPV6::35]:443

and the /etc/network/interfaces looks like this (no netplan):
# 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.archive.ubuntu.com
# 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-online.target

$ systemctl show apache2.service | grep -E '(Wants|Require|After|Before)'
RemainAfterExit=no
Requires=system.slice sysinit.target -.mount
Before=multi-user.target shutdown.target
After=basic.target sysinit.target systemd-journald.socket system.slice network.target nss-lookup.target systemd-tmpfiles-setup.service remote-fs.target -.mount
RequiresMountsFor=/var/tmp /tmp

$ systemctl show network.target | grep "^After"
After=network-pre.target <email address hidden> <email address hidden> <email address hidden> systemd-resolved.service ufw.service networking.service systemd-networkd.service

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

Benjamin Allot (ballot) on 2020-10-15
description: updated

Hi,
the reason for "I was surprised that the apache2.service does not contain a
After=network-online.target" was discussed here:

https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1786675/comments/8
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1786675/comments/9

(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.

Now to your actual question of "how to order after a given bond interface", that is actually a systemd-networkd/systemd question (reminder question, not a bug - so not a bug report actually).

I'll add bug tasks but think they are incomplete as that is a config/consulting question more than anything else.

Changed in apache2 (Ubuntu):
status: New → Invalid
Changed in systemd (Ubuntu):
status: New → Invalid

Thank you for taking the time to report this bug and helping to make Ubuntu better.

Since it seems likely to me that this is a local configuration problem, rather than a bug in Ubuntu, I'm marking this bug as Incomplete.

If indeed this is a local configuration problem, you can find pointers to get help for this sort of problem here: http://www.ubuntu.com/support/community

Or if you believe that this is really a bug, then you may find it helpful to read "How to report bugs effectively" http://www.chiark.greenend.org.uk/~sgtatham/bugs.html. We'd be grateful if you would then provide a more complete description of the problem, explain why you believe this is a bug in Ubuntu rather than a problem specific to your system, and then change the bug status back to New.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers