Red Hat Bugzilla – Bug 492206
Cheetah template directives in kickstart files, such as #if, cause kickstart file generation to bomb ungracefully
Last modified: 2009-09-10 15:24:50 EDT
Created attachment 336706 [details]
Error produced by cheetah
Description of problem:
Upon talking with mdehaan, he suggested that if you upload a kickstart file that inadvertently contains Cheetah directives, such as #if, the generation of the kickstart file will fail, as the process looks something like this:
User uploads kickstart file ->
Satellite stores uploaded kickstart file as a Cheetah template ->
User requests kickstart file ->
Satellite sends kickstart template through Cheetah, which renders it ->
Rendered file sent to user
At the moment, if a user has some of these errors in their file, the WebUI doesn't make it evident that they do, so, upon retrieval, the munged file goes through Cheetah, which produces a bit of a cryptic Python traceback.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Upload a kickstart file
2. Insert a Cheetah directive into this file, like '#if'
3. Attempt to download this kickstart file from its cobbler URL or view it from the WebUI
Cheetah parse error similar to attached traceback
At least one of these:
WebUI notifies user of issues in kickstart file prior to retrieval, contains tooltips pointing users to these potential pitfalls, or a more intelligible error page is produced
Should be fixed in the next iso...
Forgot to add the behavior sorry ...
So when you create/edit a Kickstart Profile (raw/otherwise), and you enter an unparseable text you should get a Red Colored error saying your profile is busted and a link pointing you to the stack trace and the actual cheetah error.. Note the kickstart is already done, there is no roll back happening here, its just more of a notification saying your template is busted, fix it if you want it to work. This notification is done every time you go to the details page of the kickstart. So in theory the admin will get notified appropriately...
moving to On_QA
Moving to ON_QA
If a user adds a kickstart file with busted directives or edits busted directives into the file, no red text appears and behavior as reported persists. Moving to FAILS_QA, tested on 5/29 ISO.
This error occured because of an interesting modification to the cobbler error reporting between cobbler versiond 1.6.3-2 and 1.6.3-3 . In 18.104.22.168 compile errors raised a 500, while in 22.214.171.124 it raises a 200 Ok. The code has now been fixed to make sure error gets raised for either of these cases... it just parses for the string "Traceback (most recent call last):" to report the error if a 200 OK is returned by cobbler..
So we now get the red text appropriately, which is good, but the resulting traceback looks something like this:
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
result = object(req)
File "/var/www/cobbler/svc/services.py", line 89, in handler
content = func( **form )
File "/usr/lib/python2.3/site-packages/cobbler/services.py", line 87, in ks
data = self.remote.generate_kickstart(profile,system,REMOTE_ADDR,REMOTE_MAC)
File "/usr/lib/python2.3/xmlrpclib.py", line 1029, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.3/xmlrpclib.py", line 1316, in __request
File "/usr/lib/python2.3/xmlrpclib.py", line 1080, in request
return self._parse_response(h.getfile(), sock)
File "/usr/lib/python2.3/xmlrpclib.py", line 1219, in _parse_response
File "/usr/lib/python2.3/xmlrpclib.py", line 742, in close
No Cheetah error seems to be present in the traceback, so a user might find themselves at a loss as to what's going on. Moving to FAILS_QA, tested on 5/6 ISO.
Fwoops, make that the 6/5 ISO. Coffee time!
Should be fixed as of
Basically redirected the error from a cobbler page to spacewalk's KickstartFileDownload Page..
On 6/19 build, error still redirects to:
Moving to FAILS_QA.
should be fixed in the next iso..
VERIFIED on 6/25 ISO.
error redirects now to download page but rendering python errors in the kickstart download area. throwing this to failsqa to be reviewed.
did not realize the python stack trace embedded in the web text area was meant to help user debug.
moving to release pending
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.