#12292 closed defect (fixed)
AssertionError: Page 5 out of range
Reported by: | Ryan J Ollos | Owned by: | Steffen Hoffmann |
---|---|---|---|
Priority: | normal | Component: | TagsPlugin |
Severity: | normal | Keywords: | |
Cc: | dairiki@… | Trac Release: |
Description
Running version 7.0 of TagsPlugin, I've seen the following error in the logs:
2015-04-23 06:38:00,205 Trac[formatter] ERROR: Macro ListTagged(plugin citytrac) failed: Traceback (most recent call last): File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.5-py2.6.egg/trac/wiki/formatter.py", line 788, in _macro_formatter return macro.ensure_inline(macro.process(args)) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.5-py2.6.egg/trac/wiki/formatter.py", line 358, in process text = self.processor(text) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.5-py2.6.egg/trac/wiki/formatter.py", line 342, in _macro_processor text, self.args) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracTags-0.7_r13816-py2.6.egg/tractags/macros.py", line 248, in expand_macro results = self._paginate(req, results, realms) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracTags-0.7_r13816-py2.6.egg/tractags/macros.py", line 380, in _paginate result = Paginator(results, current_page - 1, items_per_page) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.5-py2.6.egg/trac/util/presentation.py", line 205, in __init__ items, num_items, num_pages = paginate(items, page, max_per_page) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.5-py2.6.egg/trac/util/presentation.py", line 176, in paginate assert start < count, 'Page %d out of range' % page AssertionError: Page 5 out of range
It might be triggered from the CityTrac page.
Here's another instance:
2015-04-23 10:36:06,115 Trac[formatter] ERROR: Macro ListTagged(user, format=list, realm=wiki) failed:Traceback (most recent call last): File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.5-py2.6.egg/trac/wiki/formatter.py", line 788, in _macro_formatter return macro.ensure_inline(macro.process(args)) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.5-py2.6.egg/trac/wiki/formatter.py", line 358, in process text = self.processor(text) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.5-py2.6.egg/trac/wiki/formatter.py", line 342, in _macro_processor text, self.args) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracTags-0.7_r13816-py2.6.egg/tractags/macros.py", line 248, in expand_macro results = self._paginate(req, results, realms) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracTags-0.7_r13816-py2.6.egg/tractags/macros.py", line 380, in _paginate result = Paginator(results, current_page - 1, items_per_page) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.5-py2.6.egg/trac/util/presentation.py", line 205, in __init__ items, num_items, num_pages = paginate(items, page, max_per_page) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.5-py2.6.egg/trac/util/presentation.py", line 176, in paginate assert start < count, 'Page %d out of range' % page AssertionError: Page 28 out of range
Attachments (1)
Change History (13)
comment:1 Changed 10 years ago by
comment:2 follow-up: 3 Changed 10 years ago by
I've been meaning to take a look as well. I usually see several instances of the error in the log every day, so it is by no means a rare event on the trac-hacks.org server.
comment:3 Changed 10 years ago by
Replying to rjollos:
... , so it is by no means a rare event on the trac-hacks.org server.
Would be great to have it fixed than. I've been looking through currently open tickets after a recent comment of yours, and it seems like there is nothing else preventing next formal plugin release.
comment:4 follow-up: 9 Changed 10 years ago by
Running a tail
on the server logs, I can reproduce by navigating to /CityTrac?listtagged_page=10
: tagsplugin/tags/0.7/tractags/macros.py@:376-377#L374.
comment:5 Changed 10 years ago by
So I see two possible action items:
- Trap the
AssertionError
in TagsPlugin and perform some default action such as displaying page 1. - In a future version of Trac, change the
assert
to raising aTracError
: browser:/tags/trac-1.0.6/trac/util/presentation.py@:176#L167 (trac:#12004).
Changed 9 years ago by
Attachment: | t12292.diff added |
---|
comment:6 Changed 9 years ago by
Proposed patch in attachment:t12292.diff. TracError
is trapped in addition to AssertionError
, to account for changes that will likely be made in trac:#12004.
I'll deploy on trac-hacks.org for testing whether errors are seen in the logs.
comment:7 Changed 9 years ago by
Cc: | dairiki@… added |
---|
comment:8 Changed 9 years ago by
I've found no problems running the patch on trac-hacks.org. Does it look okay to commit?
comment:9 Changed 9 years ago by
Replying to rjollos:
Running a
tail
on the server logs, I can reproduce by navigating to/CityTrac?listtagged_page=10
: tagsplugin/tags/0.7/tractags/macros.py@:376-377#L374.
I see. Looking at that page before I didn't think of rather malicious requests. Handling user input more gracefully is certainly ok.
I'm still clueless about this issue, but I'll likely need to run it through a debugger to see something.