Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#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)

t12292.diff (5.4 KB) - added by Ryan J Ollos 9 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 9 years ago by Steffen Hoffmann

I'm still clueless about this issue, but I'll likely need to run it through a debugger to see something.

comment:2 Changed 9 years ago by Ryan J Ollos

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 in reply to:  2 Changed 9 years ago by Steffen Hoffmann

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 Changed 9 years ago by Ryan J Ollos

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 9 years ago by Ryan J Ollos

So I see two possible action items:

Changed 9 years ago by Ryan J Ollos

Attachment: t12292.diff added

comment:6 Changed 9 years ago by Ryan J Ollos

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.

Last edited 9 years ago by Ryan J Ollos (previous) (diff)

comment:7 Changed 9 years ago by Jeff Dairiki

Cc: dairiki@… added

comment:8 Changed 9 years ago by Ryan J Ollos

I've found no problems running the patch on trac-hacks.org. Does it look okay to commit?

comment:9 in reply to:  4 Changed 9 years ago by Steffen Hoffmann

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.

comment:10 Changed 9 years ago by Steffen Hoffmann

In 14785:

TagsPlugin: Catch inappropriate macro arguments for ListTagged, refs #12292.

Thanks for the patch including unit tests by Ryan J. Ollos, applied here
with minor modifications.

comment:11 Changed 9 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

In 14945:

0.8: Tag 0.8 release

Fixes #1304, #1344, #3660, #3891, #9064, #9797, #11661, #11690, #11695, #11888, #11950, #11954, #11968, #12202, #12292, #12434, #12486.

Refs #12415.

comment:12 Changed 9 years ago by Ryan J Ollos

In 15050:

0.9dev: Document changes in trac:#12004

Refs #12292.

Modify Ticket

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