[lxc-users] Better error logging when starting containers?

Bostjan Skufca bostjan at a2o.si
Mon Feb 22 12:40:49 UTC 2016


Dear Akshay,

I do agree with you and find this behaviour a bit annoying, yet I believe
"patches welcome" response will follow shortly :)

On a more serious note:
As I skimmed over LXC code a while ago, it seems LXC bails out on first
error that occurs. This means that implementing your suggestion would
simply mean keeping last error stored somewhere and displaying it before
exiting lxc-start itself.

This would be solution for lxc-start, which you (and I) are probably the
most interested in. Some more generic solution for all lxc-* tools should
probably be more adequate, but that would need attention from one of the
maintainers/core devs.

b.


On 22 February 2016 at 00:50, Akshay Karle <akshay.a.karle at gmail.com> wrote:

> Hello lxc users,
>
> After having used lxc for a while now, I've realized that when the
> container fails to start, it fails with a very generic message as follows:
>
> $ lxc-start -n test
> lxc-start: lxc_start.c: main: 344 The container failed to start.
> lxc-start: lxc_start.c: main: 346 To get more details, run the container
> in foreground mode.
> lxc-start: lxc_start.c: main: 348 Additional information can be obtained
> by setting the --logfile and --logpriority options.
>
> And if you are using ephemeral containers, the error is even more generic
> and with no way to increase the log level:
>
> $ lxc-start-ephemeral -n e1 -o test -d
> setting rootfs to .%s. /home/vagrant/.local/share/lxc/e1/rootfs
> The container 'e1' failed to start.
>
> I was wondering if someone felt the need of having a little more
> meaningful error messages giving a summary of the error in the console
> output. The container logfile does have way more descriptive error
> messages, but since you don't directly have the errors in the console
> output, you are forced to open the logfiles everytime something goes wrong.
> Instead if you had an output that just included a few important error lines
> from the logfile such as the following example:
>
> $ lxc-start -n test
> lxc-start: lxc_start.c: main: 344 The container failed to start.
> lxc_start - start.c:lxc_spawn:1031 - failed creating cgroups
> lxc-start: lxc_start.c: main: 346 To get more details, run the container
> in foreground mode.
> lxc-start: lxc_start.c: main: 348 Additional information can be obtained
> by setting the --logfile and --logpriority options.
>
> Do you think this would help? Although I have no idea if this is simple to
> implement, I just wanted to get your ideas, suggestions and concerns (if
> any) before attempting to figure out a solution.
>
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20160222/f138b303/attachment.html>


More information about the lxc-users mailing list