Opened 14 years ago

Last modified 6 years ago

#7215 closed defect

KeyError: 'hours' — at Initial Version

Reported by: anonymous Owned by: fsbojason
Priority: high Component: TicketMilestoneDisplayMacro
Severity: critical Keywords:
Cc: Trac Release: 0.11

Description

Oops… Trac detected an internal error:

KeyError: 'hours'

This is probably a local installation issue. Found a bug in Trac?

If you think this should work and you can reproduce the problem, you should consider reporting this to the Trac team.

Before you do that, though, please first try searching for similar issues, as it is quite likely that this problem has been reported before. For questions about installation and configuration of Trac, please try the mailing list instead of filing a ticket.

Otherwise, please ==== How to Reproduce ==== While doing a POST operation on /newticket, Trac issued an internal error. (please provide additional details here) Request parameters: {'__FORM_TOKEN': u'2a7096fbbc4e44ef71358de1', 'field_backlog': u'no backlog', 'field_blockedby': u'test', 'field_blocking': u'test', 'field_cc': u'balaji', 'field_clientrate': u'test', 'field_component': u'component1', 'field_description': u'test', 'field_hard_deadline1': u'test', 'field_hard_deadline2': u'test', 'field_keywords': u'test', 'field_milestone': u'', 'field_owner': u'test', 'field_priority': u'major', 'field_reporter': u'admin', 'field_status': u'new', 'field_summary': u'test', 'field_type': u'defect', 'field_version': u'', 'submit': u'Create ticket'} ==== System Information ====
Trac 0.11.7 Python 2.5.2 (r252:60911, Jul 22 2009, 15:52:25)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)]
setuptools 0.6c11 SQLite 3.4.2 pysqlite 2.3.2 Genshi 0.7dev-r1134 mod_python 3.3.1 Subversion 1.4.6 (r28521) CustomFieldAdmin 0.2.2 ==== Python Traceback ==== Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/Trac-0.11.7-py2.5.egg/trac/web/main.py", line 450, in _dispatch_request dispatcher.dispatch(req) File "/usr/lib/python2.5/site-packages/Trac-0.11.7-py2.5.egg/trac/web/main.py", line 206, in dispatch resp = chosen_handler.process_request(req) File "/usr/lib/python2.5/site-packages/Trac-0.11.7-py2.5.egg/trac/ticket/web_ui.py", line 183, in process_request return self._process_newticket_request(req) File "/usr/lib/python2.5/site-packages/Trac-0.11.7-py2.5.egg/trac/ticket/web_ui.py", line 399, in _process_newticket_request self._do_create(req, ticket) # (redirected if successful) File "/usr/lib/python2.5/site-packages/Trac-0.11.7-py2.5.egg/trac/ticket/web_ui.py", line 1000, in _do_create ticket.insert() File "/usr/lib/python2.5/site-packages/Trac-0.11.7-py2.5.egg/trac/ticket/model.py", line 214, in insert listener.ticket_created(self) File "/var/lib/trac/xeragotrac/plugins/TracNotify-0.1-py2.5.egg/notify/notify.py", line 45, in ticket_created self.build_url(ticket, 'created') File "/var/lib/trac/xeragotrac/plugins/TracNotify-0.1-py2.5.egg/notify/notify.py", line 59, in build_url hours = ticket.values['hours'] KeyError: 'hours' a new ticket at the Trac project site, where you can describe the problem and explain how to reproduce it.

