Edgewall Software
Modify

Opened 17 years ago

Closed 15 years ago

Last modified 14 years ago

#5932 closed defect (worksforme)

TypeError: expecting datetime, int, long, float, or None; got <class 'genshi.template.eval.Undefined'>

Reported by: Emmanuel Blot Owned by: Christian Boos
Priority: normal Milestone:
Component: version control/log view Version: devel
Severity: normal Keywords: genshi
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

How to Reproduce

While doing a GET operation on /log/vendor, Trac issued an internal error.

From the "browser" view, I selected the "Revision Log" link.

The issue only shows up from the /vendor tree, the revision log works fine on other SVN trees (/trunk, /branches, etc.)

The CLI SVN client does not show anything weird about this branch: 12 revisions, some with many (1000+) short files.

Request parameters:

{'path': u'/vendor', 'rev': u'12'}

System Information

Trac 0.11dev-r5971
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)]
setuptools 0.6c6
SQLite 3.3.4
pysqlite 2.3.2
Genshi 0.4.4
Pygments 0.8.1
Subversion 1.4.4 (r25188)

Python Traceback

This is the first time I report an issue with the semi-automated bug report feature, but it seems there is an additional issue here:

This is the traceback sent through the GET request on trac.edgewall.org when the ticket is created:

Traceback (most recent call last):
  File "c:/Programs/Python/local/trac\trac\web\main.py", line 381, in dispatch_request
    dispatcher.dispatch(req)
  File "c:/Programs/Python/local/trac\trac\web\main.py", line 213, in dispatch
    data, content_type)
  File "c:/Programs/Python/local/trac\trac\web\chrome.py", line 601, in render_template
    return stream.render(method, doctype=doctype)
  File "build/bdist.macosx-10.3-fat/egg/genshi/core.py", line 154, in render
    return encode(generator, method=method, encoding=encoding)
  File "build/bdis

(yes, it is truncated)

This is the traceback I actually got in the web browser:

File "c:/Programs/Python/local/trac\trac\versioncontrol\templates\revisionlog.html", line 148, in <Expression u'dateinfo(change.date)'>
  <td class="date" py:content="dateinfo(change.date)" />
File "C:\Programs\Python\local\trac\trac\timeline\web_ui.py", line 218, in dateinfo
  pretty_timedelta(date),
File "C:\Programs\Python\local\trac\trac\util\datefmt.py", line 70, in pretty_timedelta
  time1 = to_datetime(time1)
File "C:\Programs\Python\local\trac\trac\util\datefmt.py", line 50, in to_datetime
  type(t))

Attachments (2)

out.txt (760 bytes ) - added by czerwonka@… 16 years ago.
czerwonka_callstack.txt (3.6 KB ) - added by czerwonka@… 16 years ago.

Download all attachments as: .zip

Change History (28)

comment:1 by Tim Hatch, 17 years ago

Hmm. Do you have the rest of the traceback? I don't see the line with what the exception itself is.

comment:2 by Tim Hatch, 17 years ago

Oh, I see it in the title now. Since I don't see a way for change.date to not exist, I'm wondering if somehow change itself is missing. Can you paste the output of svn log -v vendor?

comment:3 by anonymous, 17 years ago

I got the same problem, a simple workaround is to edit revisionlog.html on line 148 and to replace "dateinfo(change.date)" by "hange.date". The nice date formating is lost but there is not errors, and you still got the date info.

I'm don't know much about python, but the error seems to come from the to_datetime function (line 50 in trac\util\datefmt.py) which seems to have difficulties about reading the date passed to it.

My system : Trac: 0.11dev-r6136 Python: 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] setuptools: 0.6c7 SQLite: 3.3.4 pysqlite: 2.3.2 Genshi: 0.4.4 Subversion: 1.4.4 (r25188) jQuery: 1.1.3.1

comment:4 by Christian Boos, 17 years ago

Keywords: genshi added
Milestone: 0.11.1

