[mythtv-users] 0.26 upgrade: Database schema upgrade failed. Duplicate entry for primary key.

Jon Whitear jon at whitear.org
Sat Oct 6 03:12:15 UTC 2012


Hey folks,

I'd appreciate some assistance. I'm trying to upgrade my backend from 0.25 fixes to 0.26 fixes. This is running on up to date Ubuntu 12.04.01 LTS.

First off, the backend wouldn't start because it was complaining of missing timezone data in MySQL, I've imported the timezone data to MySQL following the pointer here:-

http://wiki.qnap.com/wiki/How_to_install_MythTV#Missing_timezone_support.C2.A0

Now the backend starts, but the schema upgrade fails. The log is below. The problem seems to be here:-

Oct  6 12:58:50 media mythlogserver: mythbackend[3826]: C CoreContext dbcheck.cpp:402 (performActualUpdate) Upgrading to MythTV schema version 1304
Oct  6 12:58:51 media mythlogserver: mythbackend[3826]: E CoreContext dbcheck.cpp:417 (performActualUpdate) DB Error (Performing database upgrade): #012Query was: UPDATE recordedseek SET starttime = CONVERT_TZ(starttime, 'SYSTEM', 'UTC') ORDER BY starttime #012Error was: Driver error was [2/1062]:#012QMYSQL: Unable to execute query#012Database error was:#012Duplicate entry '71-0000-00-00 00:00:00-0-0' for key 'PRIMARY'#012 #012new version: 1304
Oct  6 12:58:51 media kernel: [ 2447.724713] init: mythtv-backend main process (3825) terminated with status 133

Any idea how I go about fixing that? Thanks in advance.

Cheers,

