[mythtv] Master database upgrade failed

Russell Gower mythtv at thegowers.me.uk
Fri Jun 20 11:43:26 UTC 2014

On 19 Jun 2014, at 19:18, Russell Gower <mythtv at thegowers.me.uk> wrote:

> Hi,
>  I’m running master here and have just tried to upgrade from gbefdc4d to g99c7296 but the database schema upgrade failed, here’s the output from mythtv-setup 
> 2014-06-19 19:02:52.091388 I  Current MythTV Schema Version (DBSchemaVer): 1327
> 2014-06-19 19:02:52.100456 E  Backing up database with script: '/usr/share/mythtv/mythconverg_backup.pl'
> 2014-06-19 19:03:03.067877 C  Database Backup complete.
> 2014-06-19 19:03:03.068628 C  Backed up database to file: '/mythtv/A/DB/mythconverg-1327-20140619180252.sql.gz'
> 2014-06-19 19:03:14.412413 C  Upgrading to MythTV schema version 1328
> 2014-06-19 19:03:14.412783 E  DB Error (Performing database upgrade): 
> Query was: ALTER TABLE record DROP INDEX chanid 
> Error was: Driver error was [2/1091]:
> QMYSQL: Unable to execute query
> Database error was:
> Can't DROP 'chanid'; check that column/key exists
> new version: 1328
> 2014-06-19 19:03:14.412796 E  Database schema upgrade failed.
> 2014-06-19 19:03:14.413192 E  Couldn't upgrade database to new schema.
> I’ve downgraded and restored the database from the backup so I up and running again now, just not sure how to upgrade to a more recent checkout.

Just a quick update, I tracked the issue down to commit “af5836e99050ef940d2ded3823b72faee28e3412” which implements a unique key on the record table, the trouble is it doesn’t deal with any existing duplicates first.

As a work around I manually identified and removed all the duplicates before upgrading, but I’m not sure how this should be handled when master becomes v0.28.


More information about the mythtv-dev mailing list