If you have the right date information when using change.date directly but not when using dateinfo(change.date), then it is possibly related to a Genshi bug (#G158).

If you don't mind, please test the patch I posted there.

comment:5 by anonymous, 17 years ago

Same anonymous as above, In fact I discovered that this error happened only in revlog where a changeset is missing (why I don't know).

So there two solution : first "trac user" have to discovered why there is missing information in his revisions (In my case, the first commit had no date and is post byanonymous, but in Subervsion the correct info are there…), second Trac developpers should had a failsafe date check in dateinfo function.

in reply to:  4 ; comment:6 by anonymous, 17 years ago

Same *dumb* anonymous as above.

After search on "trac Error: No such changeset" is discovered this ticket (#6120)

All it takes is launching : "trac-admin /path/to/trac/project/ resync".

IMHO there still to point to sort out : why "trac-admin /path/to/trac/project/ upgrade" didn't do the resync, and add failesafe checks in functions…

comment:7 by anonymous, 16 years ago

I have the same thing here, the web frontend displays:

TypeError: expecting datetime, int, long, float, or None; got <class 'genshi.template.eval.Undefined'>

And the traceback:

Most recent call last:

    * File "/home/zope/python/Python-2.5.1/lib/python2.5/site-packages/Trac-0.11rc2-py2.5.egg/trac/versioncontrol/templates/revisionlog.html", line 134, in <Expression u'dateinfo(change.date)'>
      Code fragment:
       129. </td>
       130. <td class="chgset">
       131. <a title="View changeset [$item.rev] for $item.path" href="${href.changeset(item.rev, item.path)}">
       132. [$item.rev]</a>
       133. </td>
       134. <td class="date" py:content="dateinfo(change.date)" />
       135. <td class="author" py:content="authorinfo(change.author)" />
       136. <td class="summary" py:choose="">
       137. <py:when test="verbose or 'CHANGESET_VIEW' not in perm(chgset_context.resource)"></py:when>
       138. <py:when test="wiki_format_messages">
       139. ${wiki_to_oneliner(chgset_context, change.message, shorten=True)}
      Local variables:
      Name	Value
      __data__ 	[{'odd_even': 'odd', 'chgset_context': <Context <Resource ...
    * File "/home/zope/python/Python-2.5.1/lib/python2.5/site-packages/Trac-0.11rc2-py2.5.egg/trac/timeline/web_ui.py", line 230, in dateinfo
      Code fragment:
       225.
       226. def post_process_request(self, req, template, data, content_type):
       227. if data:
       228. def dateinfo(date):
       229. return self.get_timeline_link(req, date,
       230. pretty_timedelta(date),
       231. precision='second')
       232. data['dateinfo'] = dateinfo
       233. return template, data, content_type
       234.  
       235. # IWikiSyntaxProvider methods
      Local variables:
      Name	Value
      date 	<Undefined 'date'>
      req 	<Request "GET u'/log/bsp/trunk/bsp/payment.py'">
      self 	<trac.timeline.web_ui.TimelineModule object at 0x4153756c>
    * File "/home/zope/python/Python-2.5.1/lib/python2.5/site-packages/Trac-0.11rc2-py2.5.egg/trac/util/datefmt.py", line 70, in pretty_timedelta
      Code fragment:
        65. (the result is somewhat imprecise, only use for prettyprinting).
        66.  
        67. If either `time1` or `time2` is None, the current time will be used
        68. instead.
        69. """
        70. time1 = to_datetime(time1)
        71. time2 = to_datetime(time2)
        72. if time1 > time2:
        73. time2, time1 = time1, time2
        74. units = ((3600 * 24 * 365, 'year', 'years'),
        75. (3600 * 24 * 30, 'month', 'months'),
      Local variables:
      Name	Value
      resolution 	None
      time1 	<Undefined 'date'>
      time2 	None
    * File "/home/zope/python/Python-2.5.1/lib/python2.5/site-packages/Trac-0.11rc2-py2.5.egg/trac/util/datefmt.py", line 50, in to_datetime
      Code fragment:
        45. elif isinstance(t, datetime):
        46. return t
        47. elif isinstance(t, (int,long,float)):
        48. return datetime.fromtimestamp(t, tzinfo or localtz)
        49. raise TypeError('expecting datetime, int, long, float, or None; got %s' %
        50. type(t))
        51.  
        52. def to_timestamp(dt):
        53. """Return the corresponding POSIX timestamp"""
        54. if dt:
        55. diff = dt - _epoc
      Local variables:
      Name	Value
      t 	<Undefined 'date'>
      tzinfo 	None

File "/home/zope/python/Python-2.5.1/lib/python2.5/site-packages/Trac-0.11rc2-py2.5.egg/trac/versioncontrol/templates/revisionlog.html", line 134, in <Expression u'dateinfo(change.date)'>
  <td class="date" py:content="dateinfo(change.date)" />
File "/home/zope/python/Python-2.5.1/lib/python2.5/site-packages/Trac-0.11rc2-py2.5.egg/trac/timeline/web_ui.py", line 230, in dateinfo
  pretty_timedelta(date),
File "/home/zope/python/Python-2.5.1/lib/python2.5/site-packages/Trac-0.11rc2-py2.5.egg/trac/util/datefmt.py", line 70, in pretty_timedelta
  time1 = to_datetime(time1)
File "/home/zope/python/Python-2.5.1/lib/python2.5/site-packages/Trac-0.11rc2-py2.5.egg/trac/util/datefmt.py", line 50, in to_datetime
  type(t))

comment:8 by gunnar_thielebein@…, 16 years ago

We are getting the same issue. Strange is that it happens in one environment but not happens in another on the same machine.

Message: {{{TypeError: expecting datetime, int, long, float, or None; got <class 'genshi.template.eval.Undefined'> }}}

comment:9 by anonymous, 16 years ago

I am getting this on version 0.11.1 as well. It is occurring when I am attempting to view the last 2 changesets (committed within the last 2 weeks) in the source browser. Changesets before that are fine. I surmise that it has something to do with the upgrade from 0.10.x to 0.11.1 which was two weeks ago. At the same time, I also upgraded svn to 1.5.1 and the svn-python bindings. This is on Mac OS X Leopard.

in reply to:  6 ; comment:10 by noel, 16 years ago

Replying to anonymous:

…something to do with the upgrade from 0.10.x to 0.11.1, …also upgraded svn to 1.5.1 and the svn-python bindings. This is on Mac OS X Leopard.

I also got this error trying to view new changesets after upgrading Trac from 0.10.x to 0.11.1, Python from 2.3 to 2.5, and SVN from 1.2.3 to 1.5.1, on Windows XP.

Replying to anonymous:

All it takes is launching : "trac-admin /path/to/trac/project/ resync".

Worked for me.

Thanks everyone.

in reply to:  3 comment:11 by anonymous, 16 years ago

Replying to anonymous:

I got the same problem, a simple workaround is to edit revisionlog.html on line 148 and to replace "dateinfo(change.date)" by "hange.date". The nice date formating is lost but there is not errors, and you still got the date info.

I got same problem and replace dateinfo(change.date) with change.date. It works.

in reply to:  10 comment:12 by anonymous, 16 years ago

Replying to noel:

Replying to anonymous:

…something to do with the upgrade from 0.10.x to 0.11.1, …also upgraded svn to 1.5.1 and the svn-python bindings. This is on Mac OS X Leopard.

I also got this error trying to view new changesets after upgrading Trac from 0.10.x to 0.11.1, Python from 2.3 to 2.5, and SVN from 1.2.3 to 1.5.1, on Windows XP.

Replying to anonymous:

All it takes is launching : "trac-admin /path/to/trac/project/ resync".

Worked for me. Thanks everyone.

"trac-admin /path/to/trac/project/ resync" also work fine to me.

comment:13 by czerwonka@…, 16 years ago

same problem here and the resync didn't work for me

in reply to:  13 ; comment:14 by Christian Boos, 16 years ago

Replying to czerwonka@…:

same problem here and the resync didn't work for me

Can you please show us the output of svn log --xml -v -rXXX (XXX being the changeset that didn't work)?

in reply to:  14 comment:15 by czerwonka@…, 16 years ago

Replying to cboos:

Replying to czerwonka@…:

same problem here and the resync didn't work for me

Can you please show us the output of svn log --xml -v -rXXX (XXX being the changeset that didn't work)?

The changeset link works - its the revision log link that's broken. The revision log give me the following

wizzer:sofia aczerwon$ svn log —xml -v -r1 <?xml version="1.0"?> <log> <logentry

revision="1">

<author>root</author> <date>2009-01-11T14:25:39.597847Z</date> <paths> <path

action="A">/sofia</path>

<path

action="A">/sofia/trunk</path>

<path

action="A">/sofia/branches</path>

<path

action="A">/sofia/trunk/doc</path>

<path

action="A">/sofia/trunk/src</path>

<path

action="A">/sofia/tags</path>

</paths> <msg>inital Sofia project structure</msg> </logentry> </log>

The that's broken is:

http://myhost/log/tags?rev=4

comment:16 by czerwonka@…, 16 years ago

any update here?

in reply to:  16 ; comment:17 by Christian Boos, 16 years ago

Replying to czerwonka@…:

any update here?

Sorry, forgot to ask for the version of Trac and Genshi you're using (see comment:4). A related question: does the problem happen systematically or only at times?

The changeset r1 seems fine, but as you're requesting the rev=4, we would actually need to see the output of svn log --xml -r1:4 (use an attachment for that output).

Also, what happens when you try the workaround described in comment:3 (replacing dateinfo(change.date) by change.date alone)?

in reply to:  17 ; comment:18 by czerwonka@…, 16 years ago

Replying to cboos:

Replying to czerwonka@…:

any update here?

Sorry, forgot to ask for the version of Trac and Genshi you're using (see comment:4). A related question: does the problem happen systematically or only at times?

I'm using the latest Trac, version Trac 0.11.2.1 and version 0.5.1-1.320 of Genshi. It's always happening.

The changeset r1 seems fine, but as you're requesting the rev=4, we would actually need to see the output of svn log --xml -r1:4 (use an attachment for that output).

I've attached out.txt

Also, what happens when you try the workaround described in comment:3 (replacing dateinfo(change.date) by change.date alone)?

I have not tried that, but seems like a workaround for the dateinfo function?

by czerwonka@…, 16 years ago

Attachment: out.txt added

by czerwonka@…, 16 years ago

Attachment: czerwonka_callstack.txt added

in reply to:  18 comment:19 by Christian Boos, 16 years ago

Replying to czerwonka@…:

Replying to cboos:

Replying to czerwonka@…:

any update here?

Sorry, forgot to ask for the version of Trac and Genshi you're using (see comment:4). A related question: does the problem happen systematically or only at times?

I'm using the latest Trac, version Trac 0.11.2.1 and version 0.5.1-1.320 of Genshi. It's always happening.

Hum, so this has nothing to do with comment:4. On the other hand, this is perfect as a reproducible error is always debuggable ;-)

The changeset r1 seems fine, but as you're requesting the rev=4, we would actually need to see the output of svn log --xml -r1:4 (use an attachment for that output).

I've attached out.txt

No visible issue there.

comment:20 by anonymous, 15 years ago

How to Reproduce

While doing a GET operation on /log/, Trac issued an internal error.

I had a similar problem, same error message, and it seems to have happened after upgrading to SVN 1.6 and installing the swig python hooks again (all from source instead of binaries).

Request parameters:

{'path': u'/'}

User Agent was: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1 (.NET CLR 3.5.30729)

System Information

Trac 0.11.5
Python 2.5.1 (r251:54863, Jun 15 2008, 18:24:51)
[GCC 4.3.0 20080428 (Red Hat 4.3.0-8)]
setuptools 0.6c9
SQLite 3.5.9
pysqlite 2.3.3
Genshi 0.5.1
mod_python 3.3.1
Subversion 1.6.3 (r38063)
jQuery: 1.2.6

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/web/main.py", line 444, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/web/main.py", line 226, in dispatch
    data, content_type)
  File "/usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/web/chrome.py", line 765, in render_template
    stream.render(method, doctype=doctype, out=buffer)
  File "/usr/lib/python2.5/site-packages/genshi/core.py", line 179, in render
    return encode(generator, method=method, encoding=encoding, out=out)
  File "/usr/lib/python2.5/site-packages/genshi/output.py", line 61, in encode
    for chunk in iterator:
  File "/usr/lib/python2.5/site-packages/genshi/output.py", line 311, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/genshi/output.py", line 753, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/genshi/output.py", line 592, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/genshi/output.py", line 698, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/usr/lib/python2.5/site-packages/genshi/output.py", line 532, in __call__
    for ev in stream:
  File "/usr/lib/python2.5/site-packages/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.5/site-packages/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/web/chrome.py", line 830, in _strip_accesskeys
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/web/chrome.py", line 819, in _generate
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/genshi/template/base.py", line 569, in _include
    for event in stream:
  File "/usr/lib/python2.5/site-packages/genshi/template/markup.py", line 298, in _match
    ctxt, start=idx + 1, **vars):
  File "/usr/lib/python2.5/site-packages/genshi/template/markup.py", line 298, in _match
    ctxt, start=idx + 1, **vars):
  File "/usr/lib/python2.5/site-packages/genshi/template/markup.py", line 245, in _match
    for event in stream:
  File "/usr/lib/python2.5/site-packages/genshi/template/base.py", line 543, in _exec
    for event in stream:
  File "/usr/lib/python2.5/site-packages/genshi/template/base.py", line 533, in _eval
    for event in substream:
  File "/usr/lib/python2.5/site-packages/genshi/template/base.py", line 496, in _eval
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/genshi/template/base.py", line 551, in _flatten
    for event in stream:
  File "/usr/lib/python2.5/site-packages/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.5/site-packages/genshi/path.py", line 141, in _generate
    subevent = stream.next()
  File "/usr/lib/python2.5/site-packages/genshi/template/base.py", line 569, in _include
    for event in stream:
  File "/usr/lib/python2.5/site-packages/genshi/template/markup.py", line 234, in _strip
    event = stream.next()
  File "/usr/lib/python2.5/site-packages/genshi/template/base.py", line 543, in _exec
    for event in stream:
  File "/usr/lib/python2.5/site-packages/genshi/template/base.py", line 533, in _eval
    for event in substream:
  File "/usr/lib/python2.5/site-packages/genshi/template/base.py", line 496, in _eval
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/genshi/template/base.py", line 551, in _flatten
    for event in stream:
  File "/usr/lib/python2.5/site-packages/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.5/site-packages/genshi/path.py", line 141, in _generate
    subevent = stream.next()
  File "/usr/lib/python2.5/site-packages/genshi/template/base.py", line 569, in _include
    for event in stream:
  File "/usr/lib/python2.5/site-packages/genshi/template/markup.py", line 234, in _strip
    event = stream.next()
  File "/usr/lib/python2.5/site-packages/genshi/template/base.py", line 543, in _exec
    for event in stream:
  File "/usr/lib/python2.5/site-packages/genshi/template/base.py", line 520, in _eval
    result = _eval_expr(data, ctxt, **vars)
  File "/usr/lib/python2.5/site-packages/genshi/template/base.py", line 286, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/usr/lib/python2.5/site-packages/genshi/template/eval.py", line 180, in evaluate
    return eval(self.code, _globals, {'__data__': data})
  File "/usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/versioncontrol/templates/revisionlog.html", line 142, in <Expression u'dateinfo(change.date)'>
    <td class="date" py:content="dateinfo(change.date)" />
  File "/usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/timeline/web_ui.py", line 236, in dateinfo
    pretty_timedelta(date),
  File "/usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/util/datefmt.py", line 71, in pretty_timedelta
    time1 = to_datetime(time1)
  File "/usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/util/datefmt.py", line 51, in to_datetime
    type(t))
TypeError: expecting datetime, int, long, float, or None; got <class 'genshi.template.eval.Undefined'>

comment:21 by Christian Boos, 15 years ago

Keywords: needinfo added

This issue is not much about finding a workaround for avoiding the issue (that's easy), but rather to understand precisely what happens and fix the root cause.

And for that, I need to have a way to actually reproduce the issue, which so far hasn't been the case.

See related #8432 for a very similar issue, which was reproducible and hence could be fixed.

comment:22 by Christian Boos, 15 years ago

Milestone: next-minor-0.12.x
Resolution: wontfix
Status: newclosed

Can't reproduce.

comment:23 by Christian Boos, 15 years ago

Keywords: needinfo removed
Milestone: 0.11.7
Resolution: wontfix
Status: closedreopened

Seen one instance in the log of the Trac instance of [Babel:]:

2010-03-09 07:50:23,304 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
  File "/usr/local/virtualenv/0.11-stable/lib/python2.5/site-packages/Trac-0.11.7rc1_r9277-py2.5.egg/trac/web/main.py", line 450, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/virtualenv/0.11-stable/lib/python2.5/site-packages/Trac-0.11.7rc1_r9277-py2.5.egg/trac/web/main.py", line 227, in dispatch
    data, content_type)
  File "/usr/local/virtualenv/0.11-stable/lib/python2.5/site-packages/Trac-0.11.7rc1_r9277-py2.5.egg/trac/web/chrome.py", line 773, in render_template
    stream.render(method, doctype=doctype, out=buffer)
  File "build/bdist.linux-x86_64/egg/genshi/core.py", line 183, in render
    return encode(generator, method=method, encoding=encoding, out=out)
  File "build/bdist.linux-x86_64/egg/genshi/output.py", line 58, in encode
    for chunk in iterator:
  File "build/bdist.linux-x86_64/egg/genshi/output.py", line 339, in __call__
    for kind, data, pos in stream:
  File "build/bdist.linux-x86_64/egg/genshi/output.py", line 826, in __call__
    for kind, data, pos in stream:
  File "build/bdist.linux-x86_64/egg/genshi/output.py", line 670, in __call__
    for kind, data, pos in stream:
  File "build/bdist.linux-x86_64/egg/genshi/output.py", line 771, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "build/bdist.linux-x86_64/egg/genshi/output.py", line 586, in __call__
    for ev in stream:
  File "build/bdist.linux-x86_64/egg/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/usr/local/virtualenv/0.11-stable/lib/python2.5/site-packages/Trac-0.11.7rc1_r9277-py2.5.egg/trac/web/chrome.py", line 838, in _strip_accesskeys
    for kind, data, pos in stream:
  File "build/bdist.linux-x86_64/egg/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/usr/local/virtualenv/0.11-stable/lib/python2.5/site-packages/Trac-0.11.7rc1_r9277-py2.5.egg/trac/web/chrome.py", line 827, in _generate
    for kind, data, pos in stream:
  File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 592, in _include
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 381, in _match
    ctxt, start=idx + 1, **vars):
  File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 381, in _match
    ctxt, start=idx + 1, **vars):
  File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 381, in _match
    ctxt, start=idx + 1, **vars):
  File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 330, in _match
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 532, in _flatten
    for kind, data, pos in stream:
  File "build/bdist.linux-x86_64/egg/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/path.py", line 588, in _generate
    subevent = next()
  File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 592, in _include
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 330, in _match
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 319, in _strip
    event = next()
  File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 532, in _flatten
    for kind, data, pos in stream:
  File "build/bdist.linux-x86_64/egg/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/path.py", line 588, in _generate
    subevent = next()
  File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 592, in _include
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 319, in _strip
    event = next()
  File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 532, in _flatten
    for kind, data, pos in stream:
  File "build/bdist.linux-x86_64/egg/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/path.py", line 588, in _generate
    subevent = next()
  File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 592, in _include
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 319, in _strip
    event = next()
  File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 552, in _flatten
    result = _eval_expr(data, ctxt, vars)
  File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 277, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "build/bdist.linux-x86_64/egg/genshi/template/eval.py", line 178, in evaluate
    return eval(self.code, _globals, {'__data__': data})
  File "/usr/local/virtualenv/0.11-stable/lib/python2.5/site-packages/Trac-0.11.7rc1_r9277-py2.5.egg/trac/versioncontrol/templates/revisionlog.html", line 148, in <Expression u'dateinfo(change.date)'>
    <td class="date" py:content="dateinfo(change.date)" />
  File "/usr/local/virtualenv/0.11-stable/lib/python2.5/site-packages/Trac-0.11.7rc1_r9277-py2.5.egg/trac/timeline/web_ui.py", line 236, in dateinfo
    pretty_timedelta(date),
  File "/usr/local/virtualenv/0.11-stable/lib/python2.5/site-packages/Trac-0.11.7rc1_r9277-py2.5.egg/trac/util/datefmt.py", line 73, in pretty_timedelta
    time1 = to_datetime(time1)
  File "/usr/local/virtualenv/0.11-stable/lib/python2.5/site-packages/Trac-0.11.7rc1_r9277-py2.5.egg/trac/util/datefmt.py", line 53, in to_datetime
    type(t))
TypeError: expecting datetime, int, long, float, or None; got <class 'genshi.template.eval.Undefined'>

This corresponded to:

192.114.71.13 babel.edgewall.org - [09/Mar/2010:07:50:23 +0100] "GET /log/tags?rev=494 HTTP/1.1" 500 14716 "http://babel.edgewall.org/browser" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; (R1 1.1);
.NET CLR 1.1.4322)"

And can indeed be reproduced: babel:log:tags@494

comment:24 by Christian Boos, 15 years ago

Excerpt of the hdfdump:

{'changes': {1: <trac.versioncontrol.cache.CachedChangeset object at 0x2ef8810>,
             142: <trac.versioncontrol.cache.CachedChangeset object at 0x33f9f10>,
             143: <trac.versioncontrol.cache.CachedChangeset object at 0x33f9dd0>,
             198: <trac.versioncontrol.cache.CachedChangeset object at 0x33f9610>,
             199: <trac.versioncontrol.cache.CachedChangeset object at 0x33f97d0>,
             280: <trac.versioncontrol.cache.CachedChangeset object at 0x33f91d0>,
             282: {},
...

comment:25 by Christian Boos, 15 years ago

Milestone: 0.11.7
Resolution: worksforme
Status: reopenedclosed

More data:

$ svn log -r 282 -v http://svn.edgewall.org/repos/babel
------------------------------------------------------------------------
r282 | cmlenz | 2007-08-20 10:48:24 +0200 (Mon, 20 Aug 2007) | 1 line
Changed paths:
   D /tags/0.9.0/setup.cfg

Fix version number on [milestone:0.9] tag.
------------------------------------------------------------------------

But there's a No changeset 282 in the repository error when trying to access that revision.

In the database:

babel=> select * from node_change where rev='282';
 rev |         path         | node_type | change_type |      base_path       | base_rev
-----+----------------------+-----------+-------------+----------------------+----------
 282 | tags/0.9.0/setup.cfg | F         | D           | tags/0.9.0/setup.cfg | 281
(1 row)

babel=> select * from revision where rev='282';
 rev | time | author | message
-----+------+--------+---------
(0 rows)

A resync of the revision 282 didn't change this.

After a full resync:

...
2010-03-09 23:05:26,018 Trac[cache] INFO: Trying to sync revision [282]
2010-03-09 23:05:26,021 Trac[cache] DEBUG: Caching node change in [282]: (u'tags/0.9.0/setup.cfg', 'file', 'delete', u'tags/0.9.0/setup.cfg', 281)
2010-03-09 23:05:26,030 Trac[cache] INFO: Trying to sync revision [283]
...

There's now:

babel=> select * from revision where rev='282';
 rev |    time    | author |                  message
-----+------------+--------+--------------------------------------------
 282 | 1187599704 | cmlenz | Fix version number on [milestone:0.9] tag.
(1 row)

And everything now works fine…

The fact that resync 282 alone didn't do anything was to be expected, as it does an "UPDATE revision SET … WHERE rev=%s", so nothing happens if there's not already a row for the revision.

Weird, so somehow the resync "missed a beat", and the symptom of having node_changes without the corresponding revision is reminiscent of the dreaded issue #4043.

So I'm closing the ticket again, as "worksforme" this time because the exact cause of the error is far too nebulous and there's an easy way to fix the problem by doing a resync (well, if the issue would be more frequent that would be a different story, but the issue seems to be exceptional enough to be treated like that).

comment:26 by anonymous@…, 14 years ago

I've got this error. It seems like cboos has given up on it.

Please reopen.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.