Modify

Opened 5 years ago

Last modified 4 years ago

#7215 new defect

KeyError: 'hours'

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

Description (last modified by rjollos)

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.

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) ` [[br]] `[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:
       445. try:
       446. if not env and env_error:
       447. raise HTTPInternalError(env_error)
       448. try:
       449. dispatcher = RequestDispatcher(env)
       450. dispatcher.dispatch(req)
       451. except RequestDone:
       452. pass
       453. resp = req._response or []
       454.  
       455. 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:
       201. req.args.get('__FORM_TOKEN') != req.form_token:
       202. raise HTTPBadRequest('Missing or invalid form token. '
       203. 'Do you have cookies enabled?')
       204.  
       205. # Process the request and render the template
       206. resp = chosen_handler.process_request(req)
       207. if resp:
       208. if len(resp) == 2: # Clearsilver
       209. chrome.populate_hdf(req)
       210. template, content_type = \
       211. 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:
       178. def process_request(self, req):
       179. if 'id' in req.args:
       180. if req.path_info == '/newticket':
       181. raise TracError(_("id can't be set for a new ticket request."))
       182. return self._process_ticket_request(req)
       183. return self._process_newticket_request(req)
       184.  
       185. # ITemplateProvider methods
       186.  
       187. def get_htdocs_dirs(self):
       188. 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:
       394.  
       395. valid = None
       396. if req.method == 'POST' and not 'preview' in req.args:
       397. valid = self._validate_ticket(req, ticket)
       398. if valid:
       399. self._do_create(req, ticket) # (redirected if successful)
       400. # else fall through in a preview
       401. req.args['preview'] = True
       402.  
       403. # don't validate for new tickets and don't validate twice
       404. 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:
       995. else:
       996. add_warning(req, message)
       997. return valid
       998.  
       999. def _do_create(self, req, ticket):
      1000. ticket.insert()
      1001.  
      1002. # Notify
      1003. try:
      1004. tn = TicketNotifyEmail(self.env)
      1005. 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:
       209. self.id = tkt_id
       210. self.resource = self.resource(id=tkt_id)
       211. self._old = {}
       212.  
       213. for listener in TicketSystem(self.env).change_listeners:
       214. listener.ticket_created(self)
       215.  
       216. return self.id
       217.  
       218. def save_changes(self, author, comment, when=None, db=None, cnum=''):
       219. """
      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

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by mcpbalaji@…

  • Priority changed from normal to high
  • Severity changed from normal to critical

Please give solution the above issue.

comment:2 Changed 4 years ago by rjollos

  • Description modified (diff)

Add Comment

Modify Ticket

Action
as new The owner will remain fsbojason.
Author


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

 
Note: See TracTickets for help on using tickets.