<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="">I can give you the issue I filed with lxc/lxc as an example : <a href="https://github.com/lxc/lxc/issues/819" class="">https://github.com/lxc/lxc/issues/819</a><br class=""></span><span class=""><br class=""></span><span class="">If you try to create a container using the following command:<br class=""></span><span class=""><br class=""></span><span class=""><span class="Apple-tab-span" style="white-space:pre">       </span>lxc-create -t download -n lxc10009 -f lxc10009.conf -- -d ubuntu -r xenial -a amd64<br class=""></span><span class=""><br class=""></span><span class="">And the config file contain a “lxc.roofs” line, it will failed with following error:<br class=""></span><span class=""><br class=""></span><span class=""><span class="Apple-tab-span" style="white-space:pre">     </span>lxc-create: lxc_create.c: main: 303 Error creating container lxc10009<br class=""></span><span class=""><br class=""></span><span class="">I can’t determine the cause of the error even I went into the code (lxc_create.c, line 303).<br class=""></span><span class=""><br class=""></span><span class="">I end up commenting the config file section by section, line by line to find the offending line.<br class=""></span><span class=""><br class="">Another example is if you add network interfaces to an unprivileged container and forget to add that nic in /etc/lxc/lxc-usernet, the fail to start error messages contain very little hint about it. Even with “-l 9”, you will only get the following:</span><div class=""><span class=""><br class=""></span></div><div class=""><span class=""><div class="">      lxc-start 20160222151046.765 ERROR    lxc_start - start.c:lxc_spawn:1108 - failed to create the configured network</div><div class="">      lxc-start 20160222151046.765 ERROR    lxc_start - start.c:__lxc_start:1274 - failed to spawn 'lxc10001'</div><div class="">      lxc-start 20160222151052.301 ERROR    lxc_start_ui - lxc_start.c:main:344 - The container failed to start.</div><div class="">      lxc-start 20160222151052.301 ERROR    lxc_start_ui - lxc_start.c:main:346 - To get more details, run the container in foreground mode.</div><div class="">      lxc-start 20160222151052.301 ERROR    lxc_start_ui - lxc_start.c:main:348 - Additional information can be obtained by setting the --logfile and --logpriority options.</div><div class=""><span class=""><br class=""></span></div><div class=""><span class="">So is it a network interface error on the host? Or lxc10001 config file error in the network line? Is it ip conflict? Bla bla bla … You get the idea. I personally wasted a lot of time on this particular one :(</span></div><div class=""><br class=""></div>Currently I take that as “growing pain” as all packages, technologies(</span>lxc, cgroup, systemd)<span class=""> surrounding Linux container are all evolving rapidly. However I hope this issue can be improved faster. Currently it is difficult for end user (non-developer), or even developers but not actively involve in those packages, to determine the cause (config error? actual bug?) with those error messages.</span><div class=""><span class=""><br class=""></span></div><div class="">John</div><div class=""><span class=""><br class=""></span><div><blockquote type="cite" class=""><div class="">On Feb 22, 2016, at 14:11, Akshay Karle <<a href="mailto:akshay.a.karle@gmail.com" class="">akshay.a.karle@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><span style="line-height:1.5" class="">I agree with your comments and the fact that the team is busy working lxc v2, but I wanted to get a sense of whether it was a problem everyone is facing and that the lxc team are aware of. </span><span style="line-height:1.5" class="">I didn't look into the codebase for logging yet and I'm not a C programmer (anymore), but </span><span style="line-height:1.5" class="">I would like to give a shot at improving the logs and hence asked for your suggestions. I will begin by looking at how we can improve error logging for lxc-start at least and then look at the general lxc-* commands. Thanks for the comments Bostjan, I'll keep that in mind when I look through the code.</span></div><div class=""><span style="line-height:1.5" class=""><br class=""></span></div><div class="">Thanks for the tip on bumping the log level for ephemeral containers John!<span style="line-height:1.5" class=""><br class=""></span></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Mon, Feb 22, 2016 at 4:41 AM Bostjan Skufca <<a href="mailto:bostjan@a2o.si" class="">bostjan@a2o.si</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Dear Akshay,<div class=""><br class=""></div><div class="">I do agree with you and find this behaviour a bit annoying, yet I believe "patches welcome" response will follow shortly :)</div><div class=""><br class=""></div><div class="">On a more serious note:</div><div class="">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.</div><div class=""><br class=""></div><div class="">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.</div></div><div dir="ltr" class=""><div class=""><br class=""></div><div class="">b.</div><div class=""><br class=""></div></div><div class="gmail_extra"><div class="gmail_quote">On 22 February 2016 at 00:50, Akshay Karle <span dir="ltr" class=""><<a href="mailto:akshay.a.karle@gmail.com" target="_blank" class="">akshay.a.karle@gmail.com</a>></span> wrote:<br class=""></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Hello lxc users,<div class=""><br class=""></div><div class="">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:</div><div class=""><br class=""></div><div class="">$ lxc-start -n test<br class=""></div><div class=""><div class="">lxc-start: lxc_start.c: main: 344 The container failed to start.</div><div class="">lxc-start: lxc_start.c: main: 346 To get more details, run the container in foreground mode.</div><div class="">lxc-start: lxc_start.c: main: 348 Additional information can be obtained by setting the --logfile and --logpriority options.</div></div><div class=""><br class=""></div><div class="">And if you are using ephemeral containers, the error is even more generic and with no way to increase the log level:</div><div class=""><br class=""></div><div class="">$ lxc-start-ephemeral -n e1 -o test -d</div><div class="">setting rootfs to .%s. /home/vagrant/.local/share/lxc/e1/rootfs</div><div class="">The container 'e1' failed to start.</div><div class=""><br class=""></div><div class="">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:</div><div class=""><br class=""></div><div class=""><div class="">$ lxc-start -n test</div><div class="">lxc-start: lxc_start.c: main: 344 The container failed to start.</div><div class="">lxc_start - start.c:lxc_spawn:1031 - failed creating cgroups<br class=""></div><div class="">lxc-start: lxc_start.c: main: 346 To get more details, run the container in foreground mode.</div><div class="">lxc-start: lxc_start.c: main: 348 Additional information can be obtained by setting the --logfile and --logpriority options.</div></div><div class=""><br class=""></div><div class="">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.</div></div>
<br class=""></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_______________________________________________<br class="">
lxc-users mailing list<br class="">
<a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank" class="">lxc-users@lists.linuxcontainers.org</a><br class="">
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank" class="">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br class=""></blockquote></div></div>
_______________________________________________<br class="">
lxc-users mailing list<br class="">
<a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank" class="">lxc-users@lists.linuxcontainers.org</a><br class="">
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank" class="">http://lists.linuxcontainers.org/listinfo/lxc-users</a></blockquote></div>
_______________________________________________<br class="">lxc-users mailing list<br class=""><a href="mailto:lxc-users@lists.linuxcontainers.org" class="">lxc-users@lists.linuxcontainers.org</a><br class="">http://lists.linuxcontainers.org/listinfo/lxc-users</div></blockquote></div><br class=""></div></div></body></html>