Modify

Opened 6 years ago

Closed 4 years ago

#4111 closed defect (worksforme)

IndexError: list index out of range error caused by TracHours

Reported by: denis@… Owned by: rjollos
Priority: high Component: TracHoursPlugin
Severity: blocker Keywords: trachours
Cc: k0s Trac Release: 0.11

Description (last modified by rjollos)

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/main.py", 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 []
       427.  
       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/main.py'
      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/main.py", 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:
       222. req.session.save()
       223.  
       224. req.send(output, content_type or 'text/html')
      Local variables:
      Name	Value
      chosen_handler 	<trac.ticket.web_ui.TicketModule object at 0x9ffa72c>
      chrome 	<trac.web.chrome.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/chrome.py", line 690, in render_template
      Code fragment:
       685.  
       686. stream = template.generate(**data)
       687.  
       688. # Filter through ITemplateStreamFilter plugins
       689. if self.stream_filters:
       690. stream |= self._filter_stream(req, method, filename, stream, data)
       691.  
       692. if fragment:
       693. return stream
       694.  
       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 	<trac.web.chrome.Chrome 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/core.py", 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/chrome.py", line 789, in inner
      Code fragment:
       784.  
       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
       792.  
      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 	<trac.web.chrome.Chrome object at 0x9ffa12c>
      stream 	<genshi.core.Stream object at 0x9f9490c>
    * File "/usr/lib/python2.5/site-packages/TracHoursPlugin-0.1-py2.5.egg/trachours/hours.py", line 235, in filter_stream
      Code fragment:
       230. 'roadmap.html': self.filter_roadmap,
       231. }
       232.  
       233. handler = handlers.get(filename)
       234. if handler is not None:
       235. stream = handler(req, stream, data)
       236.  
       237. return stream
       238.  
       239.  
       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/hours.py", line 995, in filter_ticket 

Attachments (0)

Change History (7)

comment:1 Changed 6 years ago by bobbysmith007

(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 6 years ago by bobbysmith007

  • Resolution set to fixed
  • Status changed from new to closed

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 http://trac.openplans.org/hours/newticket

Thanks,

Russ

comment:3 Changed 4 years ago by anonymous

  • Component changed from TimingAndEstimationPlugin to TracHoursPlugin
  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Trac Release changed from 0.10 to 0.11

comment:4 Changed 4 years ago by anonymous

same error

comment:5 Changed 4 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 4 years ago by rjollos

  • Description modified (diff)
  • Owner changed from novalis to rjollos
  • Status changed from reopened to new

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 4 years ago by rjollos

  • Resolution set to worksforme
  • Status changed from new to closed

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.