Modify

Opened 15 years ago

Closed 9 years ago

#6398 closed defect (wontfix)

Internal error if ticket text references SVN-like revision number (changeset)

Reported by: nenad@… Owned by: Herbert Valerio Riedel
Priority: highest Component: GitPlugin
Severity: blocker Keywords: read_commit internal error
Cc: Trac Release: 0.12

Description

Internal error is issued if ticket text references SVN-like revision number (changeset), something like "This is somethig done in r3314"; changeset 3314 of course does not exist in GIT repository.

Browser displays:

Oops…
Trac detected an internal error:

AttributeError: 'NoneType' object has no attribute 'read_commit'

There was an internal error in Trac. It is recommended that you inform your local Trac administrator and give him all the information he needs to reproduce the issue.

Relevant part of log file is:

2010-01-05 18:04:54,414 Trac[perm] DEBUG: No policy allowed nenad performing TRAC_ADMIN on <Resource u'changeset:3314'>
2010-01-05 18:04:54,416 Trac[main] ERROR: Exception caught while post-processing request:
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/web/main.py", line 239, in dispatch
    self._post_process_request(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/web/main.py", line 311, in _post_process_request
    f.post_process_request(req, *(None,)*extra_arg_count)
  File "build/bdist.linux-i686/egg/ticketmodifiedfiles/ticketmodifiedfiles.py", line 46, in post_process_request
TypeError: object does not support item assignment
2010-01-05 18:04:54,418 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/web/main.py", line 450, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/web/main.py", line 227, in dispatch
    data, content_type)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/web/chrome.py", line 773, in render_template
    stream.render(method, doctype=doctype, out=buffer)
  File "/usr/lib/python2.4/site-packages/genshi/core.py", line 179, in render
    return encode(generator, method=method, encoding=encoding, out=out)
  File "/usr/lib/python2.4/site-packages/genshi/output.py", line 61, in encode
    for chunk in iterator:
  File "/usr/lib/python2.4/site-packages/genshi/output.py", line 311, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.4/site-packages/genshi/output.py", line 753, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.4/site-packages/genshi/output.py", line 592, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.4/site-packages/genshi/output.py", line 698, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/usr/lib/python2.4/site-packages/genshi/output.py", line 532, in __call__
    for ev in stream:
  File "/usr/lib/python2.4/site-packages/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/web/chrome.py", line 838, in _strip_accesskeys
    for kind, data, pos in stream:
  File "/usr/lib/python2.4/site-packages/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/web/chrome.py", line 827, in _generate
    for kind, data, pos in stream:
  File "/usr/lib/python2.4/site-packages/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/filters/transform.py", line 686, in _unmark
    for mark, event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/filters/transform.py", line 1086, in __call__
    for mark, event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/filters/transform.py", line 117, in __iter__
    event = self.stream.next()
  File "/usr/lib/python2.4/site-packages/genshi/filters/transform.py", line 725, in __call__
    mark, subevent = stream.next()
  File "/usr/lib/python2.4/site-packages/genshi/filters/transform.py", line 682, in _mark
    for event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/filters/transform.py", line 686, in _unmark
    for mark, event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/filters/transform.py", line 1055, in __call__
    for mark, event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/filters/transform.py", line 117, in __iter__
    event = self.stream.next()
  File "/usr/lib/python2.4/site-packages/genshi/filters/transform.py", line 713, in __call__
    for mark, event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/filters/transform.py", line 682, in _mark
    for event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/template/base.py", line 569, in _include
    for event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/template/markup.py", line 298, in _match
    ctxt, start=idx + 1, **vars):
  File "/usr/lib/python2.4/site-packages/genshi/template/markup.py", line 298, in _match
    ctxt, start=idx + 1, **vars):
  File "/usr/lib/python2.4/site-packages/genshi/template/markup.py", line 245, in _match
    for event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/template/base.py", line 543, in _exec
    for event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/template/base.py", line 533, in _eval
    for event in substream:
  File "/usr/lib/python2.4/site-packages/genshi/template/base.py", line 496, in _eval
    for kind, data, pos in stream:
  File "/usr/lib/python2.4/site-packages/genshi/template/base.py", line 551, in _flatten
    for event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/path.py", line 141, in _generate
    subevent = stream.next()
  File "/usr/lib/python2.4/site-packages/genshi/template/base.py", line 569, in _include
    for event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/template/markup.py", line 234, in _strip
    event = stream.next()
  File "/usr/lib/python2.4/site-packages/genshi/template/base.py", line 543, in _exec
    for event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/template/base.py", line 533, in _eval
    for event in substream:
  File "/usr/lib/python2.4/site-packages/genshi/template/base.py", line 496, in _eval
    for kind, data, pos in stream:
  File "/usr/lib/python2.4/site-packages/genshi/template/base.py", line 551, in _flatten
    for event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/path.py", line 141, in _generate
    subevent = stream.next()
  File "/usr/lib/python2.4/site-packages/genshi/template/base.py", line 569, in _include
    for event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/template/markup.py", line 234, in _strip
    event = stream.next()
  File "/usr/lib/python2.4/site-packages/genshi/template/base.py", line 543, in _exec
    for event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/template/base.py", line 533, in _eval
    for event in substream:
  File "/usr/lib/python2.4/site-packages/genshi/template/base.py", line 520, in _eval
    result = _eval_expr(data, ctxt, **vars)
  File "/usr/lib/python2.4/site-packages/genshi/template/base.py", line 286, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/usr/lib/python2.4/site-packages/genshi/template/eval.py", line 180, in evaluate
    return eval(self.code, _globals, {'__data__': data})
