Modify

Opened 15 years ago

Closed 15 years ago

#4257 closed defect (fixed)

UndefinedError: {'title': u'Screenshots'} has no member named "screenshot"

Reported by: Oliver Metz Owned by: Radek Bartoň
Priority: normal Component: ScreenshotsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Hi. I sometimes get this error message in my trac log (Trac 0.11stable-r7723). Content is served through lighttpd+fcgi.

2008-12-11 16:34:26,846 Trac[main] ERROR: {'title': u'Screenshots'} has no member named "screenshot"
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/Trac-0.11stable_r7723-py2.5.egg/trac/web/main.py", line 432, in _dispatch_request
    dispatcher.dispatch(req)
...
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/base.py", line 286, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/eval.py", line 180, in evaluate
    return eval(self.code, _globals, {'__data__': data})
  File "/var/www/.python-eggs/TracScreenshots-0.7-py2.5.egg-tmp/tracscreenshots/templates/screenshot.html", line 11, in <Expression u'screenshots.screenshot.file'>
    <h1>${screenshots.screenshot.file}</h1>
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/eval.py", line 313, in lookup_attr
    val = getattr(obj, key)
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/eval.py", line 279, in _die
    raise UndefinedError(self._name, self._owner)
UndefinedError: {'title': u'Screenshots'} has no member named "screenshot"
[11/Dec/2008:16:34:23 +0100] "GET /screenshots?index=12 HTTP/1.0" 200 15149
[11/Dec/2008:16:34:24 +0100] "GET /wikicss.css HTTP/1.0" 200 2502
[11/Dec/2008:16:34:25 +0100] "GET /screenshots/31?width=160&height=38&format=raw HTTP/1.0" 200 1701
[11/Dec/2008:16:34:25 +0100] "GET /screenshots/37?width=77&height=120&format=raw HTTP/1.0" 200 6720
[11/Dec/2008:16:34:25 +0100] "GET /screenshots/35?width=124&height=120&format=raw HTTP/1.0" 200 6357
[11/Dec/2008:16:34:26 +0100] "GET /screenshots/32?width=160&height=59&format=raw HTTP/1.0" 200 1901
[11/Dec/2008:16:34:26 +0100] "GET /screenshots/34?width=160&height=89&format=raw HTTP/1.0" 200 2598
[11/Dec/2008:16:34:26 +0100] "GET /screenshots/39?width=69&height=120&format=raw HTTP/1.0" 200 3618
[11/Dec/2008:16:34:26 +0100] "GET /screenshots/36?width=126&height=120&format=raw HTTP/1.0" 200 14393
[11/Dec/2008:16:34:27 +0100] "GET /screenshots/38?width=160&height=102&format=raw HTTP/1.0" 200 9374
[11/Dec/2008:16:34:27 +0100] "GET /screenshots/41?width=137&height=120&format=raw HTTP/1.0" 200 5046
[11/Dec/2008:16:34:27 +0100] "GET /screenshots/40?width=160&height=111&format=raw HTTP/1.0" 200 5447

Attachments (0)

Change History (7)

comment:1 Changed 15 years ago by Radek Bartoň

Status: newassigned

Thanks, I'll try to check it during weekend but knowing exact case when this happen would be better.

comment:2 Changed 15 years ago by Oliver Metz

What information do you need?

comment:3 Changed 15 years ago by Radek Bartoň

According to logs I assume that this happend during one of the

[11/Dec/2008:16:34:26 +0100] "GET /screenshots/32?width=160&height=59&format=raw HTTP/1.0" 200 1901
[11/Dec/2008:16:34:26 +0100] "GET /screenshots/34?width=160&height=89&format=raw HTTP/1.0" 200 2598
[11/Dec/2008:16:34:26 +0100] "GET /screenshots/39?width=69&height=120&format=raw HTTP/1.0" 200 3618
[11/Dec/2008:16:34:26 +0100] "GET /screenshots/36?width=126&height=120&format=raw HTTP/1.0" 200 14393

requests. Is that true? Are all screenshots with those IDs existing and properly uploaded? Also debug log from the event may tell me more. For info how to collect debug log read for example TracLogging. Thank you.

comment:4 Changed 15 years ago by Oliver Metz

I got another similar error:

2008-12-11 21:01:03,608 Trac[main] ERROR: unsupported operand type(s) for -: 'Undefined' and 'int'
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/Trac-0.11stable_r7723-py2.5.egg/trac/web/main.py", line 432, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.5/site-packages/Trac-0.11stable_r7723-py2.5.egg/trac/web/main.py", line 226, in dispatch
    data, content_type)
  File "/usr/lib/python2.5/site-packages/Trac-0.11stable_r7723-py2.5.egg/trac/web/chrome.py", line 725, in render_template
    output = stream.render(method, doctype=doctype)
...
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/eval.py", line 180, in evaluate
    return eval(self.code, _globals, {'__data__': data})
  File "/var/www/.python-eggs/TracScreenshots-0.7-py2.5.egg-tmp/tracscreenshots/templates/screenshots-matrix-view.html", line 94, in <Expression u'screenshots.screenshot_count - 1'>
    <a href="${href.screenshots()}?index=${screenshots.screenshot_count - 1}">Last Page</a>
