Ticket #10327 (closed defect: fixed)

Opened 8 months ago

Last modified 7 months ago

OperationalError: no such column: estimatedhours when submitting changes

Reported by: anonymous Assigned to: rjollos
Priority: normal Component: TracHoursPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

How to Reproduce

While doing a POST operation on /ticket/2, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'__EDITOR__1': u'wysiwyg',
 '__EDITOR__2': u'wysiwyg',
 '__FORM_TOKEN': u'de09a33d54d8a351538c7dd4',
 'action': u'leave',
 'cnum': u'2',
 'comment': u'',
 'field_cc': u'',
 'field_component': u'Projektumgebung (Administration, etc.)',
 'field_description': u'',
 'field_keywords': u'',
 'field_milestone': u'Projektumgebung vollst\xe4ndig aufgesetzt',
 'field_priority': u'major',
 'field_reporter': u'losh',
 'field_summary': u'Trac und svn einrichten',
 'field_type': u'Aufgabe',
 'id': u'2',
 'replyto': u'',
 'submit': u'\xc4nderungen absenden',
 'ts': u'2012-09-16 18:39:36.112138+00:00'}

User agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1

System Information

Trac 0.12
Babel 0.9.5
Genshi 0.6
mod_wsgi 2.8 (WSGIProcessGroup WSGIApplicationGroup trac.losh.at|)
pysqlite 2.4.1
Python 2.6.5 (r265:79063, Apr 16 2010, 14:15:55)
[GCC 4.4.3]
pytz 2010b
setuptools 0.6
SQLite 3.6.22
Subversion 1.6.6 (r40053)
jQuery 1.4.2

Enabled Plugins

ComponentDependencyPlugin 0.1
SvnAuthzAdminPlugin 0.2
TicketSidebarProvider 0.0-r11698
TracAccountManager 0.2.1dev
TracGanttCalendarPlugin 0.6.1-r802
TracHoursPlugin 0.6.0dev-r11981
TracWysiwyg 0.2

Python Traceback

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/web/main.py", line 513, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/web/main.py", line 235, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/ticket/web_ui.py", line 169, in process_request
    return self._process_ticket_request(req)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/ticket/web_ui.py", line 538, in _process_ticket_request
    self._do_save(req, ticket, action)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/ticket/web_ui.py", line 1233, in _do_save
    cnum=internal_cnum):
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/ticket/model.py", line 282, in save_changes
    @self.env.with_transaction(db)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/db/api.py", line 77, in transaction_wrapper
    fn(ldb)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/ticket/model.py", line 329, in do_save
    % name, (self[name], self.id))
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/db/util.py", line 65, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/db/sqlite_backend.py", line 78, in execute
    result = PyFormatCursor.execute(self, *args)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/db/sqlite_backend.py", line 56, in execute
    args or [])
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/db/sqlite_backend.py", line 48, in _rollback_on_error
    return function(self, *args, **kwargs)
OperationalError: no such column: estimatedhours

Attachments

Change History

09/16/12 22:18:48 changed by rjollos

Thanks for reporting. I'll take a look this evening and get back to you.

09/17/12 01:24:56 changed by rjollos

  • keywords set to needinfo.

I'm not able to reproduce. Could you please provide more details?

It looks like you were adding a comment to the ticket, or, equivalently, changing some fields. Could you describe exactly what you were doing?

Was ticket 2 created before you installed TracHoursPlugin? Do you see an Estimated Hours custom field on the ticket? Are you able to create and update other tickets without any encountering any issues?

09/19/12 10:03:07 changed by rjollos

This might be explained by t:#10858. I'll do some testing with changing the custom field.

09/19/12 16:56:20 changed by rjollos

I can reproduce by commenting out the estimatedhours entry under ticket-custom. Did you intentionally remove or rename that entry? Could you check the contents of your trac.ini file?

Most recent call last:

File "/home/user/Workspace/th10327/trac-0.12/trac/web/main.py", line 513, in _dispatch_request
  dispatcher.dispatch(req)
File "/home/user/Workspace/th10327/trac-0.12/trac/web/main.py", line 235, in dispatch
  resp = chosen_handler.process_request(req)
File "/home/user/Workspace/th10327/trac-0.12/trac/ticket/web_ui.py", line 169, in process_request
  return self._process_ticket_request(req)
File "/home/user/Workspace/th10327/trac-0.12/trac/ticket/web_ui.py", line 538, in _process_ticket_request
  self._do_save(req, ticket, action)
File "/home/user/Workspace/th10327/trac-0.12/trac/ticket/web_ui.py", line 1233, in _do_save
  cnum=internal_cnum):
File "/home/user/Workspace/th10327/trac-0.12/trac/ticket/model.py", line 282, in save_changes
  @self.env.with_transaction(db)
File "/home/user/Workspace/th10327/trac-0.12/trac/db/api.py", line 77, in transaction_wrapper
  fn(ldb)
File "/home/user/Workspace/th10327/trac-0.12/trac/ticket/model.py", line 329, in do_save
  % name, (self[name], self.id))
File "/home/user/Workspace/th10327/trac-0.12/trac/db/util.py", line 65, in execute
  return self.cursor.execute(sql_escape_percent(sql), args)
File "/home/user/Workspace/th10327/trac-0.12/trac/db/sqlite_backend.py", line 78, in execute
  result = PyFormatCursor.execute(self, *args)
File "/home/user/Workspace/th10327/trac-0.12/trac/db/sqlite_backend.py", line 56, in execute
  args or [])
File "/home/user/Workspace/th10327/trac-0.12/trac/db/sqlite_backend.py", line 48, in _rollback_on_error
  return function(self, *args, **kwargs)

09/19/12 18:36:20 changed by rjollos

(In [12027]) Refs #10327: Issue a warning when validating the ticket if 'estimatedhours' is not defined in the ticket-custom section of trac.ini, to avoid a traceback on ticket submit.

09/19/12 18:37:35 changed by rjollos

  • status changed from new to assigned.

09/19/12 18:37:46 changed by rjollos

  • keywords deleted.

09/20/12 05:17:46 changed by rjollos

(In [12029]) Refs #10327:

  • Added unit test infrastructure.
  • Added unit tests for ITicketManipulator implementation in TracHoursPlugin class.
  • Refactored ITicketManipulator methods in TracHoursPlugin class.

10/19/12 01:05:02 changed by rjollos

  • status changed from assigned to closed.
  • resolution set to fixed.

Please reopen if you continue to have trouble.


Add/Change #10327 (OperationalError: no such column: estimatedhours when submitting changes)




Change Properties
Action