Starting container writes invalid legacy 'logfile' configuration key

When starting a container I receive “configuration file contains legacy configuration keys”.
I have tracked this down to the ‘lxc.logfile’ key. When the container starts it overwrites the lxc.log.file key as lxc.logfile. This is of course a legacy key and thus the warning message.

I have tried using lxc-update-config and manually editing the lxc.conf file to correct the key name. Each time starting the container resets the key to lxc.logfile. I have tried removing the key from lxc.conf. Starting the container creates a new key with the legacy lxc.logfile name.

Host is Ubuntu 16.04 fully patched.

lxc --version
2.21
lxd --version
2.21

/usr/share/lxc/config/common.conf.d contains one file, 00-lxcfs.conf, which contains two lines:

lxc.hook.mount = /usr/share/lxcfs/lxc.mount.hook
lxc.hook.post-stop = /usr/share/lxcfs/lxc.reboot.hook

Sequence to re-create the issue. After setting correct keys in lxc.conf

cat /var/log/lxd/x1/lxc.conf
lxc.log.file = /var/log/lxd/x1/lxc.log
lxc.log.level = warn
...

Then start the container

lxc start x1

cat /var/log/lxd/x1/lxc.conf
lxc.logfile = /var/log/lxd/x1/lxc.log
lxc.log.level = warn

Thanks very much.

So the problem here is that you have an odd combination of packages, one that’s possible when using PPAs but isn’t otherwise supported.

You seem to have LXD 2.21 coming from backports with LXC 2.1.1 coming from one of our PPAs. This Build of LXC 2.1.1 doesn’t come with a matching build of go-lxc and lxd which is what you’re missing for all the config keys to be correct.

So you have a few options:

  • Live with the warning message
  • Downgrade liblxc back to the expected 2.0.8
  • Manually rebuild LXD using a recent go-lxc and the 2.1.1 version of the lxc-dev headers
  • Use the LXD stable snap (which is 2.21 with liblxc 2.1.1)