TypeError: unsupported operand type(s) for -: 'Undefined' and 'int'
[11/Dec/2008:21:01:01 +0100] "GET /screenshots?index=24 HTTP/1.1" 200 15220
[11/Dec/2008:21:01:02 +0100] "GET /wikicss.css HTTP/1.1" 200 2502
[11/Dec/2008:21:01:02 +0100] "GET /chrome/site/style.css HTTP/1.1" 404 345
[11/Dec/2008:21:01:02 +0100] "GET /screenshots/48?width=126&height=120&format=raw HTTP/1.1" 200 3219
[11/Dec/2008:21:01:02 +0100] "GET /screenshots/47?width=160&height=64&format=raw HTTP/1.1" 200 4128
[11/Dec/2008:21:01:02 +0100] "GET /screenshots/46?width=160&height=53&format=raw HTTP/1.1" 200 3203
[11/Dec/2008:21:01:02 +0100] "GET /screenshots/45?width=160&height=61&format=raw HTTP/1.1" 200 3419
[11/Dec/2008:21:01:03 +0100] "GET /screenshots/49?width=160&height=120&format=raw HTTP/1.1" 200 3895
[11/Dec/2008:21:01:03 +0100] "GET /screenshots/44?width=160&height=101&format=raw HTTP/1.1" 200 5098
[11/Dec/2008:21:01:03 +0100] "GET /screenshots/52?width=160&height=92&format=raw HTTP/1.1" 200 22134
[11/Dec/2008:21:01:03 +0100] "GET /screenshots/55?width=160&height=101&format=raw HTTP/1.1" 200 1849
[11/Dec/2008:21:01:03 +0100] "GET /screenshots/53?width=134&height=120&format=raw HTTP/1.1" 200 17905
[11/Dec/2008:21:01:03 +0100] "GET /screenshots/56?width=160&height=37&format=raw HTTP/1.1" 200 4468
[11/Dec/2008:21:01:03 +0100] "GET /screenshots/54?width=103&height=120&format=raw HTTP/1.1" 200 9729
[11/Dec/2008:21:01:04 +0100] "GET /screenshots/57?width=160&height=37&format=raw HTTP/1.1" 200 4407
[11/Dec/2008:21:01:04 +0100] "GET /screenshots HTTP/1.1" 500 5958
[11/Dec/2008:21:01:04 +0100] "GET /chrome/screenshots/css/matrix-view.css HTTP/1.1" 200 1293
[11/Dec/2008:21:01:04 +0100] "GET /chrome/screenshots/css/screenshots.css HTTP/1.1" 200 1706
[11/Dec/2008:21:01:04 +0100] "GET /chrome/screenshots/js/screenshots.js HTTP/1.1" 200 643

I will try if I can replay this situations and check the ids.

comment:5 Changed 15 years ago by Oliver Metz

I can reproduce the last error when launching Apache Bench with concurrent requests. But I can't see any more usefull information when changing from WARNING to DEBUG log level.

2008-12-11 21:54:25,910 Trac[perm] DEBUG: No policy allowed anonymous performing WIKI_ADMIN on <Resource 'wiki'>
2008-12-11 21:54:25,909 Trac[matrix_view] DEBUG: index: -1
2008-12-11 21:54:25,912 Trac[matrix_view] DEBUG: page: -1
2008-12-11 21:54:25,912 Trac[matrix_view] DEBUG: index: 0
2008-12-11 21:54:25,912 Trac[matrix_view] DEBUG: page: 1
2008-12-11 21:54:25,911 Trac[authz_policy] DEBUG: Checking TIMELINE_VIEW on.
2008-12-11 21:54:25,917 Trac[authz_policy] DEBUG: Checking EMAIL_VIEW on.
2008-12-11 21:54:25,917 Trac[perm] DEBUG: No policy allowed anonymous performing EMAIL_VIEW on None
2008-12-11 21:54:25,906 Trac[authz_policy] DEBUG: Checking TICKET_VIEW on.
2008-12-11 21:54:25,907 Trac[authz_policy] DEBUG: Checking TICKET_VIEW on.
2008-12-11 21:54:25,919 Trac[authz_policy] DEBUG: Checking ROADMAP_VIEW on.
2008-12-11 21:54:25,992 Trac[authz_policy] DEBUG: Checking WIKI_VIEW on wiki:*@*
2008-12-11 21:54:25,993 Trac[authz_policy] DEBUG: Checking SEARCH_VIEW on.
2008-12-11 21:54:25,994 Trac[authz_policy] DEBUG: Checking REPORT_VIEW on.
2008-12-11 21:54:25,991 Trac[main] ERROR: unsupported operand type(s) for -: 'Undefined' and 'int'
Traceback (most recent call last):

So I suggest this happens when more users are browsing through the screenshots matrix!?

comment:6 Changed 15 years ago by Radek Bartoň

r5002 should fix that. Please check if I did not broke something.

comment:7 Changed 15 years ago by Oliver Metz

Resolution: fixed
Status: assignedclosed

Thanks for your very fast response.

No more errors in Trac log. New permissions seem to work also.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Radek Bartoň.
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.