Hello,
After upgrading from Trac 1.0.11 to Trac 1.6 with SQLite, I'm encountering
this error in logs:
ERROR: Unable to create cache records for revision X in '(default)':
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 = 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
open
4. → "database is locked"
Trac 1.0.11 passed the transaction as parameter (no nested transactions),
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?
--
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 email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/trac-users/91bbb200-3a6e-4b0e-9694-1a8cd96d7d0cn%40googlegroups.com.