Opened 15 years ago

Closed 15 years ago

#6332 closed defect (invalid)

"Unexpected DB Schema version" and "requires an updated database schema" errors are misleading

Reported by: tmetro+mythtv-bugs@… Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: MythTV - General Version: 0.21-fixes
Severity: medium Keywords:
Cc: Ticket locked: no

Description

When running 0.21.0+fixes19878-0ubuntu0+mythbuntu2 of the front-end configured with a database user that doesn't have LOCK TABLES privilege, the following messages get logged:

2009-03-04 21:50:19.569 Connected to database 'mythconverg' at host: mythtv.example.com
2009-03-04 21:50:19.574 Using screen 0, 1920x1080 at 0,0
QString::arg(): Argument missing: ERROR: Unable to acquire database upgrade lock, Driver error was [2/1044]:
QMYSQL3: Unable to execute query
Database error was:
Access denied for user 'fringe'@'%' to database 'mythconverg'

2009-03-04 21:50:19.614 ERROR: Unable to acquire database upgrade lock
2009-03-04 21:50:19.618 Unexpected DB Schema version.  Waiting to see if DB is being upgraded.
[..."Unable to acquire database upgrade lock" error repeated several times...]
2009-03-04 21:50:24.670 ERROR: Unable to acquire database upgrade lock
2009-03-04 21:50:24.675 Timed out waiting.
2009-03-04 21:50:24.675 This version of MythTV requires an updated database schema. 
 Please run mythtv-setup or mythbackend to update your database.

This conclusion - that the schema needs to be upgraded - is incorrect (and sent me on a wild goose chase for a while). The error handling logic in the code that acquires a lock on the schema version table needs to be clarified and corrected so that it aborts earlier for permanent failures (and never even gets to the code that attempts to test the schema version, if none was acquired), and produces a more accurate error of what failed.

Change History (1)

comment:1 Changed 15 years ago by danielk

Resolution: invalid
Status: newclosed

Feature request without patch.

As a general rule you should always go by the first error message first, in this case "ERROR: Unable to acquire database upgrade lock... Access denied for user 'fringe'@'%' to database 'mythconverg'" While improving error reporting is generally a good thing, you need to provide at least a patch.

Note: See TracTickets for help on using tickets.