#11246 closed defect (fixed)
Fatal error on database migration with Trac v1.0.1
Reported by: | ryank-inovonics | Owned by: | Jun Omae |
---|---|---|---|
Priority: | highest | Component: | TracMigratePlugin |
Severity: | blocker | Keywords: | feedback |
Cc: | Trac Release: | 1.0 |
Description
When attempting to migrate a Trac v1.0.1 site from SQLite to PostgreSQL, got this error:
Copying tables: ProgrammingError: Cannot operate on a closed database. Exception AssertionError: AssertionError() in <bound method PooledConnection.__del__ of <trac.db.pool.PooledConnection object at 0x95ef324>> ignored attachment table...
After poking around in admin.py
found that creating the new environment closes any existing database connections, namely the one for the old environment's SQLite database. Swapped the new environment creation section with old environment's database open and query. With this change the migration completed successfully. See attached diff for the changes made to admin.py
.
Maybe a change in behavior of environment creation in Trac 1.0.x?
Attachments (1)
Change History (6)
Changed 11 years ago by
Attachment: | admin.diff added |
---|
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Keywords: | feedback added |
---|
comment:3 Changed 11 years ago by
Environment details:
- Ubuntu 12.04
- Python 2.7.3
- Trac 1.0.1
- PostgreSQL 9.1.9
- SQLite 3.7.9 & SQLite 2.8.17
Using a Python virtualenv with these packages installed (pip list
):
AdvancedTicketWorkflowPlugin (0.11dev-r9962) argparse (1.2.1) BlackMagicTicketTweaks (0.11r1) distribute (0.6.38) docutils (0.10) flup (1.0.3.dev-20110405) Genshi (0.7) NavAdd (0.1.1) PlantUML (2.0dev-r12389) psycopg2 (2.5) Pygments (1.6) pytz (2013b) Trac (1.0.1) TracAccountManager (0.4.3) TracCustomFieldAdmin (0.2.8-r12166) TracIniAdminPanel (1.0.1-r13010) TracMasterTickets (3.0.5dev-r12950) TracMigratePlugin (0.12.0.1) TracPermRedirect (3.0) TracWysiwyg (0.12.0.4-r12680) wsgiref (0.1.2)
Maybe one of the Trac plugins I have installed has a side-effect of closing the open database connections on environment create?
comment:5 Changed 11 years ago by
Thanks for your providing the details. Reproduced with only Trac 1.0.1, MasterTicketsPlugin and TracMigratePlugin 0.12.0.1.
Great Catching! Many thanks!
Thanks for the patch. Looks harmless. But I cannot reproduce it with Python 2.5/2.6/2.7 while migrating SQLite to PostgreSQL. Could you please provide the details of your environment?