Ticket #387 (closed defect: fixed)
Traceback when clicking on any ConfigFile entry in the Config Items -> Bad webpage
Reported by: | anonymous | Owned by: | hagedorn |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | bcfg2-reports | Version: | 0.9.x |
Keywords: | dynamic reporting system traceback | Cc: |
Description
When clicking on any ConfigFile? entry from the new Config Items -> Bad section of the dynamic reporting system webpage I get the following traceback :
NameError? at /elements/bad/6/ global name 'get_lexer_by_name' is not defined Request Method: GET Request URL: http://bcfg2-reports.chicagotrading.com/elements/bad/6/ Exception Type: NameError? Exception Value: global name 'get_lexer_by_name' is not defined Exception Location: /usr/lib/python2.4/site-packages/Bcfg2/Server/Reports/reports/templatetags/syntax_coloring.py in syntaxhilight, line 15 Template error
In template /usr/lib/python2.4/site-packages/Bcfg2/Server/Reports/reports/templates/config_items/index.html, error at line 47 Caught an exception while rendering: global name 'get_lexer_by_name' is not defined 37 <tr><td align="right"><b>Permissions: </b></td><td>{{item.reason.perms}}</td><td>{{item.reason.current_perms}}</td></tr> 38 {% endif %}{% if item.reason.current_status %} 39 <tr><td align="right"><b>Status: </b></td><td>{{item.reason.status}}</td><td>{{item.reason.current_status}}</td></tr> 40 {% endif %}{% if item.reason.current_to %} 41 <tr><td align="right"><b>Link Destination: </b></td><td>{{item.reason.to}}</td><td>{{item.reason.current_to}}</td></tr> 42 {% endif %}{% if item.reason.current_version %} 43 <tr><td align="right"><b>Version: </b></td><td>{{item.reason.version}}</td><td>{{item.reason.current_version}}</td></tr> 44 {% endif %}{% if not item.reason.current_exists %} 45 <tr><td align="right"><b>Existance: </b></td><td colspan=2>This item does not currently exist on the host but is specified to exist in the configuration.</td></tr> 46 {% endif %}{% if item.reason.current_diff %} 47 <tr><td align="right"><b>NDiff: </b></td><td colspan=2><pre>{{item.reason.current_diff|syntaxhilight:"diff"}}</pre></td></tr> 48 {% endif %} 49 </table></center> 50 <hr/> 51 <div> 52 <span class="mini-date"> 53 <b>Enter date or use calendar popup: </b> 54 <form name="timestamp-select"> 55 <input type="text" name="date1" value="{{timestamp_date}}" size=10>@ 56 <input type="text" name="time" value="{{timestamp_time}}" size=8> 57 <a href="" onClick="cal.select(document.formstimestamp-select?.date1,'anchor1','yyyy-MM-dd'); return false;" Traceback (innermost last) Switch to copy-and-paste view
- /usr/local/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/template/init.py in render_node
699.
- def render_node(self, node, context):
- return(node.render(context)) 702.
- class DebugNodeList?(NodeList?):
- def render_node(self, node, context):
- try:
- result = node.render(context) ...
- except TemplateSyntaxError?, e:
- if not hasattr(e, 'source'):
- e.source = node.source
- raise
- except Exception, e:
- from sys import exc_info
▶ Local vars Variable Value context [{'block': <Block Node: content. Contents: [<Text Node: ' '>, <IfEqualNode?>, <Text Node: ' <center> <table border=1'>, <If node>, <If node>, <If node>, <If node>, <If node>, <If node>, <If node>, <If node>, <Text Node: ' </table></center> <hr/> '>, <Variable Node: timestamp_date>, <Text Node: '" size=10>@ <input type="'>, <Variable Node: timestamp_time>, <Text Node: '" size=8> <a href="" onCl'>, <Variable Node: mod_or_bad>, <Text Node: '/'>, <Variable Node: item.id>, <Text Node: '/'+document.forms['timest'>, <Variable Node: mod_or_bad>, <Text Node: '/'>, <Variable Node: item.id>, <Text Node: ;"/> </form> </span><br/'>, <If node>, <Text Node: ' '>]>}, {'timestamp': '[email protected]:14:14.347346', 'item': <Bad: /etc/bcfg2.conf>, 'mod_or_bad': 'bad', 'timestamp_date': '2007-02-02', 'timestamp_time': '14:14:14', 'associated_client_list': [<Client: localhost>]}] e <exceptions.NameError? instance at 0xb3a484cc> exc_info <built-in function exc_info> node <Variable Node: item.reason.current_diff|syntaxhilight:"diff"> self [<Text Node: ' <tr><td align="right"><b'>, <Variable Node: item.reason.current_diff|syntaxhilight:"diff">, <Text Node: '</pre></td></tr> '>] wrapped <django.template.TemplateSyntaxError? instance at 0xb3a4898c>
- /usr/local/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/template/init.py in render
- def render(self, context):
- output = self.filter_expression.resolve(context)
- return self.encode_output(output) 748.
- class DebugVariableNode?(VariableNode?):
- def render(self, context):
- try:
- output = self.filter_expression.resolve(context) ...
- except TemplateSyntaxError?, e:
- if not hasattr(e, 'source'):
- e.source = self.source
- raise
- return self.encode_output(output)
758.
▶ Local vars Variable Value context [{'block': <Block Node: content. Contents: [<Text Node: ' '>, <IfEqualNode?>, <Text Node: ' <center> <table border=1'>, <If node>, <If node>, <If node>, <If node>, <If node>, <If node>, <If node>, <If node>, <Text Node: ' </table></center> <hr/> '>, <Variable Node: timestamp_date>, <Text Node: '" size=10>@ <input type="'>, <Variable Node: timestamp_time>, <Text Node: '" size=8> <a href="" onCl'>, <Variable Node: mod_or_bad>, <Text Node: '/'>, <Variable Node: item.id>, <Text Node: '/'+document.forms['timest'>, <Variable Node: mod_or_bad>, <Text Node: '/'>, <Variable Node: item.id>, <Text Node: ;"/> </form> </span><br/'>, <If node>, <Text Node: ' '>]>}, {'timestamp': '[email protected]:14:14.347346', 'item': <Bad: /etc/bcfg2.conf>, 'mod_or_bad': 'bad', 'timestamp_date': '2007-02-02', 'timestamp_time': '14:14:14', 'associated_client_list': [<Client: localhost>]}] self <Variable Node: item.reason.current_diff|syntaxhilight:"diff">
- /usr/local/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/template/init.py in resolve
- for func, args in self.filters:
- arg_vals = []
- for lookup, arg in args:
- if not lookup:
- arg_vals.append(arg)
- else:
- arg_vals.append(resolve_variable(arg, context))
- obj = func(obj, *arg_vals) ...
- return obj 563.
- def args_check(name, func, provided):
- provided = list(provided)
- plen = len(provided)
- args, varargs, varkw, defaults = getargspec(func)
- /usr/lib/python2.4/site-packages/Bcfg2/Server/Reports/reports/templatetags/syntax_coloring.py in syntaxhilight
- except:
- colorize = False
- register = template.Library() 12.
- def syntaxhilight(value, arg="diff"):
- Returns a syntax-hilighted version of Code; requires code and language arguments
- lexer = get_lexer_by_name(arg) ...
- if colorize:
- try:
- return highlight(value, lexer, HtmlFormatter?())
- except:
- return value
- else:
Traceback (most recent call last): File "/usr/local/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/template/init.py" in render_node
- result = node.render(context)
File "/usr/local/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/template/init.py" in render
- output = self.filter_expression.resolve(context)
File "/usr/local/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/template/init.py" in resolve
- obj = func(obj, *arg_vals)
File "/usr/lib/python2.4/site-packages/Bcfg2/Server/Reports/reports/templatetags/syntax_coloring.py" in syntaxhilight
- lexer = get_lexer_by_name(arg)
NameError? at /elements/bad/6/ global name 'get_lexer_by_name' is not defined
Request information GET
No GET data POST
No POST data COOKIES
No cookie data META Variable Value AUTH_TYPE 'Basic' CONTENT_LENGTH 0L CONTENT_TYPE None GATEWAY_INTERFACE 'CGI/1.1' HTTP_ACCEPT 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5' HTTP_ACCEPT_CHARSET 'ISO-8859-1,utf-8;q=0.7,*;q=0.7' HTTP_ACCEPT_ENCODING 'gzip,deflate' HTTP_ACCEPT_LANGUAGE 'en-us,en;q=0.5' HTTP_AUTHORIZATION 'Basic ZmxvcmVzcDpCTXoqNih2eA==' HTTP_CONNECTION 'keep-alive' HTTP_HOST 'bcfg2-reports.chicagotrading.com' HTTP_KEEP_ALIVE '300' HTTP_REFERER 'http://bcfg2-reports.chicagotrading.com/elements/bad/' HTTP_USER_AGENT 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20060601 Firefox/2.0.0.1 (Ubuntu-edgy)' PATH_INFO '/bad/6/' PATH_TRANSLATED None QUERY_STRING None REMOTE_ADDR '10.0.1.195' REMOTE_HOST None REMOTE_IDENT None REMOTE_USER 'floresp' REQUEST_METHOD 'GET' SCRIPT_NAME None SERVER_NAME 'bcfg2-reports.chicagotrading.com' SERVER_PORT 0 SERVER_PROTOCOL 'HTTP/1.1' SERVER_SOFTWARE 'mod_python' Settings Using settings module Bcfg2.Server.Reports.settings Setting Value ABSOLUTE_URL_OVERRIDES {} ADMINS (('Joey Hagedorn', '[email protected]…'),) ADMIN_FOR () ADMIN_MEDIA_PREFIX '/media/' ALLOWED_INCLUDE_ROOTS () APPEND_SLASH True AUTHENTICATION_BACKENDS ('django.contrib.auth.backends.ModelBackend?', 'Bcfg2.Server.Reports.backends.NISBackend') AUTHORIZED_GROUP BANNED_IPS () CACHE_BACKEND 'simple://' CACHE_MIDDLEWARE_KEY_PREFIX COMMENTS_ALLOW_PROFANITIES False COMMENTS_BANNED_USERS_GROUP None COMMENTS_FIRST_FEW 0 COMMENTS_MODERATORS_GROUP None COMMENTS_SKETCHY_USERS_GROUP None DATABASE_ENGINE 'sqlite3' DATABASE_HOST DATABASE_NAME '/disks/bcfg2/etc/brpt.sqlite' DATABASE_PASSWORD '' DATABASE_PORT DATABASE_USER DATETIME_FORMAT 'N j, Y, P' DATE_FORMAT 'N j, Y' DEBUG True DEFAULT_CHARSET 'utf-8' DEFAULT_CONTENT_TYPE 'text/html' DEFAULT_FROM_EMAIL '[email protected]' DISALLOWED_USER_AGENTS () EMAIL_HOST 'localhost' EMAIL_HOST_PASSWORD '' EMAIL_HOST_USER EMAIL_PORT 25 EMAIL_SUBJECT_PREFIX '[Django] ' ENABLE_PSYCO False IGNORABLE_404_ENDS ('mail.pl', 'mailform.pl', 'mail.cgi', 'mailform.cgi', 'favicon.ico', '.php') IGNORABLE_404_STARTS ('/cgi-bin/', '/_vti_bin', '/_vti_inf') INSTALLED_APPS ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'Bcfg2.Server.Reports.reports'] INTERNAL_IPS () JING_PATH '/usr/bin/jing' LANGUAGES (('ar', 'Arabic'), ('bn', 'Bengali'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('el', 'Greek'), ('en', 'English'), ('es', 'Spanish'), ('es_AR', 'Argentinean Spanish'), ('fr', 'French'), ('gl', 'Galician'), ('hu', 'Hungarian'), ('he', 'Hebrew'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('nl', 'Dutch'), ('no', 'Norwegian'), ('pt-br', 'Brazilian'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sr', 'Serbian'), ('sv', 'Swedish'), ('ta', 'Tamil'), ('uk', 'Ukrainian'), ('zh-cn', 'Simplified Chinese'), ('zh-tw', 'Traditional Chinese')) LANGUAGES_BIDI ('he', 'ar') LANGUAGE_CODE 'en-us' MANAGERS (('Joey Hagedorn', '[email protected]…'),) MEDIA_ROOT MEDIA_URL MIDDLEWARE_CLASSES ('django.middleware.common.CommonMiddleware?', 'django.contrib.sessions.middleware.SessionMiddleware?', 'django.contrib.auth.middleware.AuthenticationMiddleware?', 'django.middleware.doc.XViewMiddleware') MONTH_DAY_FORMAT 'F j' PREPEND_WWW False ROOT_URLCONF 'Bcfg2.Server.Reports.urls' SECRET_KEY '' SEND_BROKEN_LINK_EMAILS False SERVER_EMAIL '[email protected]' SESSION_COOKIE_AGE 1209600 SESSION_COOKIE_DOMAIN None SESSION_COOKIE_NAME 'sessionid' SESSION_EXPIRE_AT_BROWSER_CLOSE True SESSION_SAVE_EVERY_REQUEST False SETTINGS_MODULE 'Bcfg2.Server.Reports.settings' SITE_ID 1 TEMPLATE_CONTEXT_PROCESSORS ('django.core.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n') TEMPLATE_DEBUG True TEMPLATE_DIRS () TEMPLATE_LOADERS ('django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source') TEMPLATE_STRING_IF_INVALID TIME_FORMAT 'P' TIME_ZONE 'America/Chicago?' TRANSACTIONS_MANAGED False USE_ETAGS False USE_I18N True YEAR_MONTH_FORMAT 'F Y'
Attachments
Change History
comment:2 Changed 16 years ago by desai
- Status changed from new to closed
- Resolution set to fixed
This attached patch should fix it. Committed in [a195b9bf6ca1713305f95a3db9d2c3352f568eba] (SVN r2794)