[cobbler] Finding snippet errors (was: Internal Server Error)

James Cammarata jimi at sngx.net
Fri Mar 22 13:22:37 UTC 2013


On Fri, Mar 22, 2013 at 6:26 AM, Robert Jacobson <Robert.C.Jacobson at nasa.gov
> wrote:

> On 3/22/2013 4:46 AM, James Cammarata wrote:
>
>>
>> Nothing gets logged in /var/logs/httpd/* nor
>> /var/log/cobbler/cobbler.log? You should see apache at least log the 500.
>>
>
> I hope you're using a configuration management tool on your
> snippets/kickstarts/etc.; IMO that's the best way to figure out what
> changed and broke things.  If you're not doing it already -- start now!
>
> Related:  Would it be a big deal to add line breaks to the "*.json" files
> (profiles, systems, etc.)?  This would make it much easier for me to see
> changes to these.  Right now everything is all on one line and "diff"
> doesn't handle that very well.
>

This may have been answered later in the thread, but an option called
"pretty_print_json" was added in the last few months as well, and will be
in 2.4.0.


>
> <rantmode enabled=1>
> The lack of sensible error messages has kinda been a peeve of mine with
> cobbler-web when I make errors in snippets.  e.g. to break a snippet I
> added:
>     #if $break_me == 1
> to the top.  So now viewing the kickstart results in 'internal server
> error'.
>
> While httpd/error_log and cobbler.log certainly log an error message,
> there's nothing really helpful in there to point to the error (am I missing
> something)?  I admit complete ignorance here -- Is this a Cheetah
> limitation?  Is there no way we can get an error like "variable 'break_me'
> undefined (line x in file 'snippet1')", or "no #end if for #if at line x"
> somewhere?
>
> Obviously if I'm actively working on a snippet I know what's broken.  But
> if another admin changes something -- I have to use other tools like svn to
> figure out what changed.
>
> Another thing I've found helpful is adding a
>     #stop
> At various points in the snippet to find the line or area that is broken.
>
> Is there a better way? (I wish "don't makeany  mistakes in snippets" was
> an option :) )
> </rantmode>


It was with me too, for sure. I did address that recently, and the patch
will also be included in 2.4.0. Basically it logs all cheetah parsing
errors to cobbler.log so if it hits an unrendered variable or other
non-critical errors it will now report that. Unfortunately cheetah doesn't
make debugging some issues easy, which is one of the reasons I wouldn't
mind moving away from it in the future.

That being said, the webui most definitely should not just fail like that,
so if you can send me the snippet that caused that (or if it's just any
cheetah parsing error) I'll work on a patch to correct that too.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fedorahosted.org/pipermail/cobbler/attachments/20130322/cf1f8f90/attachment.html>


More information about the cobbler mailing list