2.0.7-2 & 3.0 - failed to create container path

4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1


hoping for some assistance to get this sorted. Having set lxc.lxcpath = /srv/lxc (or any other path for the matter) in /etc/lxc.conf the creation of a container is always throwing this error

lxc-create: lxccontainer.c: do_create_container_dir: 979 No such file or directory - failed to create container path

Of course the path is existent and mounted and accessible, like said it does it for any path. Running lxc-config lxc.lxcpath is printing correctly /srv/lxc

Is it a trailing slash issue maybe? Did you try /srv/lxc/?

Thank you for the feedback!

I perhaps did, but I am not sure in retrospective.

It got a bit frustrating that the Debian-Stretch repo is a bit slow with (some) package updates, not only LXC (2.0.7), and thus decided to move onto an Ubuntu-Bionic server, preferring not having to compile each and every package on my own just to keep up with upstream releases.

Will see how it goes there with LXC 3.0

@stgraber now on Linux server 4.15.0-22-generic #24-Ubuntu SMP x86_64 with LXC 3.0 and the problem still persists, except the error is less verbose, just plain

Error creating container

and that with each lxc.lxcpath = /srv/lxc and lxc.lxcpath = /srv/lxc/.

Having removed that line and using -P /srv/lxc at the cli is creating the container at the specified path however.

@brauner any idea what’s going on here?

What happens if you set lxc.lxcpath in /etc/lxc/lxc.conf? Works fine for me here.

I beg your pardon, that been a clerical error in the original post. lxc.conf is actually and indeed placed in/etc/lxc. True from my original post is the output of lxc-config lxc.lxcpath reading


Another side effect of lxc.lxcpath not working is that any lxc.* command requires -P /srv/lxc or else the container is not recognized

Is there anything I can do to debug this issue?

I have not tried yet rebooting the hosting server and see whether this might also have an impact to autostart the containers upon boot of the hosting server, though logically it is likely

Still trying to reproduce.

I can only reproduce this if a subpath does not exist, i.e. if /srv exists but not /srv/lxc.

That would be logical.

What is the difference in parsing lxc.lxcpath = to -P in the cli, considering latter working?

Could it be caused by anything in the server’s fstab or sysctl.conf? But if so then -P would throw an error too, or no?

That is how the /srv partition is mounted

/dev/mapper/s-srv /srv ext4 noatime,nodiratime,relatime,nodev 0 2

https://github.com/lxc/lxc/pull/2352/commits/78633423cd0f30dc26bb00010137ca4f21b9a137 should fix it

1 Like

3.0.1 just arrived from the distro’s repo and the patch cured the issue. :+1:

1 Like