Modify

Opened 5 years ago

Closed 5 years ago

#6207 closed defect (invalid)

error on migrating

Reported by: ronaldorezende Owned by: pacopablo
Priority: highest Component: SqliteToPgScript
Severity: major Keywords:
Cc: Trac Release: 0.11

Description

I'm trying to migrate 4 sqlite databases to postgree. All databases are trac enviroments. 2 of them are working ok and 2 are resulting at the error below:

sqlite: 3.5.9 postgre: 8.3 trac: 0.11.5

C:\Python25\Scripts>python sqlite2pg -e e:\trac\sites\bpp -p postgres://postgres:magna@localhost/bpp Traceback (most recent call last):

File "sqlite2pg", line 335, in <module>

sys.exit(main(sys.argv[1:]))

File "sqlite2pg", line 331, in main

Main(opts)

File "sqlite2pg", line 250, in Main

rc = tmigration.migrateTable(tname) or rc

File "sqlite2pg", line 72, in migrateTable

rc = self.default_copy(table)

File "sqlite2pg", line 93, in default_copy

pgcur.execute(insert_into, row)

File "c:\python25\lib\site-packages\Trac-0.11.5-py2.5-win32.egg\trac\db\util.py", line 59, in execute

return self.cursor.execute(sql_escape_percent(sql), args)

File "c:\python25\lib\site-packages\Trac-0.11.5-py2.5-win32.egg\trac\db\util.py", line 59, in execute

return self.cursor.execute(sql_escape_percent(sql), args)

psycopg2.InternalError: current transaction is aborted, commands ignored until end of transaction block

Attachments (0)

Change History (4)

comment:1 Changed 5 years ago by ronaldorezende

C:\Python25\Scripts>python sqlite2pg -e e:\trac\sites\bpp -p postgres://postgres:magna@localhost/bpp
Traceback (most recent call last):
  File "sqlite2pg", line 335, in <module>
    sys.exit(main(sys.argv[1:]))
  File "sqlite2pg", line 331, in main
    Main(opts)
  File "sqlite2pg", line 250, in Main
    rc = tmigration.migrateTable(tname) or rc
  File "sqlite2pg", line 72, in migrateTable
    rc = self.default_copy(table)
  File "sqlite2pg", line 93, in default_copy
    pgcur.execute(insert_into, row)
  File "c:\python25\lib\site-packages\Trac-0.11.5-py2.5-win32.egg\trac\db\util.py", line 59, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "c:\python25\lib\site-packages\Trac-0.11.5-py2.5-win32.egg\trac\db\util.py", line 59, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
psycopg2.InternalError: current transaction is aborted, commands ignored until end of transaction block

comment:2 Changed 5 years ago by ronaldorezende

  • Priority changed from normal to highest
  • Severity changed from normal to critical

comment:3 Changed 5 years ago by stefan.schlott@…

  • Severity changed from critical to major

We had the same error. The problem was a different database scheme - in our case, the table milestone had an additional column in the sqlite database. I assume that some plugin (which is no longer in use) created that column; the plugin was deinstalled, but the column was left. When we migrated to postgres, we used a new trac installation, containing only the plugins currently in use - and thus the stale column was missing.

The migration script will create insert statements without column names, thus the statement had one column to many - which gave the error above. Our solution: Compare database schemes, create missing columns.

Imho the migration script should check for such problems (or give a more descriptive error message); but since there is a workaround, I reduce the severity of this ticket.

comment:4 Changed 5 years ago by ronaldorezende

  • Resolution set to invalid
  • Status changed from new to closed

I have already solved the problem. There was a row with some required fieds with a null value. Att. Ronaldo.

Add Comment

Modify Ticket

Action
as closed The owner will remain pacopablo.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.