Opened 9 years ago

Last modified 9 years ago

defect #65 (closed: DONE)

Roadmap error of "list index out of range"

Test Complete Size: 1 Test Complete Date: 11/05/2008
Documentation Complete Size: 0 Documentation Complete Date:
Acceptance Complete Size: 1 Acceptance Complete Date: 11/05/2008
Reported by: augustinus Owned by: ja11sop
Milestone: Clean up of Plugin with Patch Component: completion stages
Version: Keywords:
Cc: Blocked By:
Blocking: Patch SVN Revision:
Patch Trac Version:
In Iterations: 13

Description

It's hard to determine which ticket or milestone caused this problem, since my trac worked with agile-trac plugin for 3 days, and this morning it was suddenly broken.

Do you have any clue to help me debug with this?

Thank you!

File "/usr/local/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/main.py", line 423, in _dispatch_request
  dispatcher.dispatch(req)
File "/usr/local/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/main.py", line 197, in dispatch
  resp = chosen_handler.process_request(req)
File "/usr/local/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/roadmap.py", line 1024, in process_request
  return self._render_view(req, db, milestone)
File "/usr/local/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/roadmap.py", line 1192, in _render_view
  stat = get_ticket_stats(self.stats_provider, tickets, milestone_sizing_stats, None)
File "/usr/local/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/roadmap.py", line 302, in get_ticket_stats
  return provider.get_ticket_group_stats([t['id'] for t in tickets], milestone_sizing_stats, end_date)
File "/usr/local/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/roadmap.py", line 297, in get_ticket_group_stats
  stat.refresh_calcs()
File "/usr/local/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/roadmap.py", line 147, in refresh_calcs
  if (i['overall_completion'] and i['percent'] > 0) ][0]

Change History

Have a look at the list of modified files related to this ticket.

Changed 9 years ago by ja11sop

  • test_complete_size changed from undefined to 1
  • doc_complete_size changed from undefined to 0
  • acceptance_complete_size changed from undefined to 1

Ok, this is a logic error which I've been able to re-create:

