Modify ↓
Opened 17 years ago
Closed 13 years ago
#3704 closed defect (wontfix)
Migration partially fails without visible diagnostics on Unicode errors
| Reported by: | Owned by: | John Hampton | |
|---|---|---|---|
| Priority: | normal | Component: | SqliteToPgScript |
| Severity: | critical | Keywords: | |
| Cc: | Trac Release: | 0.11 |
Description
Migration fails for my installation of trac with additional http://www.trac-hacks.org/wiki/TimingAndEstimationPlugin
First of all, there were no diagnostics on console!
Output was:
$ python sqlite2pg -e env -p 'postgres://www:@/trac' Timing and Estimation needs an upgrade Upgrading Database Creating bill_date table Creating report_version table Upgrading report_version table to v4 Dropping report_version table Upgrading reports Upgrading usermanual Done Upgrading
But in reality (in pg_log) there are messages:
ERROR: relation "bill_date" does not exist ERROR: relation "report_version" does not exist
This situation must be detected at least.
In result only some part of tickets was migrated.
Attachments (0)
Change History (3)
comment:1 Changed 17 years ago by
comment:2 Changed 17 years ago by
| Summary: | Migration partially fails without visible diagnostics → Migration partially fails without visible diagnostics on Unicode errors |
|---|
comment:3 Changed 13 years ago by
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
This plugin is deprecated. See the TracMigratePlugin.
Note: See
TracTickets for help on using
tickets.



I've found the reason of failure. It's unrelated to mentioned log entries and output.
One of tickets appears to contain non-UTF-8 data whcih cannot be decoded by pysqlite2 adapter.
>>> from pysqlite2 import dbapi2 as sqlite >>> conn = sqlite.connect('./trac.db') >>> c = conn.cursor() >>> c.execute('select * from ticket') <pysqlite2.dbapi2.Cursor object at 0xb7f131a0> >>> for row in c : ... pass ... pysqlite2.dbapi2.OperationalError: Could not decode to UTF-8 column 'description' with text ' ........But the ticket still applies. Trac itself complains accessing this ticket, but sqlite2pg doesn't, silently failing in 'for' operator, but it should complain.