Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#5250 closed defect (worksforme)

21-fixes mythtv-setup doesn't upgrade/install database

Reported by: udovdh@… Owned by: Isaac Richards
Priority: major Milestone: 0.21.1
Component: mythtv Version: 0.21-fixes
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Dropped the trunk database. Created the database using the mc.sql sript. Ran mythtv-setup:

2008-04-25 16:27:11.742 Using runtime prefix = /usr, libdir = /usr/lib 2008-04-25 16:27:11.774 DPMS is active. 2008-04-25 16:27:11.777 Empty LocalHostName?. 2008-04-25 16:27:11.778 Using localhost value of recorder 2008-04-25 16:27:11.833 New DB connection, total: 1 2008-04-25 16:27:11.863 Connected to database 'mythconverg' at host: localhost 2008-04-25 16:27:11.865 Closing DB connection named 'DBManager0' 2008-04-25 16:27:11.873 Primary screen 0. 2008-04-25 16:27:11.875 Connected to database 'mythconverg' at host: localhost 2008-04-25 16:27:11.878 Using screen 0, 720x576 at 0,0 2008-04-25 16:27:11.907 New DB connection, total: 2 2008-04-25 16:27:11.910 Connected to database 'mythconverg' at host: localhost 2008-04-25 16:27:11.913 Current Schema Version: 0 2008-04-25 16:27:11.916 DataDirectProcessor::FixProgramIDs() -- begin 2008-04-25 16:27:11.918 New DB DataDirect? connection 2008-04-25 16:27:11.920 Connected to database 'mythconverg' at host: localhost 2008-04-25 16:27:11.922 DB Error (Fixing program ids in recorded): Query was: UPDATE recorded SET programid=CONCAT(SUBSTRING(programid, 1, 2), '00', SUBSTRING(programid, 3)) WHERE length(programid) = 12 Driver error was [2/1146]: QMYSQL3: Unable to execute query Database error was: Table 'mythconverg.recorded' doesn't exist

2008-04-25 16:27:11.928 DB Error (Clear setting): Query was: DELETE FROM settings WHERE value = 'BackupDBLastRunStart' AND hostname is NULL; Driver error was [2/1146]: QMYSQL3: Unable to execute query Database error was: Table 'mythconverg.settings' doesn't exist

2008-04-25 16:27:11.929 DB Error (SaveSettingOnHost? query failure: ): Query was: INSERT INTO settings (value,data,hostname ) VALUES ( 'BackupDBLastRunStart', '2008-04-25 16:27:11', NULL ); Driver error was [2/1146]: QMYSQL3: Unable to execute query Database error was: Table 'mythconverg.settings' doesn't exist

2008-04-25 16:27:11.933 DB Error (StorageGroup::StorageGroup?()): Query was: SELECT DISTINCT dirname FROM storagegroup WHERE groupname = 'DB Backups' AND hostname = 'recorder' Driver error was [2/1146]: QMYSQL3: Unable to execute query Database error was: Table 'mythconverg.storagegroup' doesn't exist

2008-04-25 16:27:11.934 New DB connection, total: 3 2008-04-25 16:27:11.936 Connected to database 'mythconverg' at host: localhost 2008-04-25 16:27:11.939 SG(DB Backups) Error: Directory value for Default Storage Group is empty. Using hardcoded default value of '/mnt/store' 2008-04-25 16:27:11.940 SG(DB Backups) Error: FindNextDirMostFree?: '/mnt/store' does not exist! 2008-04-25 16:27:11.941 Backing up database to file: /tmp/mythconverg--20080425162711.sql 2008-04-25 16:27:11.975 DBUtil Error: Error backing up database: mysqldump --defaults-extra-file='/tmp/mythtv_db_backup_conf_w0MfvS' --host='localhost' --user='mythtv' --add-drop-table --add-locks --allow-keywords --complete-insert --extended-insert --lock-tables --no-create-db --quick 'mythconverg' > '/tmp/mythconverg--20080425162711.sql' 2>/dev/null (512) 2008-04-25 16:27:11.978 DB Error (Clear setting): Query was: DELETE FROM settings WHERE value = 'BackupDBLastRunEnd' AND hostname is NULL; Driver error was [2/1146]: QMYSQL3: Unable to execute query Database error was: Table 'mythconverg.settings' doesn't exist

2008-04-25 16:27:11.980 DB Error (SaveSettingOnHost? query failure: ): Query was: INSERT INTO settings (value,data,hostname ) VALUES ( 'BackupDBLastRunEnd', '2008-04-25 16:27:11', NULL ); Driver error was [2/1146]: QMYSQL3: Unable to execute query Database error was: Table 'mythconverg.settings' doesn't exist

