What's the URL of the page containing the problem?
n/a, I blanked out confidential information with ****
What steps will reproduce the problem?
1. svn up
2. stop reviewboard
3. manage.py syncdb
4. manage.py evolve -executee
5. manage.py syncdb
7. start reviewbaord
What is the expected output? What do you see instead?
I wanted to view a review request
VariableDoesNotExist at /r/76/
Failed lookup for key [filediff] in u"*****"
Request Method: GET
Request URL: http://***:8070/r/76/
Exception Type: VariableDoesNotExist
Exception Value: Failed lookup for key [filediff] in u"****"
Exception Location: ***/sj/lib/python/django/template/__init__.py in
_resolve_lookup, line 712
Python Executable: /usr/bin/python
Python Version: 2.4.3
Python Path: ['***reviewboard-read-only',
'***/reviewboard-read-only/reviewboard',
'/***/lib64/python/setuptools-0.6c7-py2.3.egg',
'***/lib64/python/simplejson-1.8.1-py2.3-linux-x86_64.egg',
'***/lib/python/setuptools-0.6c7-py2.4.egg',
'***/lib/python/Pygments-0.9-py2.4.egg',
'***/lib/python/simplejson-1.8.1-py2.4-solaris-2.8-sun4u.egg',
'***/lib/python/flup-1.0-py2.4.egg',
'***/lib/python/python_memcached-1.41-py2.4.egg', '***lib64/python',
'***/lib/python', '***lib64/python/PIL',
'***/lib/python/PIL', '/usr/lib64/python24.zip', '/usr/lib64/python2.4',
'/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk',
'/usr/lib64/python2.4/lib-dynload', '/usr/lib64/python2.4/site-packages',
'/usr/lib64/python2.4/site-packages/Numeric',
'/usr/lib64/python2.4/site-packages/PIL',
'/usr/lib64/python2.4/site-packages/gtk-2.0',
'/usr/lib/python2.4/site-packages']
Server time: Wed, 28 May 2008 07:50:58 -0700
Template error
In template
***/reviewboard-read-only/reviewboard/templates/reviews/review_detail.html,
error at line 138
Caught an exception while rendering: Failed lookup for key [filediff] in u"***"
128 <a href="{{comment.screenshot.get_absolute_url}}">{% if
comment.screenshot.caption %}{{comment.screenshot.caption}}{% else
%}{{comment.screenshot.image|basename}}{% endif %}</a>
129 </span>
130 {{comment.image|safe}}
131 </div>
132 </dt>
133 <dd>
134 <pre>{{comment.text|escape}}</pre>
135 {% reply_section review comment "screenshot_comment" "rc" %}
136 </dd>
137 {% endfor %}
138 {% for comment in review.ordered_comments %}
139 <dt>
140 <a name="comment{{comment.id}}"></a>
141 <table class="sidebyside{% ifequal comment.filediff.source_revision
PRE_CREATION %} newfile{% endifequal %}">
142 <colgroup>
143 <col class="line" />
144 <col class="left" />
145 <col class="line" />
146 <col class="right" />
147 </colgroup>
148 <thead>
Traceback Switch to copy-and-paste view
* ***/sj/lib/python/django/template/debug.py in render_node
64. def compile_function_error(self, token, e):
65. if not hasattr(e, 'source'):
66. e.source = token.source
67. class DebugNodeList(NodeList):
68. def render_node(self, node, context):
69. try:
71. result = node.render(context) ...
72. except TemplateSyntaxError, e:
73. if not hasattr(e, 'source'):
74. e.source = node.source
75. raise
76. except Exception, e:
77. from sys import exc_info
? Local vars
Variable Value
context
[{'forloop': {'revcounter0': 0, 'last': True, 'counter': 1,
'parentloop': {'revcounter0': 0, 'last': True, 'counter': 3, 'parentloop':
{}, 'revcounter': 1, 'counter0': 2, 'first': False}, 'revcounter': 1,
'counter0': 0, 'first': True}, u'comment': <Comment: \*\*\*>}]]
e
<django.template.VariableDoesNotExist instance at 0x1c452128>
exc_info
<built-in function exc_info>
node
<For Node: for comment in review.ordered_comments, tail_len: 17>
self
[<Text Node: '\n <dl class="diff-comme'>, <For Node: for comment in
review.screenshot_comments.all, tail_len: 13>, <Text Node: '\n'>, <For
Node: for comment in review.ordered_comments, tail_len: 17>, <Text Node:
'\n </dl>\n'>]
wrapped
<django.template.TemplateSyntaxError instance at 0x1c459ef0>
* ***/sj/lib/python/django/template/defaulttags.py in render
142. if unpack:
143. # If there are multiple loop variables, unpack the item into
144. # them.
145. context.update(dict(zip(self.loopvars, item)))
146. else:
147. context[self.loopvars[0]] = item
148. for node in self.nodelist_loop:
149. nodelist.append(node.render(context)) ...
150. if unpack:
151. # The loop variables were pushed on to the context so pop them
152. # off again. This is necessary because the tag lets the length
153. # of loopvars differ to the length of each set of items and we
154. # don't want to leave any vars from the previous loop on the
155. # context.
? Local vars
Variable Value
context
[{'forloop': {'revcounter0': 0, 'last': True, 'counter': 1,
'parentloop': {'revcounter0': 0, 'last': True, 'counter': 3, 'parentloop':
{}, 'revcounter': 1, 'counter0': 2, 'first': False}, 'revcounter': 1,
'counter0': 0, 'first': True}, u'comment': <Comment: \*\*\*>}]]
i
0
item
<Comment: \*\*\*>
len_values
1
loop_dict
{'counter': 1, 'counter0': 0, 'first': True, 'last': True,
'parentloop': {'counter': 3, 'counter0': 2, 'first': False, 'last': True,
'parentloop': {}, 'revcounter': 1, 'revcounter0': 0}, 'revcounter': 1,
'revcounter0': 0}
node
<djblets.util.decorators.BlockTagNode object at 0x1c3aaf90>
nodelist
[u'\n <dt>\n <a name="comment', u'518', u'"></a>\n <table
class="sidebyside', '', u'">\n <colgroup>\n <col class="line" />\n <col
class="left" />\n <col class="line" />\n <col class="right" />\n
</colgroup>\n <thead>\n <tr>\n <th colspan="4" class="filename">\n <a
href="', u'', u'">', u'', u'</a>\n\t\t <span class="diffrevision">\n',
u'\n\t\t (Diff revision )\n', u'\n\t\t </span>\n </th>\n </tr>\n </thead>\n']
parentloop
{'counter': 3, 'counter0': 2, 'first': False, 'last': True,
'parentloop': {}, 'revcounter': 1, 'revcounter0': 0}
self
<For Node: for comment in review.ordered_comments, tail_len: 17>
unpack
False
values
[<Comment: \*\*\*>]
* ***/reviewboard-read-only/reviewboard/djblets/util/decorators.py in
render
143. def __init__(self, tag_name, tag_func, nodelist, args):
144. self.tag_name = tag_name
145. self.tag_func = tag_func
146. self.nodelist = nodelist
147. self.args = args
148. def render(self, context):
150. args = [Variable(var).resolve(context) for var in self.args] ...
151. return self.tag_func(context, self.nodelist, *args)
152. def _setup_tag(parser, token):
153. bits = token.split_contents()
154. tag_name = bits[0]
155. del(bits[0])
? Local vars
Variable Value
_[1]
[]
context
[{'forloop': {'revcounter0': 0, 'last': True, 'counter': 1,
'parentloop': {'revcounter0': 0, 'last': True, 'counter': 3, 'parentloop':
{}, 'revcounter': 1, 'counter0': 2, 'first': False}, 'revcounter': 1,
'counter0': 0, 'first': True}, u'comment': <Comment: \*\*\*>}]]
self
<djblets.util.decorators.BlockTagNode object at 0x1c3aaf90>
var
u'comment.filediff'
* ***/sj/lib/python/django/template/__init__.py in resolve
652. # dealing with a bonafide variable
653. self.lookups = tuple(var.split(VARIABLE_ATTRIBUTE_SEPARATOR))
654. def resolve(self, context):
655. """Resolve this variable against a given context."""
656. if self.lookups is not None:
657. # We're dealing with a variable that needs to be resolved
659. value = self._resolve_lookup(context) ...
660. else:
661. # We're dealing with a literal, so it's already been "resolved"
662. value = self.literal
663. if self.translate:
664. return _(value)
665. return value
? Local vars
Variable Value
context
[{'forloop': {'revcounter0': 0, 'last': True, 'counter': 1,
'parentloop': {'revcounter0': 0, 'last': True, 'counter': 3, 'parentloop':
{}, 'revcounter': 1, 'counter0': 2, 'first': False}, 'revcounter': 1,
'counter0': 0, 'first': True}, u'comment': <Comment: \*\*\*>}]]
self
<Variable: u'comment.filediff'>
* ***/sj/lib/python/django/template/__init__.py in _resolve_lookup
705. try: # list-index lookup
706. current = current[int(bit)]
707. except (IndexError, # list index out of range
708. ValueError, # invalid literal for int()
709. KeyError, # current is a dict without `int(bit)` key
710. TypeError, # unsubscriptable object
711. ):
712. raise VariableDoesNotExist("Failed lookup for key [%s] in %r",
(bit, current)) # missing attribute ...
713. except Exception, e:
714. if getattr(e, 'silent_variable_failure', False):
715. current = settings.TEMPLATE_STRING_IF_INVALID
716. else:
717. raise
? Local vars
Variable Value
bit
u'filediff'
context
[{'forloop': {'revcounter0': 0, 'last': True, 'counter': 1,
'parentloop': {'revcounter0': 0, 'last': True, 'counter': 3, 'parentloop':
{}, 'revcounter': 1, 'counter0': 2, 'first': False}, 'revcounter': 1,
'counter0': 0, 'first': True}, u'comment': <Comment: \*\*\*>}]]
current
<Comment: \*\*\*>
self
<Variable: u'comment.filediff'>
Environment: Request Method: GET Request URL: http://***:8070/r/76/ Django
Version: 0.97-pre-SVN-unknown Python Version: 2.4.3 Installed Applications:
['django.contrib.admin', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.markup',
'django.contrib.sites', 'django.contrib.sessions', 'djblets.datagrid',
'djblets.util', 'djblets.webapi', 'reviewboard.accounts',
'reviewboard.admin', 'reviewboard.diffviewer', 'reviewboard.iphone',
'reviewboard.reports', 'reviewboard.reviews', 'reviewboard.scmtools',
'reviewboard.webapi', 'django_evolution'] Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware') Template error:
In template
***/reviewboard-read-only/reviewboard/templates/reviews/review_detail.html,
error at line 138 Caught an exception while rendering: Failed lookup for
key [filediff] in u"This looks ok but it's an unrelated change. I also
though I saw comments on this somewhere else so maybe it's included on
multiple changelists?" 128 : <a
href="{{comment.screenshot.get_absolute_url}}">{% if
comment.screenshot.caption %}{{comment.screenshot.caption}}{% else
%}{{comment.screenshot.image|basename}}{% endif %}</a> 129 : </span> 130 :
{{comment.image|safe}} 131 : </div> 132 : </dt> 133 : <dd> 134 :
<pre>{{comment.text|escape}}</pre> 135 : {% reply_section review comment
"screenshot_comment" "rc" %} 136 : </dd> 137 : {% endfor %} 138 : {% for
comment in review.ordered_comments %} 139 : <dt> 140 : <a
name="comment{{comment.id}}"></a> 141 : <table class="sidebyside{% ifequal
comment.filediff.source_revision PRE_CREATION %} newfile{% endifequal %}">
142 : <colgroup> 143 : <col class="line" /> 144 : <col class="left" /> 145
: <col class="line" /> 146 : <col class="right" /> 147 : </colgroup> 148 :
<thead> Traceback: File "***/sj/lib/python/django/template/debug.py" in
render_node 71. result = node.render(context) File
"***/sj/lib/python/django/template/defaulttags.py" in render 149.
nodelist.append(node.render(context)) File
"***/reviewboard-read-only/reviewboard/djblets/util/decorators.py" in
render 150. args = [Variable(var).resolve(context) for var in self.args]
File "***/sj/lib/python/django/template/__init__.py" in resolve 659. value
= self._resolve_lookup(context) File
"***/sj/lib/python/django/template/__init__.py" in _resolve_lookup 712.
raise VariableDoesNotExist("Failed lookup for key [%s] in %r", (bit,
current)) # missing attribute Exception Type: VariableDoesNotExist at
/r/76/ Exception Value: Failed lookup for key [filediff] in u"This looks ok
but it's an unrelated change. I also though I saw comments on this
somewhere else so maybe it's included on multiple changelists?"
Request information
GET
No GET data
POST
No POST data
COOKIES
Variable Value
sessionid
'6cf5c40db8544bf07e87320743cfe7f7'
rbsessionid
'0ef54740bbdadbe4798b11e62e4a5abf'
collapsediffs
'True'
META
Variable Value
DOCUMENT_ROOT
'***/reviewboard-read-only//reviewboard/htdocs'
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_CONNECTION
'keep-alive'
HTTP_COOKIE
'sessionid=6cf5c40db8544bf07e87320743cfe7f7; collapsediffs=True;
rbsessionid=0ef54740bbdadbe4798b11e62e4a5abf'
HTTP_HOST
'***:8070'
HTTP_KEEP_ALIVE
'300'
HTTP_REFERER
'http://***:8070/dashboard/?view=outgoing'
HTTP_USER_AGENT
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14)
Gecko/20080404 Firefox/2.0.0.14'
PATH_INFO
'/r/76/'
PATH_TRANSLATED
'***/reviewboard-read-only//reviewboard/htdocs/r/76/'
QUERY_STRING
''
REDIRECT_STATUS
'200'
REDIRECT_URI
'/reviewboard.fcgi/r/76/'
REMOTE_ADDR
'164.55.153.61'
REMOTE_PORT
'3908'
REQUEST_METHOD
'GET'
REQUEST_URI
'/r/76/'
SCRIPT_FILENAME
'***/reviewboard-read-only//reviewboard/htdocs/reviewboard.fcgi'
SCRIPT_NAME
'/reviewboard.fcgi'
SERVER_ADDR
'164.55.90.87'
SERVER_NAME
'***:8070'
SERVER_PORT
'8070'
SERVER_PROTOCOL
'HTTP/1.1'
SERVER_SOFTWARE
'lighttpd/1.4.18'
wsgi.errors
<flup.server.fcgi_base.TeeOutputStream object at 0x1c343510>
wsgi.input
<flup.server.fcgi_base.InputStream object at 0x1c343e90>
wsgi.multiprocess
True
wsgi.multithread
False
wsgi.run_once
False
wsgi.url_scheme
'http'
wsgi.version
(1, 0)
Settings
Using settings module reviewboard.settings
Setting Value
ABSOLUTE_URL_OVERRIDES
{}
ADMINS
('Example Joe', 'admin@example.com')
ADMIN_FOR
()
ADMIN_MEDIA_PREFIX
'/media/admin/'
ALLOWED_INCLUDE_ROOTS
()
APPEND_SLASH
True
AUTHENTICATION_BACKENDS
('django.contrib.auth.backends.ModelBackend',)
AUTH_PROFILE_MODULE
'accounts.Profile'
BANNED_IPS
()
BUILTIN_AUTH
True
CACHE_BACKEND
'memcached://127.0.0.1:12112/'
CACHE_EXPIRATION_TIME
2592000
CACHE_MIDDLEWARE_KEY_PREFIX
''
CACHE_MIDDLEWARE_SECONDS
600
COMMENTS_ALLOW_PROFANITIES
False
COMMENTS_BANNED_USERS_GROUP
None
COMMENTS_FIRST_FEW
0
COMMENTS_MODERATORS_GROUP
None
COMMENTS_SKETCHY_USERS_GROUP
None
CONNECTION_INIT_SQL
('SET search_path TO review_board',)
DATABASE_ENGINE
'postgresql_psycopg2'
DATABASE_HOST
''
DATABASE_NAME
'templates_development'
DATABASE_OPTIONS
{}
DATABASE_PASSWORD
'********************'
DATABASE_PORT
''
DATABASE_USER
'templates'
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
'webmaster@localhost'
DEFAULT_INDEX_TABLESPACE
''
DEFAULT_REPOSITORY_PATH
None
DEFAULT_TABLESPACE
''
DIFFVIEWER_PAGINATE_BY
20
DIFFVIEWER_PAGINATE_ORPHANS
10
DIFF_CONTEXT_COLLAPSE_THRESHOLD
13
DIFF_CONTEXT_NUM_LINES
5
DIFF_INCLUDE_SPACE_PATTERNS
[]
DIFF_SYNTAX_HIGHLIGHTING
False
DISALLOWED_USER_AGENTS
()
DOMAIN_METHOD
'http'
EMAIL_HOST
'localhost'
EMAIL_HOST_PASSWORD
'********************'
EMAIL_HOST_USER
''
EMAIL_PORT
25
EMAIL_SUBJECT_PREFIX
'[Django] '
EMAIL_USE_TLS
False
ENABLE_SEARCH
False
FILE_CHARSET
'utf-8'
FIXTURE_DIRS
()
HTDOCS_ROOT
'***/reviewboard-read-only/reviewboard/htdocs'
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.admin', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.markup',
'django.contrib.sites', 'django.contrib.sessions', 'djblets.datagrid',
'djblets.util', 'djblets.webapi', 'reviewboard.accounts',
'reviewboard.admin', 'reviewboard.diffviewer', 'reviewboard.iphone',
'reviewboard.reports', 'reviewboard.reviews', 'reviewboard.scmtools',
'reviewboard.webapi', 'django_evolution']
INTERNAL_IPS
()
JING_PATH
'/usr/bin/jing'
LANGUAGES
(('ar', 'Arabic'), ('bn', 'Bengali'), ('bg', 'Bulgarian'), ('ca',
'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de',
'German'), ('el', 'Greek'), ('en', 'English'), ('es', 'Spanish'), ('es-ar',
'Argentinean Spanish'), ('eu', 'Basque'), ('fa', 'Persian'), ('fi',
'Finnish'), ('fr', 'French'), ('ga', 'Irish'), ('gl', 'Galician'), ('hu',
'Hungarian'), ('he', 'Hebrew'), ('hr', 'Croatian'), ('is', 'Icelandic'),
('it', 'Italian'), ('ja', 'Japanese'), ('ka', 'Georgian'), ('ko',
'Korean'), ('km', 'Khmer'), ('kn', 'Kannada'), ('lv', 'Latvian'), ('mk',
'Macedonian'), ('nl', 'Dutch'), ('no', 'Norwegian'), ('pl', 'Polish'),
('pt', 'Portugese'), ('pt-br', 'Brazilian Portuguese'), ('ro', 'Romanian'),
('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sr',
'Serbian'), ('sv', 'Swedish'), ('ta', 'Tamil'), ('te', 'Telugu'), ('tr',
'Turkish'), ('uk', 'Ukrainian'), ('zh-cn', 'Simplified Chinese'), ('zh-tw',
'Traditional Chinese'))
LANGUAGES_BIDI
('he', 'ar', 'fa')
LANGUAGE_CODE
'en-us'
LANGUAGE_COOKIE_NAME
'django_language'
LOCALE_PATHS
()
LOGIN_REDIRECT_URL
'/accounts/profile/'
LOGIN_URL
'/account/login/'
LOGOUT_URL
'/accounts/logout/'
MANAGERS
('Example Joe', 'admin@example.com')
MEDIA_ROOT
'***/reviewboard-read-only/reviewboard/htdocs/media'
MEDIA_URL
'/media/'
MIDDLEWARE_CLASSES
('django.middleware.common.CommonMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware')
MONTH_DAY_FORMAT
'F j'
PREPEND_WWW
False
PROFANITIES_LIST
'********************'
REQUIRE_SITEWIDE_LOGIN
False
REVIEWBOARD_ROOT
'***/reviewboard-read-only/reviewboard'
ROOT_URLCONF
'djblets.util.rooturl'
SEARCH_INDEX
'***/reviewboard-read-only/reviewboard/search-index'
SECRET_KEY
'********************'
SEND_BROKEN_LINK_EMAILS
False
SEND_REVIEW_MAIL
True
SERVER_EMAIL
'root@localhost'
SESSION_COOKIE_AGE
12614400
SESSION_COOKIE_DOMAIN
None
SESSION_COOKIE_NAME
'rbsessionid'
SESSION_COOKIE_PATH
'/'
SESSION_COOKIE_SECURE
False
SESSION_ENGINE
'django.contrib.sessions.backends.db'
SESSION_EXPIRE_AT_BROWSER_CLOSE
False
SESSION_FILE_PATH
None
SESSION_SAVE_EVERY_REQUEST
False
SETTINGS_MODULE
'reviewboard.settings'
SITE_ID
1
SITE_ROOT
'/'
SITE_ROOT_URLCONF
'reviewboard.urls'
TEMPLATE_CONTEXT_PROCESSORS
('django.core.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.request',
'djblets.util.context_processors.settingsVars',
'djblets.util.context_processors.siteRoot')
TEMPLATE_DEBUG
True
TEMPLATE_DIRS
('***/reviewboard-read-only/reviewboard/templates',)
TEMPLATE_LOADERS
('django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source')
TEMPLATE_STRING_IF_INVALID
''
TEST_DATABASE_CHARSET
None
TEST_DATABASE_COLLATION
None
TEST_DATABASE_NAME
None
TEST_RUNNER
'reviewboard.test.runner'
TIME_FORMAT
'P'
TIME_ZONE
'US/Pacific'
TRANSACTIONS_MANAGED
False
URL_VALIDATOR_USER_AGENT
u'Django/0.97-pre-SVN-unknown (http://www.djangoproject.com)'
USE_ETAGS
False
USE_I18N
True
WEB_API_ENCODERS
('djblets.webapi.core.BasicAPIEncoder',
'reviewboard.webapi.json.ReviewBoardAPIEncoder')
YEAR_MONTH_FORMAT
'F Y'
You're seeing this error because you have DEBUG = True in your Django
settings file. Change that to False, and Django will display a standard 500
page.
What operating system are you using? What browser?
Please provide any additional information below.