Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2030 closed defect (invalid)

Plugin installation breaks trac ("Command failed: near "ALTER": syntax error" on trac-admin .. upgrade)

Reported by: izzy Owned by: Radek Bartoň
Priority: normal Component: DiscussionPlugin
Severity: major Keywords:
Cc: Trac Release: 0.10


I just installed the discussion plugin here:

  • Ubuntu Dapper Drake (06-06)
  • trac 0.9.3 (as it comes w/ Ubuntu Dapper)
  • discussionplugin-r2626 (0.9/ branch taken)
  • libsqlite 2.8.17 / libsqlite3 3.2.8 (as it comes w/ Ubuntu Dapper)
  • Apache2 2.0.55

What I did:

  • Unpacking the ZIP
  • taking the 0.9/ subdirectory, and making it a single *.zip
  • used easy_install to install this

So far - fine. Then the docu suggests trac-admin <dir> upgrade. When I run that, the script fails with above message. I cannot use this plugin, since it finds no table (cannot check the error anymore, since now I only get a 500 error from the server when the discussion plugin is enabled. Unfortunately, I found no way how to uninstall it... (luckily, disabling it gets the remaining functionality back). Any help would be appreciated!

Attachments (0)

Change History (6)

comment:1 Changed 10 years ago by Radek Bartoň

Resolution: invalid
Status: newclosed

I'm pretty sure that your pysqlte is using sqlite version 2 which doesn't support ALTER TABLE SQL command. I can't remember way how to get which version is pysqlite using and how to change this right now especially on Ubuntu, but little searching would discover that... Anywany it's probably problem of your system configuration. If not just reoepen.

comment:2 Changed 10 years ago by Radek Bartoň

Ah, its

from pysqlite2 import dbapi2

comment:3 Changed 10 years ago by anonymous

You are right about this (I just checked inside the trac.db and it says it's version 2; the database also cannot be opened with sqlite3, which I also tried). I meanwhile managed to install it by modifying the files. Now I just get an error when selecting "Forums" or "Forum Groups" in the administration: "no such column:". I checked the table with the .dump command, the column is there - very strange...

You see any way to change the db to version 3? I don't want to fiddle with a manual installation of a different trac version if I can get around it... Or is there anything besides the install scripts, that requires sqlite3 which I could easily change, to stay with v2?

If both options don't apply: How to uninstall the module completely (I installed it with easy_install - but there's no easy_uninstall to be found ;)

comment:4 Changed 10 years ago by Radek Bartoň

I think that sqlite3 is prerequisity for Trac 0.9. As I remember I had to update databes to swich to 0.9. Some info about updating is at . Your error seems like your db is somewhat broken. If you want to "reinstall" DiscussionPlugin try to open trac.db using sqlite console command and perform:

DROP TABLE forum_group;
DROP TABLE message;
DELETE FROM system WHERE name='discussion_version';

A new trac-admin upgrade should then fix your problems or you can delete DiscussionPlugin files in site-packages.

comment:5 in reply to:  4 Changed 10 years ago by izzy


thank you very much - I got it fixed! In case somebody else asks: "apt-get install trac" resolves the dependencies as it thinks they are fine. I used synaptic to replace python-sqlite by python-pysqlite2 (don't get confused by the "2", it's compiled against sqlite3). No idea bout the trac upgrade (I was still playing, so nothing lost) - I simply initialized the only one project fresh. Now it looks fine. Will report later, maybe ;) Now it's time to go to bed (almost midnight here in Germany)...

Again: Thank you for your fast response!

P.S.: As for "uninstall": Sure, the part for the DB is clear to me (and maybe to be found somewhere in the Wiki - though it would be nice to find it on the install page). The last part is the important one to me: What files to delete from the site-packages. Only the .egg? No hurry to answer, since I don't think I will remove it that soon. Not before having it tested ;)

comment:6 Changed 10 years ago by Radek Bartoň

If you've installed plugin as an egg you can delete just it and cache directory TracDiscussion-0.6-py2.5.egg-tmp. You can visit #trac IRC channel at to get quicker and more interactive solution to any similar problem.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Radek Bartoň.
The resolution will be deleted.

Add Comment

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

Note: See TracTickets for help on using tickets.