[mythtv-users] Avenard repo upgraded to 0.22 Database Schema upgrade failed

Nick Morrott knowledgejunkie at gmail.com
Wed Oct 21 22:51:04 UTC 2009


2009/10/21 Patrick Davila <pdavila at thelinuxlink.net>:
> Been happily running 0.21 with Avenard patches. Upgrade notification
> popped up today and the wife clicked yes. Packages upgraded to 0.22 and
> the DBSchema upgrade is failing:
> 2009-10-21 17:03:01.653 Newest MythTV Schema Version : 1244
> 2009-10-21 17:03:01.656 Upgrading to MythTV schema version 1225
> 2009-10-21 17:03:01.657 DB Error (Performing database upgrade):
> Query was: CREATE TABLE bad_people AS SELECT * FROM people;
> Error was: Driver error was [2/1050]:
> QMYSQL3: Unable to execute statement
> Database error was:
> Table 'bad_people' already exists
>
> new version: 1225
> 2009-10-21 17:03:01.657 Database Schema upgrade FAILED, unlocking.
> 2009-10-21 17:03:01.657 Couldn't upgrade database to new schema
>
>
> Any ideas on how to get around this?

Hi Pat,

Looks like the DB schema update process from version 1224 to 1225 has
already been run (unsuccessfully), resulting in the creation of the
'bad_people' table - and likely the bad_credits and
bad_recordedcredits tables - and the subsequent failure when the
update tries again.

The creation of this table (and of bad_credits and
bad_recordedcredits) is the first step in the 1225 schema update.
After some processing, these tables are deleted before the schema
version is upgraded to 1225. This particular schema update is to "Fix
data corruption caused by a data conversion issue in the original
implementation of the 1215-1216 database upgrade"

Can you check your logs for any previous upgrade failures (note that
mythtv-setup will also update the schema)?

I initially suggest:

i) stopping the backend;
ii) taking a backup of the database; and
iii) checking the current schema version is 1224;
iv) iv) checking if your 'bad_people', 'bad_credits' and
'bad_recordedcredits' tables exist and are populated with data, and
v) checking if your 'people', 'credits' and 'recordedcredits' tables
are populated with data

I don't want to suggest any more than that in case it causes you to
lose any more credits/people data as a result. Once the 'bad_*' tables
are created, the 'people', 'credits' and 'recordedcredits' tables are
truncated to reset them - so simply deleting the bad_* tables (without
further checks) to try and force the update may result in data loss.

Cheers,
Nick

P.S. Many thanks for the MythTV Cast :)

-- 
Nick Morrott

MythTV Official wiki:
http://mythtv.org/wiki/
MythTV users list archive:
http://www.gossamer-threads.com/lists/mythtv/users

"An investment in knowledge always pays the best interest." - Benjamin Franklin


More information about the mythtv-users mailing list