Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

#7840 closed defect (worksforme)

TypeError: a float is required

Reported by: dave@… Owned by:
Priority: normal Milestone:
Component: ticket system Version: 0.11
Severity: blocker Keywords:
Cc: marshall@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

To reproduce: visit https://svn.boost.org/trac/boost/ticket/476

Most recent call last:

    * File "/opt/trac2/lib/python2.4/site-packages/Trac-0.11-py2.4.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 0xb7b1b96c>
      e 	<exceptions.TypeError instance at 0xb7a8490c>
      env 	<trac.env.Environment object at 0xb7c62aec>
      env_error 	None
      exc_info 	(<class exceptions.TypeError at 0xb7f932cc>, <exceptions.TypeError ...
      filename 	'/opt/trac2/lib/python2.4/site-packages/Trac-0.11-py2.4.egg/trac/web/main.p ...
      frames 	[{'function': '_dispatch_request', 'lines_before': [u' try:', u' ...
      has_admin 	True
      line 	u' dispatcher.dispatch(req)'
      lineno 	422
      message 	u'TypeError: a float is required'
      req 	<Request "GET u'/ticket/476'">
      resp 	[]
      tb 	<traceback object at 0xb7a8a414>
      tb_hide 	None
      traceback 	'Traceback (most recent call last):\n File ...
    * File "/opt/trac2/lib/python2.4/site-packages/Trac-0.11-py2.4.egg/trac/web/main.py", line 197, in dispatch
      Code fragment:
       192. req.args.get('__FORM_TOKEN') != req.form_token:
       193. raise HTTPBadRequest('Missing or invalid form token. '
       194. 'Do you have cookies enabled?')
       195.  
       196. # Process the request and render the template
       197. resp = chosen_handler.process_request(req)
       198. if resp:
       199. if len(resp) == 2: # Clearsilver
       200. chrome.populate_hdf(req)
       201. template, content_type = \
       202. self._post_process_request(req, *resp)
      Local variables:
      Name	Value
      chosen_handler 	<trac.ticket.web_ui.TicketModule object at 0xb7b1b9cc>
      chrome 	<trac.web.chrome.Chrome object at 0xb7c80d6c>
      err 	(<class exceptions.TypeError at 0xb7f932cc>, <exceptions.TypeError ...
      handler 	<trac.ticket.web_ui.TicketModule object at 0xb7b1b9cc>
      req 	<Request "GET u'/ticket/476'">
      self 	<trac.web.main.RequestDispatcher object at 0xb7b1b96c>
    * File "/opt/trac2/lib/python2.4/site-packages/Trac-0.11-py2.4.egg/trac/ticket/web_ui.py", line 152, in process_request
      Code fragment:
       147.  
       148. def process_request(self, req):
       149. if 'id' in req.args:
       150. if req.path_info.startswith('/newticket'):
       151. raise TracError(_("id can't be set for a new ticket request."))
       152. return self._process_ticket_request(req)
       153. return self._process_newticket_request(req)
       154.  
       155. # ITemplateProvider methods
       156.  
       157. def get_htdocs_dirs(self):
      Local variables:
      Name	Value
      req 	<Request "GET u'/ticket/476'">
      self 	<trac.ticket.web_ui.TicketModule object at 0xb7b1b9cc>
    * File "/opt/trac2/lib/python2.4/site-packages/Trac-0.11-py2.4.egg/trac/ticket/web_ui.py", line 412, in _process_ticket_request
      Code fragment:
       407. version = int(version)
       408. except ValueError:
       409. version = None
       410.  
       411. req.perm('ticket', id, version).require('TICKET_VIEW')
       412. ticket = Ticket(self.env, id, version=version)
       413. action = req.args.get('action', ('history' in req.args and 'history' or
       414. 'view'))
       415.  
       416. data = self._prepare_data(req, ticket)
       417. data['comment'] = None
      Local variables:
      Name	Value
      id 	476
      req 	<Request "GET u'/ticket/476'">
      self 	<trac.ticket.web_ui.TicketModule object at 0xb7b1b9cc>
      version 	None
    * File "/opt/trac2/lib/python2.4/site-packages/Trac-0.11-py2.4.egg/trac/ticket/model.py", line 47, in __init__
      Code fragment:
        42. self.env = env
        43. self.resource = Resource('ticket', tkt_id, version)
        44. self.fields = TicketSystem(self.env).get_ticket_fields()
        45. self.values = {}
        46. if tkt_id is not None:
        47. self._fetch_ticket(tkt_id, db)
        48. else:
        49. self._init_defaults(db)
        50. self.id = self.time_created = self.time_changed = None
        51. self._old = {}
        52.  
      Local variables:
      Name	Value
      db 	None
      env 	<trac.env.Environment object at 0xb7c62aec>
      self 	<trac.ticket.model.Ticket object at 0xb7b1be0c>
      tkt_id 	476
      version 	None
    * File "/opt/trac2/lib/python2.4/site-packages/Trac-0.11-py2.4.egg/trac/ticket/model.py", line 105, in _fetch_ticket
      Code fragment:
       100.  
       101. self.id = tkt_id
       102. for i in range(len(std_fields)):
       103. self.values[std_fields[i]] = row[i] or ''
       104. self.time_created = datetime.fromtimestamp(row[len(std_fields)], utc)
       105. self.time_changed = datetime.fromtimestamp(row[len(std_fields) + 1], utc)
       106.  
       107. # Fetch custom fields if available
       108. custom_fields = [f['name'] for f in self.fields if f.get('custom')]
       109. cursor.execute("SELECT name,value FROM ticket_custom WHERE ticket=%s",
       110. (tkt_id,))
      Local variables:
      Name	Value
      cursor 	<trac.db.util.IterableCursor object at 0xb7a83194>
      db 	<trac.db.pool.PooledConnection object at 0xb7a7eb4c>
      f 	{'type': 'text', 'name': 'cc', 'label': 'Cc'}
      i 	12
      row 	(u'Remove try/catch(...) in thread.cpp:thread_proxy()', u'mgruenke', ...
      self 	<trac.ticket.model.Ticket object at 0xb7b1be0c>
      std_fields 	['summary', 'reporter', 'owner', 'description', 'type', 'status', ...
      tkt_id 	476

File "/opt/trac2/lib/python2.4/site-packages/Trac-0.11-py2.4.egg/trac/web/main.py", line 423, in _dispatch_request
  dispatcher.dispatch(req)
File "/opt/trac2/lib/python2.4/site-packages/Trac-0.11-py2.4.egg/trac/web/main.py", line 197, in dispatch
  resp = chosen_handler.process_request(req)
File "/opt/trac2/lib/python2.4/site-packages/Trac-0.11-py2.4.egg/trac/ticket/web_ui.py", line 152, in process_request
  return self._process_ticket_request(req)
File "/opt/trac2/lib/python2.4/site-packages/Trac-0.11-py2.4.egg/trac/ticket/web_ui.py", line 412, in _process_ticket_request
  ticket = Ticket(self.env, id, version=version)
File "/opt/trac2/lib/python2.4/site-packages/Trac-0.11-py2.4.egg/trac/ticket/model.py", line 47, in __init__
  self._fetch_ticket(tkt_id, db)
File "/opt/trac2/lib/python2.4/site-packages/Trac-0.11-py2.4.egg/trac/ticket/model.py", line 105, in _fetch_ticket
  self.time_changed = datetime.fromtimestamp(row[len(std_fields) + 1], utc)

System Information:

User Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.4) Gecko/2008111317 Ubuntu/8.04 (hardy) Firefox/3.0.4
Trac: 	0.11
Python: 	2.4.4 (#1, Jan 25 2007, 13:04:51) [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)]
setuptools: 	0.6c8
SQLite: 	3.5.4
pysqlite: 	2.4.1
Genshi: 	0.5
Subversion: 	1.4.2 (r22196)
jQuery:	1.2.3

Attachments (0)

Change History (5)

comment:1 by Remy Blank, 15 years ago

Could you please provide the output of the following:

$ sqlite3 /my/trac/env/db/trac.db
sqlite> .nullvalue NULL
sqlite> select * from ticket where id=476;

I suspect the field changetime has a NULL value. You can fix it with some SQL, but the really interesting thing to find out is how it came to be NULL in the first place.

in reply to:  1 ; comment:2 by anonymous, 15 years ago

Replying to rblank:

Could you please provide the output of the following:

$ sqlite3 /my/trac/env/db/trac.db
sqlite> .nullvalue NULL
sqlite> select * from ticket where id=476;

We're working on getting you that information

I suspect the field changetime has a NULL value.

Based on this, I think it's probably something more interesting.

You can fix it with some SQL, but the really interesting thing to find out is how it came to be NULL in the first place.

in reply to:  2 comment:3 by Remy Blank, 15 years ago

Replying to anonymous:

Based on this, I think it's probably something more interesting.

Weird, I suppose it's only a coincidence that the two tickets generating this error are 476 and 764 (same digits). At least 746 doesn't have the same issue.

If changetime is not NULL, a debug print to the log, right before the problematic line, and showing the value and type of row[len(std_fields) + 1] would be very helpful. The value is unfortunately cut off in the display of the local variables. Something like:

self.log.debug('changetime=%r (%r)' % (row[len(std_fields) + 1], type(row[len(std_fields) + 1])))

comment:4 by marshall@…, 15 years ago

Cc: marshall@… added

It's not just those bug numbers - I think it's most (if not all) of the (still open) bugs that were imported from Sourceforge.

Try # 700, 701, 702, 703, 603 for more examples.

comment:5 by Christian Boos, 15 years ago

Resolution: worksforme
Status: newclosed

Looks like they fixed those tickets…

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.