I recently installed LXD on a Fedora 26 Server vm, and any time I run an lxc exec command, I receive the warning The configuration file contains legacy configuration keys. Please update your configuration file!
I have reviewed the discussion on LXD Issues #3845, #3848, and #3916, but was unable to find a solution. As far as I understand, this warning is generally received when liblxc is upgraded to 2.1 and a container built with the old libraries tries to use the new ones, and can be fixed by restarting the container. However, as far as I know my containers were built using the newest libraries, but the warning still appears.
Additional information:
I have LXD version 2.18 and have never had a previous version
I installed LXD from the ganto/lxd COPR repo following the instructions here
I tried restarting LXD by running sudo systemctl restart lxd, but this did not resolve the issue
I tried restarting my container by running lxc restart CONTAINER, but this did not resolve the issue
I tried restarting my container by running lxc stop CONTAINER and lxc start CONTAINER separately, but this did not resolve the issue
I have launched multiple containers using multiple images, all of which displayed this issue.
Images used:
Note: I did not create an Issue on the LXD repo because I think this is likely user error and not a bug in LXD, but if this would be more appropriately discussed on GitHub, please let me know.
/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
If that’s all the case, then the only thing I can think of which would explain this behavior is if the go-lxc which was used to build your LXD binary was outdated, causing the version check for 2.1 to fail and having LXD generate a 2.0.x config even though you do have 2.1 installed.
Yes, I’ve restarted the daemon with sudo systemctl restart lxd and restarted the container with lxc restart CONTAINER. Running lxc --version reports 2.18 and dnf lists the package version as 2.18-3.fc26.
So, you believe the binary in the COPR repository may have been built with outdated tools (Go bindings, I assume)? I’ll try uninstalling the LXD I got from that repo and installing from the release tarball and see if that resolves the issue.
That’d be my guess. Unfortunately go-lxc can’t always do dynamic version detection for the LXC library. Some of the version checks, such as the one used to generate the config keys depends on what version of liblxc was installed on the machine that built go-lxc and LXD.
If that’s the issue, then it should be as simple as having the fedora RPM be rebuilt using liblxc1 at version 2.1.0, go-lxc would then build against the 2.1.0 header file and that issue should disappear.
We’re currently adding new code to liblxc1 to allow for dynamic detection in the near future, so that those painful rebuilds become a thing of the past.