Opened 8 years ago

Closed 6 years ago

#4111 closed defect (worksforme)

IndexError: list index out of range error caused by TracHours

Reported by: denis@… Owned by: Ryan J Ollos
Priority: high Component: TracHoursPlugin
Severity: blocker Keywords: trachours
Cc: Jeff Hammel Trac Release: 0.11

Description (last modified by Ryan J Ollos)

If TracHours is installed on an existing Trac with tickets, it throws the following error:

 Trac detected an internal error:
 IndexError: list index out of range

Most recent call last:

    * File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/web/", line 423, in _dispatch_request
      Code fragment:
       418. try:
       419. if not env and env_error:
       420. raise HTTPInternalError(env_error)
       421. try:
       422. dispatcher = RequestDispatcher(env)
       423. dispatcher.dispatch(req)
       424. except RequestDone:
       425. pass
       426. resp = req._response or []
       428. except HTTPException, e:
      Local variables:
      Name	Value
      after 	[u' except RequestDone:', u' pass', u' resp = ...
      before 	[u' try:', u' if not env and env_error:', u' raise ...
      dispatcher 	<trac.web.main.RequestDispatcher object at 0x9ffa90c>
      e 	IndexError('list index out of range',)
      env 	<trac.env.Environment object at 0x99f338c>
      env_error 	None
      exc_info 	(<type 'exceptions.IndexError'>, IndexError('list index out of range',), ...
      filename 	'/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/web/'
      frames 	[{'function': '_dispatch_request', 'lines_before': [u' try:', u' ...
      has_admin 	True
      line 	u' dispatcher.dispatch(req)'
      lineno 	422
      message 	u'IndexError: list index out of range'
      req 	<Request "GET u'/newticket'">
      resp 	[]
      tb 	<traceback object at 0xa0227fc>
      tb_hide 	None
      traceback 	'Traceback (most recent call last):\n File ...
    * File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/web/", line 219, in dispatch
      Code fragment:
       214. out = StringIO()
       215. pprint(data, out)
       216. req.send(out.getvalue(), 'text/plain')
       217. else:
       218. output = chrome.render_template(req, template,
       219. data, content_type)
       220. # Give the session a chance to persist changes
       221. if req.session:
       224. req.send(output, content_type or 'text/html')
      Local variables:
      Name	Value
      chosen_handler 	<trac.ticket.web_ui.TicketModule object at 0x9ffa72c>
      chrome 	< object at 0x9ffa12c>
      content_type 	None
      data 	{'dateinfo': <function dateinfo at 0x9ea9bc4>, 'valid': None, 'fields': ...
      err 	(<type 'exceptions.IndexError'>, IndexError('list index out of range',), ...
      handler 	<trac.ticket.web_ui.TicketModule object at 0x9ffa72c>
      req 	<Request "GET u'/newticket'">
      resp 	('ticket.html', {'dateinfo': <function dateinfo at 0x9ea9bc4>, 'valid': ...
      self 	<trac.web.main.RequestDispatcher object at 0x9ffa90c>
      template 	'ticket.html'
    * File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/web/", line 690, in render_template
      Code fragment:
       686. stream = template.generate(**data)
       688. # Filter through ITemplateStreamFilter plugins
       689. if self.stream_filters:
       690. stream |= self._filter_stream(req, method, filename, stream, data)
       692. if fragment:
       693. return stream
       695. if method == 'text':
      Local variables:
      Name	Value
      content_type 	'text/html'
      data 	{'abs_url_of': <function get_abs_url at 0x966a994>, 'all': <built-in ...
      filename 	'ticket.html'
      fragment 	False
      method 	'xhtml'
      req 	<Request "GET u'/newticket'">
      self 	< object at 0x9ffa12c>
      stream 	<genshi.core.Stream object at 0x9f9490c>
      template 	<MarkupTemplate "ticket.html">
    * File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r895-py2.5-linux-i686.egg/genshi/", line 128, in __or__
      Local variables:
      Name	Value
      function 	<function inner at 0x9f0117c>
      self 	<genshi.core.Stream object at 0x9f9490c>
    * File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/web/", line 789, in inner
      Code fragment:
       785. def _filter_stream(self, req, method, filename, stream, data):
       786. def inner(stream, ctxt=None):
       787. for filter in self.stream_filters:
       788. stream = filter.filter_stream(req, method, filename, stream,
       789. data)
       790. return stream
       791. return inner
      Local variables:
      Name	Value
      ctxt 	None
      data 	{'abs_url_of': <function get_abs_url at 0x966a994>, 'all': <built-in ...
      filename 	'ticket.html'
      filter 	<trachours.hours.TracHoursPlugin object at 0x9ffa3ac>
      method 	'xhtml'
      req 	<Request "GET u'/newticket'">
      self 	< object at 0x9ffa12c>
      stream 	<genshi.core.Stream object at 0x9f9490c>
    * File "/usr/lib/python2.5/site-packages/TracHoursPlugin-0.1-py2.5.egg/trachours/", line 235, in filter_stream
      Code fragment:
       230. 'roadmap.html': self.filter_roadmap,
       231. }
       233. handler = handlers.get(filename)
       234. if handler is not None:
       235. stream = handler(req, stream, data)
       237. return stream
       240. ###### internal methods
      Local variables:
      Name	Value
      data 	{'abs_url_of': <function get_abs_url at 0x966a994>, 'all': <built-in ...
      filename 	'ticket.html'
      handler 	<bound method TracHoursPlugin.filter_ticket of ...
      handlers 	{'roadmap.html': <bound method TracHoursPlugin.filter_roadmap of ...
      method 	'xhtml'
      req 	<Request "GET u'/newticket'">
      self 	<trachours.hours.TracHoursPlugin object at 0x9ffa3ac>
      stream 	<genshi.core.Stream object at 0x9f9490c>
    * File "/usr/lib/python2.5/site-packages/TracHoursPlugin-0.1-py2.5.egg/trachours/", line 995, in filter_ticket 

Attachments (0)

Change History (7)

comment:1 Changed 8 years ago by Russ Tyndall

(In [4874]) re #4141 re #4111

fixed stack overflow that was caused by a change in how INavigationProvider worked. This is now using genshi filters which should allow it to work a bit better (aka no stack overflow)

comment:2 Changed 8 years ago by Russ Tyndall

Resolution: fixed
Status: newclosed

I am not sure why this ticket is on the TimingAndEstimationPlugin, since it seems to be related to the TracHoursPlugin, but I fixed an error that may or may not have anything to do with this. Please reopen this ticket at



comment:3 Changed 7 years ago by anonymous

Component: TimingAndEstimationPluginTracHoursPlugin
Resolution: fixed
Status: closedreopened
Trac Release: 0.100.11

comment:4 Changed 7 years ago by anonymous

same error

comment:5 Changed 7 years ago by christoph.pernsteiner@…

actually it helped me to add the following to ticket-custom in trac.ini:

[ticket-custom] estimatedhours = text estimatedhours.label = Estimated Hours estimatedhours.value = 0 totalhours = text totalhours.label = Total Hours totalhours.value = 0

comment:6 Changed 6 years ago by Ryan J Ollos

Description: modified (diff)
Owner: changed from novalis to Ryan J Ollos
Status: reopenednew

Can't reproduce with the TracHoursPlugin and the code is completely different now so its unlikely this is valid. Please open a new ticket if you have a similar issue.

comment:7 Changed 6 years ago by Ryan J Ollos

Resolution: worksforme
Status: newclosed

Modify Ticket

as closed The owner will remain Ryan J Ollos.
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.