Multipass fails: Failed to determine IP address

Launching multipass during the snapcraft build suddenly fails on my Ubuntu 18.04 system with the error:

SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY=8G snapcraft --bind-ssh --debug
Launching a VM.
'SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY' was set to '8G' in the environment. Changing the default allocation upon user request
launch failed: The following errors occurred:                                   
failed to determine IP address
An error occurred with the instance when trying to launch with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.

I checked the version, which is 1.4.0 as it was before. There was also no snapcraft update. I’m usually doing a snapcraft clean before and also tried to restart my system without any success. On my Ubuntu 20.04 notebook, the build still works fine.

Multipass log tells me:

snap logs -f multipass
2020-10-20T14:41:50Z dnsmasq-dhcp[2631]: DHCPDISCOVER(mpqemubr0) 52:xx:xx:xx:xx:xx no address available
2020-10-20T14:41:53Z dnsmasq-dhcp[2631]: DHCPDISCOVER(mpqemubr0) 52:xx:xx:xx:xx:xx no address available
2020-10-20T14:42:00Z dnsmasq-dhcp[2631]: DHCPDISCOVER(mpqemubr0) 52:xx:xx:xx:xx:xx no address available
2020-10-20T14:42:17Z dnsmasq-dhcp[2631]: DHCPDISCOVER(mpqemubr0) 52:xx:xx:xx:xx:xx no address available
2020-10-20T14:42:49Z dnsmasq-dhcp[2631]: DHCPDISCOVER(mpqemubr0) 52:xx:xx:xx:xx:xx no address available
2020-10-20T14:43:53Z dnsmasq-dhcp[2631]: DHCPDISCOVER(mpqemubr0) 52:xx:xx:xx:xx:xx no address available
2020-10-20T14:44:56Z dnsmasq-dhcp[2631]: DHCPDISCOVER(mpqemubr0) 52:xx:xx:xx:xx:xx no address available
2020-10-20T14:45:43Z multipassd[2034]: Cannot open ssh session on "snapcraft-nav" shutdown: failed to determine IP address
2020-10-20T14:45:43Z multipassd[2034]: Shutdown request delayed for 10 minutes
2020-10-20T14:45:59Z dnsmasq-dhcp[2631]: DHCPDISCOVER(mpqemubr0) 52:xx:xx:xx:xx:xx no address available

I don’t have the impression that I changed anything in the meantime, which is a little bit confusing.

I’m clueless. Still not able to do any snap builds or even launch multipass because of this error. I can’t find any solutions for this error in either multipass, nor snapcraft.

I even tried to reset snapd with this script: https://github.com/zyga/devtools/blob/master/reset-state. And then tried a fresh install of snapcraft and multipass, but the error remains.

I was also having this problem recently. I deleted all of my multipass containers, uninstalled multipass and snapcraft, restarted, reinstalled multipass and snapcraft, and then it started working normally again. There may be a better solution though.

Also I don’t know if this is a coincidence but I’m also setting the SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY variable which may have had something to do with the error.

I already tried to delete my multipass containers as well. But this alone didn’t work. The snapd reset I posted above also deletes snapcraft and every installed snap. However, it seems like the snapshots are still there. I now tried with snap remove --purge multipass and reinstalled it and it works again.

For what it’s worth, this seemed to work for my snapcraft build pipeline.