Modify

Opened 12 years ago

Closed 12 years ago

#9933 closed defect (fixed)

Plugin crashes after upgrade

Reported by: krojew Owned by: Chris Nelson
Priority: highest Component: TracJsGanttPlugin
Severity: critical Keywords:
Cc: Trac Release: 0.12

Description

After upgrading from 0.9, the plugin crashes with info:

2012-03-30 14:11:16,543 Trac[tracpm] DEBUG: Creating a simple calendar
2012-03-30 14:11:16,570 Trac[tracpm] ERROR: Not all tickets scheduled
2012-03-30 14:11:16,572 Trac[formatter] ERROR: Macro TracJSGanttChart(milestone=alpha1) failed: 
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/formatter.py", line 717, in _macro_formatter
    return macro.process(args, in_paragraph=True)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/formatter.py", line 304, in process
    text = self.processor(text)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/formatter.py", line 291, in _macro_processor
    text)
  File "/usr/local/lib/python2.6/dist-packages/Trac_jsGantt-0.10_r11429-py2.6.egg/tracjsgantt/tracjsgantt.py", line 659, in expand_macro
    tasks = self._add_tasks(options)
  File "/usr/local/lib/python2.6/dist-packages/Trac_jsGantt-0.10_r11429-py2.6.egg/tracjsgantt/tracjsgantt.py", line 566, in _add_tasks
    self.pm.computeSchedule(options, self.tickets)
  File "/usr/local/lib/python2.6/dist-packages/Trac_jsGantt-0.10_r11429-py2.6.egg/tracjsgantt/tracpm.py", line 764, in computeSchedule
    t[field] = ticketsByID[t['id']][field]
KeyError: 'calc_start'

Attachments (0)

Change History (12)

comment:1 Changed 12 years ago by anonymous

Owner: changed from Chris Nelson to anonymous
Status: newassigned

Can you please post the TracPM and Trac-jsgantt sections of your trac.ini?

comment:2 Changed 12 years ago by Chris Nelson

Owner: changed from anonymous to Chris Nelson
Status: assignednew

comment:3 Changed 12 years ago by krojew

[trac-jsgantt]
option.datedisplay = dd/mm/yyyy
option.hoursperday = 4.0
option.omitmilestones = 1
option.schedule = alap

[TracPM]
date_format = %Y-%m-%d
days_per_estimate = 0.125
default_estimate = 4.0
estimate_pad = 0.0
fields.estimate = estimatedhours
fields.finish = userfinish
fields.parent = parent
fields.percent = complete
fields.pred = blockedby
fields.start = userstart
fields.succ = blocking
hours_per_estimate = 1
parent_format = #%s

comment:4 Changed 12 years ago by Chris Nelson

(In [11440]) Handle tickets ineligible for scheduling. Refs #9933.

Rather than give up when some tickets weren't eligible for scheduling, log an error but schedule the remaining tickets.

comment:5 Changed 12 years ago by Chris Nelson

This update will log the IDs of tickets that didn't come eligible for scheduling then go ahead and schedule them. That should prevent the crash but I'd be interested in what's different in those tickets that they don't become eligible.

comment:6 Changed 12 years ago by Chris Nelson

Status: newassigned

comment:7 Changed 12 years ago by krojew

Well, it didn't log them:

ERROR: [43] remain ineligible. Scheduling. 2012-03-30 15:01:33,583 Trac[formatter] ERROR: Macro TracJSGanttChart(milestone=alpha1) failed:

I found that switching from alap to asap seems to help.

comment:8 in reply to:  7 Changed 12 years ago by Chris Nelson

Replying to krojew:

Well, it didn't log them:

ERROR: [43] remain ineligible. Scheduling. 2012-03-30 15:01:33,583 Trac[formatter] ERROR: Macro TracJSGanttChart(milestone=alpha1) failed:

Ah, but it did: 43 is the ID of the ticket that wasn't scheduled. What's different about it?