Python Traceback Most recent call last:

  • File "/usr/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/main.py", line 423, in _dispatch_request Code fragment:
    1. try:
    2. if not env and env_error:
    3. raise HTTPInternalError(env_error)
    4. try:
    5. dispatcher = RequestDispatcher?(env)
    6. dispatcher.dispatch(req)
    7. except RequestDone?:
    8. pass
    9. resp = req._response or []
    10. 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 0xa498b0c> e IndexError?('list index out of range',) env <trac.env.Environment object at 0xa3af2ec> env_error None exc_info (<type 'exceptions.IndexError?'>, IndexError?('list index out of range',), ... filename '/usr/lib/python2.5/site-packages/Trac-0.11.1-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'/roadmap'"> resp [] tb <traceback object at 0xa7cb52c> tb_hide None traceback 'Traceback (most recent call last):\n File ...
  • File "/usr/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/main.py", line 197, in dispatch Code fragment:
    1. req.args.get('FORM_TOKEN') != req.form_token:
    2. raise HTTPBadRequest('Missing or invalid form token. '
    3. 'Do you have cookies enabled?')
    4. # Process the request and render the template
    5. resp = chosen_handler.process_request(req)
    6. if resp:
    7. if len(resp) == 2: # Clearsilver
    8. chrome.populate_hdf(req)
    9. template, content_type = \
    10. self._post_process_request(req, *resp)
  • Local variables: Name Value chosen_handler <trac.ticket.roadmap.RoadmapModule? object at 0xa4447ac> chrome <trac.web.chrome.Chrome object at 0xa498b6c> err (<type 'exceptions.IndexError?'>, IndexError?('list index out of range',), ... handler <trac.ticket.roadmap.RoadmapModule? object at 0xa4447ac> req <Request "GET u'/roadmap'"> self <trac.web.main.RequestDispatcher? object at 0xa498b0c>
  • File "/usr/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/roadmap.py", line 761, in process_request Code fragment:
    1. for milestone in milestones:
    2. tickets = get_tickets_for_milestone(self.env, db, milestone.name,
    3. 'owner')
    4. tickets = TicketSystem?(self.env).apply_ticket_permissions(req, tickets)
    5. milestone_sizing_stats = TicketSystem?(self.env).get_sizing_statistics_for_milestones([milestone.name])
    6. stat = get_ticket_stats(self.stats_provider, tickets, milestone_sizing_stats, None)
    7. stats.append(milestone_stats_data(req, stat, milestone.name))
    8. ticket_info = TicketSystem?(self.env).get_ticket_info( tickets, milestone_sizing_stats, now.date() ) 765.
    9. expected_durations = get_outstanding_milestone_duration(ticket_info, points_per_period)
  • Local variables: Name Value db <trac.db.pool.PooledConnection? object at 0xa5dd56c> earliest_completion_date datetime.datetime(2008, 11, 5, 1, 44, 5, 18824, tzinfo=<FixedOffset? "UTC" ... expected_completion_dates [{'earliest_completion_date': datetime.datetime(2008, 11, 5, 1, 44, 5, ... expected_durations {'time_remaining': datetime.timedelta(0), 'maximum_time_to_completion': ... latest_completion_date datetime.datetime(2008, 11, 5, 1, 44, 5, 18824, tzinfo=<FixedOffset? "UTC" ... m <trac.ticket.model.Milestone object at 0xa5dd5cc> milestone <trac.ticket.model.Milestone object at 0xa5dd60c> milestone_realm <Resource 'milestone'> milestone_sizing_stats {'acceptance_complete': {'min_size': 0, 'average_defined_size': 0, ... milestones [<trac.ticket.model.Milestone object at 0xa444bec>, ... now datetime.datetime(2008, 11, 5, 1, 44, 5, 18824, tzinfo=<FixedOffset? "UTC" ... points_per_period {'points': 0, 'period': datetime.timedelta(14)} queries [] req <Request "GET u'/roadmap'"> rolling_date datetime.datetime(2008, 11, 5, 1, 44, 5, 18824, tzinfo=<FixedOffset? "UTC" ... self <trac.ticket.roadmap.RoadmapModule? object at 0xa4447ac> showall False stat <trac.ticket.roadmap.TicketGroupStats? object at 0xa7b01cc> stats [{'stats_href': ... ticket_info {'done_size': 1, 'total_relative_size': 21, 'tickets_with_stages': {'33': ... ticket_infos [{'done_size': 151, 'total_relative_size': 151, 'tickets_with_stages': ... tickets [<trac.ticket.model.Ticket object at 0xa7bb42c>, <trac.ticket.model.Ticket ...
  • File "/usr/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/roadmap.py", line 307, in get_ticket_stats Code fragment:
    1. stat.refresh_calcs()
    2. return stat
    3. def get_ticket_stats(provider, tickets, milestone_sizing_stats, end_date):
    4. return provider.get_ticket_group_stats([tid? for t in tickets], milestone_sizing_stats, end_date)
    5. def get_tickets_for_milestone(env, db, milestone, field='component'):
    6. from trac.ticket import Ticket
    7. tickets = []
    8. cursor = db.cursor()
  • Local variables: Name Value end_date None milestone_sizing_stats {'acceptance_complete': {'min_size': 0, 'average_defined_size': 0, ... provider <trac.ticket.roadmap.DefaultTicketGroupStatsProvider? object at 0xa5fa8ec> t <trac.ticket.model.Ticket object at 0xa7bbd8c> tickets [<trac.ticket.model.Ticket object at 0xa7bb42c>, <trac.ticket.model.Ticket ...
  • File "/usr/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/roadmap.py", line 302, in get_ticket_group_stats Code fragment:
    1. query_args[k] = v
    2. title = group.has_key('title') and grouptitle? or groupname?
    3. stat.add_interval(title, group_count, group_size, query_args,
    4. group.get('css_class', groupname?),
    5. bool(group.get('overall_completion')))
    6. stat.refresh_calcs()
    7. return stat
    8. def get_ticket_stats(provider, tickets, milestone_sizing_stats, end_date):
    9. return provider.get_ticket_group_stats([tid? for t in tickets], milestone_sizing_stats, end_date)
  • Local variables: Name Value a u'resolution' all_statuses set([u, u'sized', u'partially_sized', u'reopened', u'assigned', ... arg u'group=resolution' catch_all_group {'status': u'*', 'name': 'unsized', 'title': u'Unsized', 'css_class': ... count 0 cursor <trac.db.util.IterableCursor? object at 0xa7a3fec> end_date None group {'status': u'*', 'name': 'unsized', 'title': u'Unsized', 'css_class': ... group_count 0 group_size 0 group_statuses set([u'partially_sized']) groups [{'status': u'closed', 'name': 'closed', 'title': u'DONE', 'query_args': ... id 42 k u'group' kv milestone_sizing_stats {'acceptance_complete': {'min_size': 0, 'average_defined_size': 0, ... query_args {'status': [u, u'assigned', u'reopened', u'new', u'accepted']} remaining_statuses set([u, u'assigned', u'reopened', u'new', u'accepted']) s u'accepted' self <trac.ticket.roadmap.DefaultTicketGroupStatsProvider? object at 0xa5fa8ec> stages {'11': {u'acceptance_complete': {'date': None, 'size_defined': True, ... stat <trac.ticket.roadmap.TicketGroupStats? object at 0xa7b008c> status u'sized' status_count {u: 0, u'assigned': 0, u'partially_sized': 0, u'reopened': 0, u'sized': ... status_size {u: 0, u'assigned': 0, u'partially_sized': 0, u'reopened': 0, u'sized': ... status_str u'*' str_ids ['11', '12', '15', '38', '40', '41', '42'] sum_of_sizes 0 ticket_id '42' ticket_ids ['11', '12', '15', '38', '40', '41', '42'] title u'Unsized' total_size 42 v u'resolution' x '42'
  • File "/usr/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/roadmap.py", line 151, in refresh_calcs Code fragment:
    1. fudge_int = fudge_ints[0]
    2. #fudge_int = [i for i in self.intervals if ipercent? > 0][0]
    3. #if self.done_size:
    4. fudge_ints[:] = [i for i in fudge_ints if (ioverall_completion?) ]
    5. #if len(fudge_ints):
    6. fudge_int = fudge_ints[0]
    7. #fudge_int = [i for i in self.intervals if (ioverall_completion?) ][0] 153.
    8. fudge_amt = 100 - total_percent
    9. fudge_intpercent? += fudge_amt
    10. self.done_percent += fudge_amt
  • Local variables: Name Value fudge_int {'count': 7, 'title': u'Sized', 'css_class': u'sized', 'countsToProg': ... fudge_ints [] i {'count': 7, 'title': u'Sized', 'css_class': u'sized', 'countsToProg': ... interval {'count': 0, 'title': u'Unsized', 'css_class': u'unsized', 'countsToProg': ... interval_count 4 self <trac.ticket.roadmap.TicketGroupStats? object at 0xa7b008c> total_percent 100.0

File "/usr/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/main.py", line 423, in _dispatch_request

dispatcher.dispatch(req)

File "/usr/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/main.py", line 197, in dispatch

resp = chosen_handler.process_request(req)

File "/usr/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/roadmap.py", line 761, in process_request

stat = get_ticket_stats(self.stats_provider, tickets, milestone_sizing_stats, None)

File "/usr/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/roadmap.py", line 307, in get_ticket_stats

return provider.get_ticket_group_stats([tid? for t in tickets], milestone_sizing_stats, end_date)

File "/usr/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/roadmap.py", line 302, in get_ticket_group_stats

stat.refresh_calcs()

File "/usr/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/roadmap.py", line 151, in refresh_calcs

fudge_int = fudge_ints[0]

System Information:

User Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3pre) Gecko/2008090713 Firefox/3.0.3pre (Swiftfox) Trac: 0.11.1 Python: 2.5.2 (r252:60911, Aug 8 2008, 09:38:22) [GCC 4.3.1] setuptools: 0.6c9 SQLite: 3.5.9 pysqlite: 2.3.2 Genshi: 0.5.1 mod_python: 3.3.1 Pygments: 0.10 Subversion: 1.5.1 (r32289) jQuery: 1.2.6

Changed 9 years ago by ja11sop

  • acceptance_complete_date set to 11/05/08
  • test_complete_date set to 11/05/08

Fix in r208

Changed 9 years ago by augustinus

Wow, you guys rock agilely!

Note: See TracTickets for help on using tickets.