2008-04-25 16:27:12.038 Primary screen 0. 2008-04-25 16:27:12.041 Using screen 0, 720x576 at 0,0 2008-04-25 16:27:12.047 Switching to square mode (blue) 2008-04-25 16:27:12.123 Using the Qt painter 2008-04-25 16:27:12.124 lirc_init failed for mythtv, see preceding messages 2008-04-25 16:27:12.126 JoystickMenuClient? Error: Joystick disabled - Failed to read /root/.mythtv/joystickmenurc 2008-04-25 16:27:18.798 DB Error (Clear setting): Query was: DELETE FROM settings WHERE value = 'Language' AND hostname = 'recorder' ; Driver error was [2/1146]: QMYSQL3: Unable to execute query Database error was: Table 'mythconverg.settings' doesn't exist

2008-04-25 16:27:18.799 DB Error (SaveSettingOnHost? query failure: ): Query was: INSERT INTO settings (value,data,hostname) VALUES ( 'Language', 'EN', 'recorder' ); Driver error was [2/1146]: QMYSQL3: Unable to execute query Database error was: Table 'mythconverg.settings' doesn't exist

2008-04-25 16:27:18.802 DB Error (Clear setting): Query was: DELETE FROM settings WHERE value = 'Language' AND hostname = 'recorder' ; Driver error was [2/1146]: QMYSQL3: Unable to execute query Database error was: Table 'mythconverg.settings' doesn't exist

2008-04-25 16:27:18.803 DB Error (SaveSettingOnHost? query failure: ): Query was: INSERT INTO settings (value,data,hostname) VALUES ( 'Language', 'EN', 'recorder' ); Driver error was [2/1146]: QMYSQL3: Unable to execute query Database error was: Table 'mythconverg.settings' doesn't exist

2008-04-25 16:27:21.528 Couldn't upgrade database to new schema.

I do see dB connections in the processlist of mysql. mysql.txt is present.

Change History (5)

comment:1 Changed 16 years ago by sphery <mtdean@…>

I just spent about 3 hours testing the creation of the DB schema in an empty database (as created with mc.sql). The only way I could get a failure like the above (i.e. where the only output is, "Couldn't upgrade database to new schema," was by selecting, "Exit," rather than, "Upgrade," when prompted for permission to upgrade the DB. (I ran at least 10 different tests trying everything I could think of short of modifying the MySQL privileges for the mythtv user--since mc.sql, when executed properly, sets them.)

Note, also, that all of the DB Errors shown above are expected on a new install (i.e. from trying to set settings before the schema is created).

The only real error is, "Couldn't upgrade database to new schema."

Although the database backup failed with, "DBUtil Error: Error backing up database: mysqldump ... (512)," where the specified status code is typically due to improper MySQL permissions (probably MySQL GRANTs since mythtv-setup was able to connect to a database), such a failure is possible for the built-in backup even on a properly-configured system, so this is not proof of an issue.

In discussion with the reporter ( http://mythtv.org/pipermail/mythtv-users/2008-April/221030.html and http://mythtv.org/pipermail/mythtv-users/2008-April/221033.html ), the reporter said he selected, "Upgrade," not, "Exit." He also complained of segfaults while setting up ( http://mythtv.org/pipermail/mythtv-users/2008-April/221027.html ), then said, "After some tinkering setup ran. (all of a sudden)", but didn't provide details about what "tinkering" occurred.

This definitely worksforme. Without more information, I cannot think of any way to duplicate it. This log does not look like the log that would occur with an actual failure to upgrade the schema. It's missing some information, such as the errors that should be logged for MYTH_SCHEMA_ERROR and the "Newest Schema Version" line, which should always be output in the event that "Upgrade" is selected at the prompt--meaning it didn't even get to doUpgradeTVDatabaseSchema()).

comment:2 Changed 16 years ago by Nigel

(In [17165]) Also test for DBSchemaVer of 0, which some users' setups are returning. See #5250, #5267

comment:3 Changed 16 years ago by Nigel

(In [17166]) Also test for DBSchemaVer of 0, which some users' setups are returning. See #5250, #5267

comment:4 Changed 16 years ago by stuartm

Resolution: worksforme
Status: newclosed

comment:5 Changed 16 years ago by udo

Did I, reporter, implicitly or explicitly check the fix and did I give approval?

Note: See TracTickets for help on using tickets.