Comment 55 for bug 1586528

Revision history for this message
Claudio Kuenzler (napsty) wrote (last edit ):

I've just seen this issue the first time on a Ubuntu 20.04 (updated several months ago from 16.04) AWS EC2 machine. Looking closer into this, the machine lost its IP address multiple times in the last hours. The following avahi-daemon log messages made me find this bug report:

ck@focal:~$ grep avahi-daemon /var/log/syslog | grep -i withdrawing
Jan 18 20:17:42 inf-mon04-p avahi-daemon[941]: Withdrawing address record for 10.10.1.41 on eth0.
Jan 18 21:44:52 inf-mon04-p avahi-daemon[941]: Withdrawing address record for 10.10.1.41 on eth0.

It's very interesting, that both of these events happened EXACTLY one hour after the system boot:

ck@focal:~$ last | head
ck pts/0 xx.xx.xx.xxx Tue Jan 18 22:11 still logged in
root ttyS0 Tue Jan 18 21:50 still logged in
reboot system boot 5.4.0-91-generic Tue Jan 18 20:44 still running
reboot system boot 5.4.0-91-generic Tue Jan 18 19:17 - 20:39 (01:22)

Running "dhclient" on the EC2 console, as suggested in comment #46, re-assigns the IP address.

Relevant versions installed:

ck@focal:~$ dpkg -l|egrep "(dhcp|network-manager)"
ii isc-dhcp-client 4.4.1-2.1ubuntu5.20.04.2 amd64 DHCP client for automatically obtaining an IP address
ii isc-dhcp-common 4.4.1-2.1ubuntu5.20.04.2 amd64 common manpages relevant to all of the isc-dhcp packages
ii network-manager 1.22.10-1ubuntu2.2 amd64 network management framework (daemon and userspace tools)
ii network-manager-gnome 1.8.24-1ubuntu3 amd64 network management framework (GNOME frontend)
ii network-manager-pptp 1.2.8-2 amd64 network management framework (PPTP plugin core)

Update: In my situation it turned out to be a problem of networking.service, which was able to request the IP address, however the service failed due to a missing sub-script (ubuntu-fan):

$ systemctl status networking.service
● networking.service - Raise network interfaces
     Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2022-01-19 07:40:25 CET; 4min 55s ago
       Docs: man:interfaces(5)
    Process: 639 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
   Main PID: 639 (code=exited, status=1/FAILURE)

Jan 19 07:40:25 focal dhclient[814]: DHCPACK of 10.10.1.41 from 10.10.1.1 (xid=0xac4f3a09)
Jan 19 07:40:25 focal ifup[828]: RTNETLINK answers: File exists
Jan 19 07:40:25 focal dhclient[814]: bound to 10.10.1.41 -- renewal in 1442 seconds.
Jan 19 07:40:25 focal ifup[814]: bound to 10.10.1.41 -- renewal in 1442 seconds.
Jan 19 07:40:25 focal ifup[870]: /etc/network/if-up.d/ubuntu-fan: 29: /usr/sbin/fanctl: not found
Jan 19 07:40:25 focal ifup[840]: run-parts: /etc/network/if-up.d/ubuntu-fan exited with return code 127
Jan 19 07:40:25 focal ifup[639]: ifup: failed to bring up eth0
Jan 19 07:40:25 focal systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Jan 19 07:40:25 focal systemd[1]: networking.service: Failed with result 'exit-code'.
Jan 19 07:40:25 focal systemd[1]: Failed to start Raise network interfaces.

The ubuntu-fan package was in status "rc", removed but not purged. After purging the ubuntu-fan package, the networking.service started correctly and since then the DHCP assigned IP is renewed and not lost anymore.