Modify

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#4996 closed defect (fixed)

tags plugin fails on upgrading

Reported by: k0s Owned by: 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 (1)

tagsplugin-model-r5614.diff (508 bytes) - added by k0s 5 years ago.

Download all attachments as: .zip

Change History (8)

Changed 5 years ago by k0s

comment:1 Changed 5 years ago 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).

comment:2 Changed 5 years ago by osimons

  • Resolution set to fixed
  • Status changed from new to closed

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

Closes #4996.

comment:3 follow-up: Changed 5 years ago 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.

comment:4 in reply to: ↑ 3 Changed 5 years ago 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?

comment:5 follow-up: Changed 5 years ago 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.

comment:6 in reply to: ↑ 5 Changed 5 years ago 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)

comment:7 Changed 4 years ago by rjollos

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

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from osimons. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.