But my fall-back appears to have been weak (I don't trigger that clause here). Can you send me the trac.log around the error you quoted above?

I found that switching from alap to asap seems to help.

Interesting.

comment:9 Changed 12 years ago by krojew

2012-03-30 15:08:14,156 Trac[formatter] DEBUG: Executing Wiki macro TracJSGanttChart by provider <tracjsgantt.tracjsgantt.TracJSGanttChart object at 0x7fcaab674b10>
2012-03-30 15:08:14,164 Trac[query] DEBUG: Count results in Query: 142
2012-03-30 15:08:14,165 Trac[query] DEBUG: Query SQL: SELECT t.id AS id,t.description AS description,t.owner AS owner,t.type AS type,t.status AS status,t.summary AS summary,t.mil$
FROM ticket AS t
  LEFT OUTER JOIN ticket_custom AS `userfinish` ON (id=`userfinish`.ticket AND `userfinish`.name='userfinish')
  LEFT OUTER JOIN ticket_custom AS `parent` ON (id=`parent`.ticket AND `parent`.name='parent')
  LEFT OUTER JOIN ticket_custom AS `blockedby` ON (id=`blockedby`.ticket AND `blockedby`.name='blockedby')
  LEFT OUTER JOIN ticket_custom AS `complete` ON (id=`complete`.ticket AND `complete`.name='complete')
  LEFT OUTER JOIN ticket_custom AS `userstart` ON (id=`userstart`.ticket AND `userstart`.name='userstart')
  LEFT OUTER JOIN ticket_custom AS `blocking` ON (id=`blocking`.ticket AND `blocking`.name='blocking')
  LEFT OUTER JOIN ticket_custom AS `estimatedhours` ON (id=`estimatedhours`.ticket AND `estimatedhours`.name='estimatedhours')
  LEFT OUTER JOIN enum AS priority ON (priority.type='priority' AND priority.name=priority)
WHERE ((COALESCE(t.milestone,'')=u'alpha1'))
ORDER BY COALESCE(priority.value,'')='',CAST(priority.value AS integer),t.id
2012-03-30 15:08:14,200 Trac[tracpm] DEBUG: Creating a simple calendar
2012-03-30 15:08:14,227 Trac[tracpm] ERROR: Not all tickets scheduled
2012-03-30 15:08:14,228 Trac[tracpm] ERROR: [43] remain ineligible.  Scheduling.
2012-03-30 15:08:14,229 Trac[formatter] ERROR: Macro TracJSGanttChart(milestone=alpha1) failed:
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/formatter.py", line 717, in _macro_formatter
    return macro.process(args, in_paragraph=True)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/formatter.py", line 304, in process
    text = self.processor(text)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/formatter.py", line 291, in _macro_processor
    text)
  File "/usr/local/lib/python2.6/dist-packages/Trac_jsGantt-0.10_r11440-py2.6.egg/tracjsgantt/tracjsgantt.py", line 659, in expand_macro
    tasks = self._add_tasks(options)
  File "/usr/local/lib/python2.6/dist-packages/Trac_jsGantt-0.10_r11440-py2.6.egg/tracjsgantt/tracjsgantt.py", line 566, in _add_tasks
    self.pm.computeSchedule(options, self.tickets)
  File "/usr/local/lib/python2.6/dist-packages/Trac_jsGantt-0.10_r11440-py2.6.egg/tracjsgantt/tracpm.py", line 764, in computeSchedule
    t[field] = ticketsByID[t['id']][field]
KeyError: 'calc_start'
2012-03-30 15:08:14,479 Trac[main] DEBUG: Dispatching <Request "GET '/chrome/common/css/wiki.css'">
2012-03-30 15:08:14,479 Trac[main] DEBUG: Dispatching <Request "GET '/chrome/tracjsgantt/jsgantt.css'">

I think I found the cause - that ticket has it's blocked by field set to itself. What's strange - I can't remove that dependency.

comment:10 Changed 12 years ago by krojew

After fixing the ticket, it turned out that the dependency wasn't the problem. I find nothing suspicious about it now.

comment:11 Changed 12 years ago by Chris Nelson

(In [11441]) Forgot to actually schedule the remaining tickets. Refs #9933.

comment:12 Changed 12 years ago by anonymous

Resolution: fixed
Status: assignedclosed

Seems to be working now. Thanks.

Modify Ticket

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