Multirepos Databse Upgrade from 0.11 Fails w/ PostgreSQL
|Reported by:||John Hampton||Owned by:||Christian Boos|
Issue is located at upgrades/db23.py#L6. If the repository table doesn't exist (which it doesn't due to upgrading from 0.11), then the select fails. However, on PostgreSQL, this leaves the cursor in a state requiring a rollback. Since there is no rollback in the
execept block, then it fails with:
InternalError: current transaction is aborted, commands ignored until end of transaction block
The real kicker here, however, is that if you simply put a rollback in the
except block, then you knock out the upgrades done in upgrades/db22.py which means the cache table never gets created. Thus leaving trac in a broken state.
It seems as though the purpose of the
try/except block in do_upgrade is simply meant to replay upgrades/db22.py. This doesn't make sense. Why would the database base upgrade need to be re-run? Anyway, I don't have a good idea on how to fix this, other than eliminating the
try/except block such that it's unnecessary.