Opened 8 years ago

Closed 8 years ago

#4996 closed defect (fixed)

Reported by: Owned by: k0s osimons normal TagsPlugin normal 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 @@

-        cursor = db.cursor()
if self._need_migration(db):
return True
+        cursor = db.cursor()
try:
cursor.execute("select count(*) from tags")
cursor.fetchone()


comment:1 Changed 8 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 8 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: ↓ 4 Changed 8 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 8 years ago by k0s

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: ↓ 6 Changed 8 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 8 years ago by k0s

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 6 years ago by rjollos

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