apache2 fails to start after rebooting gerrit machines (role(gerrit)). It fails with "failed to bind to IPv6 address"
journalctl -u apache2 Jan 03 10:33:34 gerrit1001 systemd[1]: Starting The Apache HTTP Server... Jan 03 10:33:35 gerrit1001 apachectl[846]: (99)Cannot assign requested address: AH00072: make_sock: could not bind to address [2620:0:861:2:208:80:154:137]:80 Jan 03 10:33:35 gerrit1001 apachectl[846]: no listening sockets available, shutting down Jan 03 10:33:35 gerrit1001 apachectl[846]: AH00015: Unable to open logs Jan 03 10:33:35 gerrit1001 apachectl[846]: Action 'start' failed. Jan 03 10:33:35 gerrit1001 apachectl[846]: The Apache error log may have more information. Jan 03 10:33:35 gerrit1001 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE Jan 03 10:33:35 gerrit1001 systemd[1]: apache2.service: Failed with result 'exit-code'. Jan 03 10:33:35 gerrit1001 systemd[1]: Failed to start The Apache HTTP Server.
My guess it the puppet code for setting up the second interface runs after the first service restart. So the service fails until the interface is configured by the next puppet run.
interface::alias { 'gerrit server':
ipv4 => $ipv4,
ipv6 => $ipv6,
}in modules/profile/manifests/gerrit.pp:L27
For reference, Apache TCP listening ports on gerrit2002:
hashar@gerrit2002:~$ sudo netstat -tlnp|grep apache2 tcp 0 0 208.80.153.104:443 0.0.0.0:* LISTEN 4424/apache2 tcp 0 0 127.0.0.1:443 0.0.0.0:* LISTEN 4424/apache2 tcp 0 0 208.80.153.104:80 0.0.0.0:* LISTEN 4424/apache2 tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 4424/apache2 tcp6 0 0 2620:0:860:4:208:80:443 :::* LISTEN 4424/apache2 tcp6 0 0 ::1:443 :::* LISTEN 4424/apache2 tcp6 0 0 2620:0:860:4:208:80::80 :::* LISTEN 4424/apache2 tcp6 0 0 ::1:80 :::* LISTEN 4424/apache2