text, change.comment, escape_newlines=preserve_newlines)'>
    ${wiki_to_html(context, change.comment, escape_newlines=preserve_newlines)}
  File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/util/compat.py", line 135, in newfunc
    return func_(*(args + fargs), **dict(kwargs, **fkwargs))
  File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/wiki/formatter.py", line 1118, in format_to_html
    return HtmlFormatter(env, context, wikidom).generate(escape_newlines)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/wiki/formatter.py", line 1073, in generate
    escape_newlines)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/wiki/formatter.py", line 878, in format
    result = re.sub(self.wikiparser.rules, self.replace, line)
  File "/usr/lib/python2.4/sre.py", line 142, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/wiki/formatter.py", line 825, in replace
    replacement = self.handle_match(fullmatch)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/wiki/formatter.py", line 818, in handle_match
    return external_handler(self, match, fullmatch)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/versioncontrol/web_ui/changeset.py", line 916, in <lambda>
    y, z))
  File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/versioncontrol/web_ui/changeset.py", line 936, in _format_changeset_link
    changeset = self.env.get_repository().get_changeset(rev)
  File "/usr/lib/python2.4/site-packages/TracGit-0.11.0.2.egg/tracext/git/git_fs.py", line 223, in get_changeset
    return GitChangeset(self.git, rev)
  File "/usr/lib/python2.4/site-packages/TracGit-0.11.0.2.egg/tracext/git/git_fs.py", line 395, in __init__
    (msg, props) = git.read_commit(sha)
AttributeError: 'NoneType' object has no attribute 'read_commit'

Attachments (0)

Change History (4)

comment:1 Changed 14 years ago by anonymous

This problem is killing me. No solutions ?

comment:2 Changed 14 years ago by Herbert Valerio Riedel

This seems to be a problem with the 0.11 branch only, as I can't reproduce it with the current 0.12.0.4 plugin version; is upgrading to the 0.12 branch an option for you?

comment:3 Changed 13 years ago by anonymous

Trac Release: 0.110.12

I just encountered this bug with version 0.12.3 and a git SHA1 within the text. I don't have any git (or other) repositories configured, yet. As a workaround I abbreviated the git SHA1 pasted into the text which allowed me to submit the wiki changes as usual.

These are my complete version infos:

System InformationTrac	0.12.3
CustomFieldAdmin	0.2.2
Docutils	0.7
FullBlog	0.1.1
Genshi	0.6
GIT	1.7.4.1
mod_python	3.3.1
Pygments	1.4
pysqlite	2.6.0
Python	2.7.1+ (r271:86832, Apr 11 2011, 18:37:12) [GCC 4.5.2]
pytz	2010b
setuptools	0.6
SQLite	3.7.4
Subversion	1.6.12 (r955767)
jQuery:	1.4.4
Installed Pluginsgraphviz 	0.7.5	/usr/lib/pymodules/python2.7
icalview 	0.4	/usr/lib/python2.7/dist-packages
TracAccountManager 	0.2.1dev	/usr/lib/pymodules/python2.7
TracCustomFieldAdmin 	0.2.2	/usr/lib/pymodules/python2.7
TracFullBlogPlugin 	0.1.1	/home/bjoern/AutoNomos/trac/plugins/TracFullBlogPlugin-0.1.1-py2.7.egg
TracGit 	0.11.0.2	/usr/lib/python2.7/dist-packages
TracMasterTickets 	2.1.3	/usr/lib/pymodules/python2.7
TracMath 	0.5	/home/bjoern/AutoNomos/trac/plugins/TracMath-0.5-py2.7.egg
TracWikiPrintPlugin 	1.6	/usr/lib/pymodules/python2.7
TracWikiRename 	2.1.1	/usr/lib/pymodules/python2.7
TracWysiwyg 	0.2	/usr/lib/pymodules/python2.7

comment:4 Changed 9 years ago by Ryan J Ollos

Resolution: wontfix
Status: newclosed

GitPlugin is deprecated. Please upgrade to Trac 1.0 and use TracGit.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Herbert Valerio Riedel.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.