Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12603 closed defect (wontfix)

OperationalError: no such table: ticket_template_store

Reported by: gary.swofford@… Owned by: Ryan J Ollos
Priority: normal Component: TracTicketTemplatePlugin
Severity: blocker Keywords:
Cc: Trac Release: 1.0

Description

How to Reproduce

This is from an upgraded Trac project. The upgrade was from Trac 0.10 (tt plugin 0.5) to Trac 1.0.1 (tt plugin 1.0dev). It appears the upgrade did not create the needed table(s) for the plugin:

Trac detected an internal error:
OperationalError: no such table: ticket_template_store

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

Request parameters:

{'__EDITOR__1': u'textarea',
 '__FORM_TOKEN': u'5aa59be003e40324b5796d45',
 'cat_id': u'ticket',
 'description': u"= Produktions-Job =\r\n\r\n== Beschreibung ==\r\n * Produktion von ..(wieviel?) St\xfcck ...(was?) f\xfcr ...(wen?)\r\n * Komplette Produktion, inkl. Modifikation, Produktionstest, Montage und Endtest\r\n * '''Liefertermin KW..'''\r\n\r\n== Durchzuf\xfchrende Arbeiten ==\r\n * Vorgehen nach Prozess [wiki:Produktionprozess Produktion]\r\n * Gegebenenfalls Modifikation der Leiterplatten gem\xe4ss Dokumentation\r\n * Produktionstest der Leiterplatten gem\xe4ss Dokumentation\r\n * Protokollierung der Tests\r\n * Montage Leiterplatte und Geh\xe4use gem\xe4ss Dokumentation\r\n * Endtest der kompletten Ger\xe4te gem\xe4ss Dokumentation\r\n * Dokumentation der Arbeiten hier in diesem Ticket",
 'panel_id': u'tickettemplate',
 'path_info': None,
 'savetickettemplate': u'Apply change',
 'type': u'Produktion'}

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

System Information

Trac 1.0.1
Babel 1.3
CustomFieldAdmin 0.2.6
Docutils 0.11
Genshi 0.7 (with speedups)
mod_python 3.3.1
Pygments 1.6
pysqlite 2.6.0
Python 2.7.6 (default, Jun 22 2015, 18:01:27)
[GCC 4.8.2]
pytz 2012c
setuptools 3.3
SQLite 3.8.2
Subversion 1.8.8 (r1568071)
jQuery 1.7.2

Enabled Plugins

graphviz 0.7.5
timingandestimationplugin 1.4.8
TracCustomFieldAdmin 0.2.6
TracIncludeMacro 3.0.0dev
TracTicketTemplate 1.0dev
TracWikiToPdfPlugin 2.3.1dev
TracWysiwyg 0.12.0.3

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/trac/web/main.py", line 497, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.7/dist-packages/trac/web/main.py", line 214, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.7/dist-packages/trac/admin/web_ui.py", line 125, in process_request
    path_info)
  File "build/bdist.linux-x86_64/egg/tickettemplate/ttadmin.py", line 250, in render_admin_panel
    self._saveTemplateText(tt_name, tt_text)
  File "build/bdist.linux-x86_64/egg/tickettemplate/ttadmin.py", line 488, in _saveTemplateText
    'description', tt_text))
  File "build/bdist.linux-x86_64/egg/tickettemplate/model.py", line 56, in insert
    """, record)
  File "/usr/lib/python2.7/dist-packages/trac/db/api.py", line 122, in execute
    return db.execute(query, params)
  File "/usr/lib/python2.7/dist-packages/trac/db/util.py", line 121, in execute
    cursor.execute(query, params)
  File "/usr/lib/python2.7/dist-packages/trac/db/util.py", line 65, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/usr/lib/python2.7/dist-packages/trac/db/sqlite_backend.py", line 78, in execute
    result = PyFormatCursor.execute(self, *args)
  File "/usr/lib/python2.7/dist-packages/trac/db/sqlite_backend.py", line 56, in execute
    args or [])
  File "/usr/lib/python2.7/dist-packages/trac/db/sqlite_backend.py", line 48, in _rollback_on_error
    return function(self, *args, **kwargs)
OperationalError: no such table: ticket_template_store

Attachments (0)

Change History (8)

comment:1 Changed 9 years ago by Ryan J Ollos

Owner: changed from Richard Liao to Ryan J Ollos
Status: newaccepted

The code that checks for table existence is incorrect. It's a problem commonly seen with plugins.

comment:2 in reply to:  1 Changed 9 years ago by Ryan J Ollos

Replying to rjollos:

The code that checks for table existence is incorrect. It's a problem commonly seen with plugins.

I was incorrect about that. The problem is that there haven't been any upgrade steps written.

In the 0.10 version of the plugin the table was named tt_template, but it's now named ticket_template_store.

I don't have time to look at the history of the project and add upgrade steps, and the original author doesn't seem to be around anymore. I suggest deleting ticket_template and tt_version from the system table and re-running the upgrade. You'll then need to re-add all of your templates.

Last edited 9 years ago by Ryan J Ollos (previous) (diff)

comment:3 Changed 9 years ago by Ryan J Ollos

Resolution: wontfix
Status: acceptedclosed

comment:4 Changed 9 years ago by gary.swofford@…

Thanks for looking into this. This plugin is a mess. I was able to prevent the "missing table" error using your advice. But now the javascript does not work, I get this error:

TypeError: tt_custom_select is undefined tt_newticket.js:100:5

Perhaps this plugin should be "retired"?

comment:5 in reply to:  4 Changed 9 years ago by Ryan J Ollos

Replying to gary.swofford@…:

But now the javascript does not work, I get this error:

TypeError: tt_custom_select is undefined tt_newticket.js:100:5

The plugin works pretty well for new installations in my experience. It looks like you've found a regression in [14129]. I'll fix it shortly.

comment:6 Changed 9 years ago by Ryan J Ollos

In 15102:

1.0dev: Fix regression in [14129]

My Template selector was not functioning due to
execution of selector before adding the template containing
the element intended to be selected.

Refs #12603.

comment:7 Changed 9 years ago by Ryan J Ollos

Thank you for the feedback and if you encounter any other issues with the plugin please let me know by opening a new ticket.

comment:8 Changed 9 years ago by gary.swofford@…

That fixed the Javascript issue. Thank you very much!

Modify Ticket

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