Ticket #4996 (closed defect: fixed)

Opened 3 years ago

Last modified 1 year ago

tags plugin fails on upgrading

Reported by: k0s Assigned to: osimons
Priority: normal Component: TagsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

When I enable the TagsPlugin on a fresh environment, and the upgrade never returns. Specifically, I get a ProgrammerError as the cursor is not fresh. The following patch fixes:

Index: tractags/model.py
===================================================================
--- tractags/model.py	(revision 5614)
+++ tractags/model.py	(working copy)
@@ -20,9 +20,9 @@
         self._upgrade_db(self.env.get_db_cnx())
 
     def environment_needs_upgrade(self, db):
-        cursor = db.cursor()
         if self._need_migration(db):
             return True
+        cursor = db.cursor()
         try:
             cursor.execute("select count(*) from tags")
             cursor.fetchone()

Attachments

tagsplugin-model-r5614.diff (508 bytes) - added by k0s on 04/28/09 16:04:07.

Change History

04/28/09 16:04:07 changed by k0s

  • attachment tagsplugin-model-r5614.diff added.

05/02/09 11:18:57 changed by osimons

  • owner changed from athomas to osimons.

I just noticed the problem when upgrading my pysqlite version (2.3.5 -> 2.5.5) - but on an environment that has been working with tags plugin for a long time.

Your patch makes sense and solves the issue for me too. I'll try to commit it (if I still have permissions).

05/02/09 11:25:45 changed by osimons

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

(In [5655]) TagsPlugin: Fixed environment upgrade issue.

Closes #4996.

(follow-up: ↓ 4 ) 05/02/09 11:29:58 changed by osimons

Thanks for report and patch k0s!

Btw, are you using pysqlite 2.5.5 too? I have a feeling it is directly related to pysqlite that before let this slip through, but now catches the error.

(in reply to: ↑ 3 ) 05/06/09 23:29:24 changed by k0s

Replying to osimons:

Thanks for report and patch k0s! Btw, are you using pysqlite 2.5.5 too? I have a feeling it is directly related to pysqlite that before let this slip through, but now catches the error.

not sure, how do i find out the version number?

(follow-up: ↓ 6 ) 05/13/09 12:03:37 changed by osimons

See trac:wiki:PySqlite - try this:

python -c "import trac.db.sqlite_backend as s; print s.sqlite.version, s._ver"

It should give you the pysqlite version and the sqlite library version it is compiled against.

(in reply to: ↑ 5 ) 05/13/09 16:14:49 changed by k0s

Replying to osimons:

See trac:wiki:PySqlite - try this: {{{ python -c "import trac.db.sqlite_backend as s; print s.sqlite.version, s._ver" }}} It should give you the pysqlite version and the sqlite library version it is compiled against.

Thanks:

1.0.1 (2, 8, 17)

12/09/10 09:37:13 changed by rjollos

This issue (or a very similar one) seems to still be present, see #7504 and #5345.


Add/Change #4996 (tags plugin fails on upgrading)




Change Properties
Action