I've been seeing issues like the following in the logs, with near daily occurrences. I haven't tried to reproduce yet. It could just be another case of bots inputing invalid data, but it would be good to avoid the traceback.
2015-05-06 17:11:27,781 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.5-py2.6.egg/trac/web/main.py", line 513, in _dispatch_request
dispatcher.dispatch(req)
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.5-py2.6.egg/trac/web/main.py", line 241, in dispatch
content_type)
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.5-py2.6.egg/trac/web/chrome.py", line 1096, in render_template
encoding='utf-8')
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/core.py", line 183, in render
return encode(generator, method=method, encoding=encoding, out=out)
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/output.py", line 58, in encode
for chunk in iterator:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/output.py", line 339, in __call__
for kind, data, pos in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/output.py", line 826, in __call__
for kind, data, pos in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/output.py", line 670, in __call__
for kind, data, pos in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/output.py", line 771, in __call__ for kind, data, pos in chain(stream, [(None, None, None)]):
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/output.py", line 586, in __call__
for ev in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/core.py", line 288, in _ensure
for event in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/core.py", line 288, in _ensure
for event in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.5-py2.6.egg/trac/web/chrome.py", line 1266, in _strip_accesskeys
for kind, data, pos in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/core.py", line 288, in _ensure
for event in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.5-py2.6.egg/trac/web/chrome.py", line 1255, in _generate
for kind, data, pos in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/core.py", line 288, in _ensure
for event in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/core.py", line 288, in _ensure
for event in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/filters/transform.py", line 686, in _unmark
for mark, event in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/filters/transform.py", line 1081, in __call__
for mark, event in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/filters/transform.py", line 117, in __iter__
event = self.stream.next()
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/filters/transform.py", line 714, in __call__
for mark, event in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/filters/transform.py", line 682, in _mark
for event in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/template/base.py", line 605, in _include
for event in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/template/markup.py", line 378, in _match
ctxt, start=idx + 1, **vars):
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/template/markup.py", line 378, in _match
ctxt, start=idx + 1, **vars):
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-lin
ux-i686.egg/genshi/template/markup.py", line 327, in _match
for event in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/template/base.py", line 545, in _flatten
for kind, data, pos in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/core.py", line 288, in _ensure
for event in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/path.py", line 588, in _generate
subevent = next()
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/template/base.py", line 605, in _include
for event in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/template/markup.py", line 316, in _strip
event = next()
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/template/base.py", line 545, in _flatten
for kind, data, pos in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/core.py", line 288, in _ensure
for event in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/path.py", line 588, in _generate
subevent = next()
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/template/base.py", line 605, in _include
for event in stream:
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/template/markup.py", line 316, in _strip
event = next()
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/template/base.py", line 565, in _flatten
result = _eval_expr(data, ctxt, vars)
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/template/base.py", line 277, in _eval_expr
retval = expr.evaluate(ctxt)
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/template/eval.py", line 178, in evaluate
return eval(self.code, _globals, {'__data__': data})
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.5-py2.6.egg/trac/ticket/templates/ticket_change.html", line 138, in <Expression u'wiki_to_html(context, change.comment_history[int(cversion)].comment, escape_newlines=preserve_newlines)'>
${wiki_to_html(context, change.comment_history[int(cversion)].comment, escape_newlines=preserve_newlines)}
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Genshi-0.6-py2.6-linux-i686.egg/genshi/template/eval.py", line 333, in lookup_item
return obj[key]
KeyError: 1
Reproduced with Trac 0.12.6 and 1.0.5.
/ticket/<id>?cversion=1&cnum_hist=1
with id of the ticket