Python Traceback Most recent call last:

  • File "/usr/lib/python2.5/site-packages/Trac-0.11.7-py2.5.egg/trac/web/main.py", line 450, 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 0x8be122c> e KeyError('hours',) env <trac.env.Environment object at 0x87d416c> env_error None exc_info (<type 'exceptions.KeyError'>, KeyError('hours',), <traceback object at ... filename '/usr/lib/python2.5/site-packages/Trac-0.11.7-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 449 message u"KeyError: 'hours'" req <Request "POST u'/newticket'"> resp [] tb <traceback object at 0x8cde734> tb_hide None traceback u'Traceback (most recent call last):\n File ...
  • File "/usr/lib/python2.5/site-packages/Trac-0.11.7-py2.5.egg/trac/web/main.py", line 206, 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.web_ui.TicketModule object at 0x8be156c> chrome <trac.web.chrome.Chrome object at 0x8be1a2c> ctype 'application/x-www-form-urlencoded' e TypeError("'NoneType' object is unsubscriptable",) err (<type 'exceptions.KeyError'>, KeyError('hours',), <traceback object at ... handler <trac.ticket.web_ui.TicketModule object at 0x8be156c> options {} req <Request "POST u'/newticket'"> self <trac.web.main.RequestDispatcher object at 0x8be122c>
  • File "/usr/lib/python2.5/site-packages/Trac-0.11.7-py2.5.egg/trac/ticket/web_ui.py", line 183, in process_request Code fragment:
    1. def process_request(self, req):
    2. if 'id' in req.args:
    3. if req.path_info == '/newticket':
    4. raise TracError(_("id can't be set for a new ticket request."))
    5. return self._process_ticket_request(req)
    6. return self._process_newticket_request(req)
    7. # ITemplateProvider methods
    8. def get_htdocs_dirs(self):
    9. return []
    Local variables: Name Value req <Request "POST u'/newticket'"> self <trac.ticket.web_ui.TicketModule object at 0x8be156c>
  • File "/usr/lib/python2.5/site-packages/Trac-0.11.7-py2.5.egg/trac/ticket/web_ui.py", line 399, in _process_newticket_request Code fragment:
    1. valid = None
    2. if req.method == 'POST' and not 'preview' in req.args:
    3. valid = self._validate_ticket(req, ticket)
    4. if valid:
    5. self._do_create(req, ticket) # (redirected if successful)
    6. # else fall through in a preview
    7. req.argspreview? = True
    8. # don't validate for new tickets and don't validate twice
    9. if valid is None and 'preview' in req.args:
    Local variables: Name Value field_reporter 'field_reporter' plain_fields False reporter_id u'admin' req <Request "POST u'/newticket'"> self <trac.ticket.web_ui.TicketModule object at 0x8be156c> ticket <trac.ticket.model.Ticket object at 0x8e2b34c> valid True
  • File "/usr/lib/python2.5/site-packages/Trac-0.11.7-py2.5.egg/trac/ticket/web_ui.py", line 1000, in _do_create Code fragment:
    1. else:
    2. add_warning(req, message)
    3. return valid
    4. def _do_create(self, req, ticket):
  1. ticket.insert()
  2. # Notify
  3. try:
  4. tn = TicketNotifyEmail(self.env)
  5. tn.notify(ticket, newticket=True) Local variables: Name Value req <Request "POST u'/newticket'"> self <trac.ticket.web_ui.TicketModule object at 0x8be156c> ticket <trac.ticket.model.Ticket object at 0x8e2b34c>
  • File "/usr/lib/python2.5/site-packages/Trac-0.11.7-py2.5.egg/trac/ticket/model.py", line 214, in insert Code fragment:
    1. self.id = tkt_id
    2. self.resource = self.resource(id=tkt_id)
    3. self._old = {}
    4. for listener in TicketSystem(self.env).change_listeners:
    5. listener.ticket_created(self)
    6. return self.id
    7. def save_changes(self, author, comment, when=None, db=None, cnum=):
    8. """
    Local variables: Name Value changed 1276018128 created 1276018128 cursor <trac.db.util.IterableCursor object at 0x8f4576c> custom_fields [u'hard_deadline1', u'hard_deadline2', u'blockedby', u'blocking', ... db <trac.db.pool.PooledConnection object at 0x8cdedc4> f {'options': ['no backlog', u'Product and Community', u'Sales and Business ... fname u'backlog' handle_ta True listener <notify.notify.Notify object at 0x8fb61ac> name u'backlog' self <trac.ticket.model.Ticket object at 0x8e2b34c> std_fields ['summary', 'reporter', 'owner', 'description', 'type', 'status', ... tkt_id 14 when datetime.datetime(2010, 6, 8, 17, 28, 48, 949338, tzinfo=<FixedOffset ...
  • File "/var/lib/trac/xeragotrac/plugins/TracNotify-0.1-py2.5.egg/notify/notify.py", line 45, in ticket_created Local variables: Name Value self <notify.notify.Notify object at 0x8fb61ac> ticket <trac.ticket.model.Ticket object at 0x8e2b34c>
  • File "/var/lib/trac/xeragotrac/plugins/TracNotify-0.1-py2.5.egg/notify/notify.py", line 59, in build_url Local variables: Name Value action 'created' author comment id '14' self <notify.notify.Notify object at 0x8fb61ac> ticket <trac.ticket.model.Ticket object at 0x8e2b34c>

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

dispatcher.dispatch(req)

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

resp = chosen_handler.process_request(req)

File "/usr/lib/python2.5/site-packages/Trac-0.11.7-py2.5.egg/trac/ticket/web_ui.py", line 183, in process_request

return self._process_newticket_request(req)

File "/usr/lib/python2.5/site-packages/Trac-0.11.7-py2.5.egg/trac/ticket/web_ui.py", line 399, in _process_newticket_request

self._do_create(req, ticket) # (redirected if successful)

File "/usr/lib/python2.5/site-packages/Trac-0.11.7-py2.5.egg/trac/ticket/web_ui.py", line 1000, in _do_create

ticket.insert()

File "/usr/lib/python2.5/site-packages/Trac-0.11.7-py2.5.egg/trac/ticket/model.py", line 214, in insert

listener.ticket_created(self)

File "/var/lib/trac/xeragotrac/plugins/TracNotify-0.1-py2.5.egg/notify/notify.py", line 45, in ticket_createdFile "/var/lib/trac/xeragotrac/plugins/TracNotify-0.1-py2.5.egg/notify/notify.py", line 59, in build_url

System Information: Trac: 0.11.7 Python: 2.5.2 (r252:60911, Jul 22 2009, 15:52:25) [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] setuptools: 0.6c11 SQLite: 3.4.2 pysqlite: 2.3.2 Genshi: 0.7dev-r1134 mod_python: 3.3.1 Subversion: 1.4.6 (r28521) CustomFieldAdmin: 0.2.2

Change History (0)

Note: See TracTickets for help on using tickets.