Jon


Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: C thread_unknown mythcommandlineparser.cpp:2545 (ConfigureLogging) mythbackend version: fixes/0.26 [v0.26.0-2-ga49c750] www.mythtv.org
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: C thread_unknown mythcommandlineparser.cpp:2547 (ConfigureLogging) Qt version: compile: 4.8.1, runtime: 4.8.1
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: N thread_unknown mythcommandlineparser.cpp:2549 (ConfigureLogging) Enabled verbose msgs:  general
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: N thread_unknown logging.cpp:837 (logStart) Setting Log Level to LOG_INFO
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) Setup Interrupt handler
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) Setup Terminated handler
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) Setup Segmentation fault handler
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) Setup Aborted handler
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) Setup Bus error handler
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) Setup Floating point exception handler
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) Setup Illegal instruction handler
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) Setup Real-time signal 0 handler
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: N thread_unknown mythdirs.cpp:55 (InitializeMythDirs) Using runtime prefix = /usr
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: N thread_unknown mythdirs.cpp:68 (InitializeMythDirs) Using configuration directory = /home/mythtv/.mythtv
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I CoreContext mythcorecontext.cpp:231 (Init) Assumed character encoding: en_AU.UTF-8
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: N CoreContext mythcontext.cpp:493 (LoadDatabaseSettings) Empty LocalHostName.
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I CoreContext mythcontext.cpp:501 (LoadDatabaseSettings) Using localhost value of media
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I CoreContext mythcontext.cpp:682 (TestDBconnection) Testing network connectivity to '192.168.1.204'
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I SystemIOHandlerW system-unix.cpp:90 (run) Starting IO manager (write)
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I SystemIOHandlerR system-unix.cpp:90 (run) Starting IO manager (read)
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I SystemSignalManager system-unix.cpp:490 (run) Starting process signal handler
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I Logger logging.cpp:306 (run) Added logging to the console
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I SystemManager system-unix.cpp:263 (run) Starting process manager
Oct  6 12:58:19 media mythlogserver: mythlogserver[3764]: I LogForward loggingserver.cpp:1310 (forwardMessage) New Client: 007d27bb055b9d402dafb89729d895fdb7 (#3)
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: N CoreContext mythcorecontext.cpp:1283 (InitLocale) Setting QT default locale to EN_US
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I CoreContext mythcorecontext.cpp:1316 (SaveLocaleDefaults) Current locale EN_US
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: N CoreContext mythlocale.cpp:121 (LoadDefaultsFromXML) Reading locale defaults from /usr/share/mythtv//locales/en_us.xml
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I CoreContext schemawizard.cpp:118 (Compare) Current MythTV Schema Version (DBSchemaVer): 1303
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: E CoreContext dbutil.cpp:601 (DoBackup) Backing up database with script: '/usr/share/mythtv/mythconverg_backup.pl'
Oct  6 12:58:19 media mythlogserver: mythbackend[3798]: I Logger logging.cpp:447 (initialTimeout) Added logging to mythlogserver at TCP:35327
Oct  6 12:58:25 media mythlogserver: mythlogserver[3764]: I LogForward loggingserver.cpp:1204 (expireClients) Expiring client 002aec4f07d669432fad006694d42604ab (#2)
Oct  6 12:58:30 media mythlogserver: mythbackend[3798]: C CoreContext dbutil.cpp:622 (DoBackup) Database Backup complete.
Oct  6 12:58:30 media mythlogserver: mythbackend[3798]: C CoreContext dbutil.cpp:653 (DoBackup) Backed up database to file: '/var/lib/mythtv/db_backups/mythconverg-1303-20121006025819.sql.gz'
Oct  6 12:58:30 media mythlogserver: mythbackend[3798]: I CoreContext schemawizard.cpp:271 (PromptForUpgrade) Console is non-interactive, can't prompt user...
Oct  6 12:58:30 media mythlogserver: mythbackend[3798]: C CoreContext schemawizard.cpp:296 (PromptForUpgrade) Upgrading.
Oct  6 12:58:30 media mythlogserver: mythbackend[3798]: C CoreContext dbcheck.cpp:402 (performActualUpdate) Upgrading to MythTV schema version 1304
Oct  6 12:58:31 media mythlogserver: mythbackend[3798]: E CoreContext dbcheck.cpp:417 (performActualUpdate) DB Error (Performing database upgrade): #012Query was: UPDATE recordedseek SET starttime = CONVERT_TZ(starttime, 'SYSTEM', 'UTC') ORDER BY starttime #012Error was: Driver error was [2/1062]:#012QMYSQL: Unable to execute query#012Database error was:#012Duplicate entry '71-0000-00-00 00:00:00-0-0' for key 'PRIMARY'#012 #012new version: 1304
Oct  6 12:58:31 media kernel: [ 2427.812689] init: mythtv-backend main process (3797) terminated with status 133
Oct  6 12:58:31 media kernel: [ 2427.812714] init: mythtv-backend main process ended, respawning
Oct  6 12:58:31 media mythlogserver: mythbackend[3798]: E CoreContext dbcheck.cpp:502 (UpgradeTVDatabaseSchema) Database schema upgrade failed.
Oct  6 12:58:31 media mythlogserver: mythbackend[3798]: E CoreContext main_helpers.cpp:548 (run_backend) Couldn't upgrade database to new schema
Oct  6 12:58:31 media mythlogserver: mythbackend[3826]: C thread_unknown mythcommandlineparser.cpp:2545 (ConfigureLogging) mythbackend version: fixes/0.26 [v0.26.0-2-ga49c750] www.mythtv.org
Oct  6 12:58:31 media mythlogserver: mythbackend[3826]: C thread_unknown mythcommandlineparser.cpp:2547 (ConfigureLogging) Qt version: compile: 4.8.1, runtime: 4.8.1
Oct  6 12:58:31 media mythlogserver: mythbackend[3826]: N thread_unknown mythcommandlineparser.cpp:2549 (ConfigureLogging) Enabled verbose msgs:  general
Oct  6 12:58:31 media mythlogserver: mythbackend[3826]: N thread_unknown logging.cpp:837 (logStart) Setting Log Level to LOG_INFO
Oct  6 12:58:31 media mythlogserver: mythbackend[3826]: I thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) Setup Interrupt handler
Oct  6 12:58:31 media mythlogserver: mythbackend[3826]: I thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) Setup Terminated handler
Oct  6 12:58:31 media mythlogserver: mythbackend[3826]: I thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) Setup Segmentation fault handler
Oct  6 12:58:31 media mythlogserver: mythbackend[3826]: I thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) Setup Aborted handler
Oct  6 12:58:31 media mythlogserver: mythbackend[3826]: I thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) Setup Bus error handler
Oct  6 12:58:31 media mythlogserver: mythbackend[3826]: I thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) Setup Floating point exception handler
Oct  6 12:58:31 media mythlogserver: mythbackend[3826]: I thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) Setup Illegal instruction handler
Oct  6 12:58:31 media mythlogserver: mythbackend[3826]: I thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) Setup Real-time signal 0 handler
Oct  6 12:58:31 media mythlogserver: mythbackend[3826]: N thread_unknown mythdirs.cpp:55 (InitializeMythDirs) Using runtime prefix = /usr
Oct  6 12:58:31 media mythlogserver: mythbackend[3826]: N thread_unknown mythdirs.cpp:68 (InitializeMythDirs) Using configuration directory = /home/mythtv/.mythtv
Oct  6 12:58:31 media mythlogserver: mythbackend[3826]: I CoreContext mythcorecontext.cpp:231 (Init) Assumed character encoding: en_AU.UTF-8
Oct  6 12:58:31 media mythlogserver: mythbackend[3826]: N CoreContext mythcontext.cpp:493 (LoadDatabaseSettings) Empty LocalHostName.
Oct  6 12:58:31 media mythlogserver: mythbackend[3826]: I CoreContext mythcontext.cpp:501 (LoadDatabaseSettings) Using localhost value of media
Oct  6 12:58:31 media mythlogserver: mythbackend[3826]: I CoreContext mythcontext.cpp:682 (TestDBconnection) Testing network connectivity to '192.168.1.204'
Oct  6 12:58:32 media mythlogserver: mythbackend[3826]: I SystemIOHandlerW system-unix.cpp:90 (run) Starting IO manager (write)
Oct  6 12:58:32 media mythlogserver: mythbackend[3826]: I SystemIOHandlerR system-unix.cpp:90 (run) Starting IO manager (read)
Oct  6 12:58:32 media mythlogserver: mythbackend[3826]: I SystemSignalManager system-unix.cpp:490 (run) Starting process signal handler
Oct  6 12:58:32 media mythlogserver: mythbackend[3826]: I Logger logging.cpp:306 (run) Added logging to the console
Oct  6 12:58:32 media mythlogserver: mythbackend[3826]: I SystemManager system-unix.cpp:263 (run) Starting process manager
Oct  6 12:58:32 media mythlogserver: mythlogserver[3764]: I LogForward loggingserver.cpp:1310 (forwardMessage) New Client: 00acdd276da00c43e8910b2ed6184a334e (#3)
Oct  6 12:58:32 media mythlogserver: mythbackend[3826]: N CoreContext mythcorecontext.cpp:1283 (InitLocale) Setting QT default locale to EN_US
Oct  6 12:58:32 media mythlogserver: mythbackend[3826]: I CoreContext mythcorecontext.cpp:1316 (SaveLocaleDefaults) Current locale EN_US
Oct  6 12:58:32 media mythlogserver: mythbackend[3826]: N CoreContext mythlocale.cpp:121 (LoadDefaultsFromXML) Reading locale defaults from /usr/share/mythtv//locales/en_us.xml
Oct  6 12:58:32 media mythlogserver: mythbackend[3826]: I CoreContext schemawizard.cpp:118 (Compare) Current MythTV Schema Version (DBSchemaVer): 1303
Oct  6 12:58:32 media mythlogserver: mythbackend[3826]: E CoreContext dbutil.cpp:601 (DoBackup) Backing up database with script: '/usr/share/mythtv/mythconverg_backup.pl'
Oct  6 12:58:32 media mythlogserver: mythbackend[3826]: I Logger logging.cpp:447 (initialTimeout) Added logging to mythlogserver at TCP:35327
Oct  6 12:58:37 media mythlogserver: mythlogserver[3764]: I LogForward loggingserver.cpp:1204 (expireClients) Expiring client 007d27bb055b9d402dafb89729d895fdb7 (#2)
Oct  6 12:58:50 media mythlogserver: mythbackend[3826]: C CoreContext dbutil.cpp:622 (DoBackup) Database Backup complete.
Oct  6 12:58:50 media mythlogserver: mythbackend[3826]: C CoreContext dbutil.cpp:653 (DoBackup) Backed up database to file: '/var/lib/mythtv/db_backups/mythconverg-1303-20121006025831.sql.gz'
Oct  6 12:58:50 media mythlogserver: mythbackend[3826]: I CoreContext schemawizard.cpp:271 (PromptForUpgrade) Console is non-interactive, can't prompt user...
Oct  6 12:58:50 media mythlogserver: mythbackend[3826]: C CoreContext schemawizard.cpp:296 (PromptForUpgrade) Upgrading.
Oct  6 12:58:50 media mythlogserver: mythbackend[3826]: C CoreContext dbcheck.cpp:402 (performActualUpdate) Upgrading to MythTV schema version 1304
Oct  6 12:58:51 media mythlogserver: mythbackend[3826]: E CoreContext dbcheck.cpp:417 (performActualUpdate) DB Error (Performing database upgrade): #012Query was: UPDATE recordedseek SET starttime = CONVERT_TZ(starttime, 'SYSTEM', 'UTC') ORDER BY starttime #012Error was: Driver error was [2/1062]:#012QMYSQL: Unable to execute query#012Database error was:#012Duplicate entry '71-0000-00-00 00:00:00-0-0' for key 'PRIMARY'#012 #012new version: 1304
Oct  6 12:58:51 media kernel: [ 2447.724713] init: mythtv-backend main process (3825) terminated with status 133
Oct  6 12:58:51 media kernel: [ 2447.724736] init: mythtv-backend respawning too fast, stopped
Oct  6 12:58:51 media mythlogserver: mythbackend[3826]: E CoreContext dbcheck.cpp:502 (UpgradeTVDatabaseSchema) Database schema upgrade failed.
Oct  6 12:58:51 media mythlogserver: mythbackend[3826]: E CoreContext main_helpers.cpp:548 (run_backend) Couldn't upgrade database to new schema
Oct  6 12:58:57 media mythlogserver: mythlogserver[3764]: I LogForward loggingserver.cpp:1204 (expireClients) Expiring client 00acdd276da00c43e8910b2ed6184a334e (#1)
Oct  6 12:58:57 media mythlogserver: mythlogserver[3764]: I LogForward loggingserver.cpp:1234 (expireClients) Starting 5min shutdown timer


More information about the mythtv-users mailing list