Failed to generate a unique device name

Hello,
For no obvious reason, I cannot delete and/or deploy new LXCs on a Juju model. I have used remove-machine with the --force option and the machine is for more than 24 hours in stopped state (no units attached to it) and the same also applies for a couple of new containers that stay in pending state. The only relevant log is the following:

dbf0a1ec-dbab-4e20-8e95-d480b4f9e12e: machine-10 2019-02-13 14:54:20 WARNING juju.provisioner container_initialisation.go:145 not stopping machine agent container watcher due to error: setting up container dependencies on host machine: failed to generate a unique device name for profile "default"
dbf0a1ec-dbab-4e20-8e95-d480b4f9e12e: machine-10 2019-02-13 14:54:20 ERROR juju.provisioner container_initialisation.go:124 starting container provisioner for lxd: setting up container dependencies on host machine: failed to generate a unique device name for profile "default"

Any hints ?

Hey @soumplis, in looking at the code there that shouldn’t happen unless there’s > 100 network devices on the container so it cannot setup a device eth0-eth100. It’s definitely a case where the code says “this should never happen” but it did…

It might be best to pull together a bug with the logs involved and some more details of the install.

1 Like

This sounds like:
https://bugs.launchpad.net/bugs/1815842
or
https://github.com/lxc/lxd/issues/5492#event-2138372575

Specifically, it seems that when Juju tries to set up containers, if the LXD cloud doesn’t appear to be fully fleshed out, it tries to run ‘lxd init --auto’, however, if ‘lxd’ isn’t in $PATH, then that fails, and the loop starts over. But it has already modified the default profile by that time. So it bounces and repeatedly adds another eth device to the default profile.

I haven’t dug into the details, but yes, we shouldn’t ever hit >100 networking devices in a single container and we only have done so because of a different bug.

Yeap, that seems to be the problem for me also. Although lxd is in the PATH (/usr/bin) it has 100 eth devices in the default profile and also 600 veth devices on the host machines. For the record this machine has only 6 containers.