[Trac] "database is locked" error after upgrading from Trac 1.0.11 to 1.6 (SQLite)
Maƫl <[email protected]> Thu, 12 Feb 2026 01:37:20 -0800 (PST)
| Newsgroups | gmane.comp.version-control.subversion.trac.general |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_61000_1245479027.1770889040087
Content-Type: multipart/alternative;
boundary="----=_Part_61001_397962054.1770889040087"
------=_Part_61001_397962054.1770889040087
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hello,
After upgrading from Trac 1.0.11 to Trac 1.6 with SQLite, I'm encountering=
=20
this error in logs:
ERROR: Unable to create cache records for revision X in '(default)':=20
OperationalError('database is locked')
Environment:
- SQLite database
- Custom workflow plugin that commits to SVN during ticket transitions
- SVN post-commit hook calls trac-admin changeset added
- PRAGMA busy_timeout =3D 0 (default)
Root cause:
Trac 1.6 introduced nested transactions in versioncontrol/cache.py:
- sync() opens a transaction (line 182)
- insert_changeset() opens another transaction (line 286)
This creates an inter-process conflict with SQLite:
1. Apache process: ticket transition + SVN commit
2. Post-commit hook: triggers trac-admin changeset added immediately
3. trac-admin process: tries to sync while Apache's transaction is still=20
open
4. =E2=86=92 "database is locked"
Trac 1.0.11 passed the transaction as parameter (no nested transactions),=
=20
so this didn't occur.
Questions:
- Is this a known issue with Trac 1.6 + SQLite + SVN hooks?
- Is there an official workaround for nested transactions in cache.py?
--=20
You received this message because you are subscribed to the Google Groups "=
Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to trac-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To view this discussion visit https://groups.google.com/d/msgid/trac-users/=
91bbb200-3a6e-4b0e-9694-1a8cd96d7d0cn%40googlegroups.com.
------=_Part_61001_397962054.1770889040087
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hello,<br /><br />After upgrading from Trac 1.0.11 to Trac 1.6 with SQLite,=
I'm encountering this error in logs:<br /><br />ERROR: Unable to create ca=
che records for revision X in '(default)': OperationalError('database is lo=
cked')<br /><br />Environment:<br />- SQLite database<br />- Custom workflo=
w plugin that commits to SVN during ticket transitions<br />- SVN post-comm=
it hook calls trac-admin changeset added<br />- PRAGMA busy_timeout =3D 0 (=
default)<br /><br />Root cause:<br />Trac 1.6 introduced nested transaction=
s in versioncontrol/cache.py:<br /><br />- sync() opens a transaction (line=
182)<br />- insert_changeset() opens another transaction (line 286)<br /><=
br />This creates an inter-process conflict with SQLite:<br />1. Apache pro=
cess: ticket transition + SVN commit<br />2. Post-commit hook: triggers tra=
c-admin changeset added immediately<br />3. trac-admin process: tries to sy=
nc while Apache's transaction is still open<br />4. =E2=86=92 "database is =
locked"<br /><br />Trac 1.0.11 passed the transaction as parameter (no nest=
ed transactions), so this didn't occur.<br /><br />Questions:<br /><br />- =
Is this a known issue with Trac 1.6 + SQLite + SVN hooks?<br />- Is there a=
n official workaround for nested transactions in cache.py?
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;Trac Users" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:trac-users+unsubscribe-/[email protected]">trac-use=
rs+unsubscribe-/[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
trac-users/91bbb200-3a6e-4b0e-9694-1a8cd96d7d0cn%40googlegroups.com?utm_med=
ium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/trac-use=
rs/91bbb200-3a6e-4b0e-9694-1a8cd96d7d0cn%40googlegroups.com</a>.<br />
------=_Part_61001_397962054.1770889040087--
------=_Part_61000_1245479027.1770889040087--