[Solved] mythtv-database (v.31) apt upgrade error

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
howdyhey
Junior
Posts: 37
Joined: Tue Jan 26, 2016 4:51 pm
United States of America

[Solved] mythtv-database (v.31) apt upgrade error

Post by howdyhey »

Doing an apt upgrade (on ubuntu 20.04.1) results in this error:

Code: Select all

Setting up mythtv-database (2:31.0+fixes.202008272139.ab0c38a476~ubuntu20.04.1) ...
mysql 'hidden SECURITY_INFO' --execute=CREATE USER IF NOT EXISTS 'mythtv'@'%' IDENTIFIED WITH mysql_native_password;             ALTER USER 'mythtv'@'%' IDENTIFIED BY 'TsBeeD3z';             GRANT ALL ON mythconverg.* TO 'mythtv'@'%'; mythconverg failed, (incorrect admin username/password or syntax?)
Try:
sudo dpkg-reconfigure mythtv-database
running sudo dpkg-reconfigure results in the same error.

Other than the error, mythtv is running just fine.

I'm running mariadb 10.4.
Last edited by howdyhey on Sat Aug 29, 2020 12:16 am, edited 1 time in total.
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: mythtv-database (v.31) apt upgrade error

Post by wesnewell »

No problems here running mysql Ver 8.0.21-0ubuntu0.20.04.4 for Linux on x86_64 ((Ubuntu))
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
howdyhey
Junior
Posts: 37
Joined: Tue Jan 26, 2016 4:51 pm
United States of America

Re: mythtv-database (v.31) apt upgrade error

Post by howdyhey »

presumably it's one of those wonky mariadb/mysql incompatibilities. Just flagging it for the devs.
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: mythtv-database (v.31) apt upgrade error

Post by bill6502 »

Hi,

The file in play here is: mythtv-database.postinst

The SECURITY_INFO, hidden for obvious reasons, is either from
the defaults file /etc/mysql/debian.cnf or entered manually via
prompts. It's the SQL root user which is automatically generated
and stored in the file in /etcmysql or (if that doesn't exist) one which
you picked during setup. The file in /etc/mysql should never be
changed, as it's used by the system. The SQL root password has nothing
to do with the linux root user's login, although nothing says they couldn't
be the same.

If the defaults file exists, cat it and try to login using the credentials in
it:

Code: Select all

$ sudo cat /etc/mysql/debian.cnf
[sudo] password for bill: 
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host     = localhost
user     = debian-sys-maint
password = someVeryLongString
...

$ mysql --user=debian-sys-maint --password=someVeryLongString mysql

Code: Select all

    if [ "$admin_username" = "debian-sys-maint" ]; then
        SECURITY_INFO="--defaults-file=/etc/mysql/debian.cnf"
    else
        db_get mythtv/mysql_host
        hostname="$RET"

        db_get mythtv/mysql_admin_password
        admin_password="$RET"

        if [ "$admin_password" != "" ]; then
            admin_password="-p$admin_password"
        fi
        SECURITY_INFO="--host=$hostname --user=$admin_username $admin_password"
    fi
howdyhey
Junior
Posts: 37
Joined: Tue Jan 26, 2016 4:51 pm
United States of America

Re: mythtv-database (v.31) apt upgrade error

Post by howdyhey »

mysql --user=debian-sys-maint --password=someVeryLongString mysql using the info in /etc/mysql/debian.conf works without error.
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: mythtv-database (v.31) apt upgrade error

Post by bill6502 »

When running: sudo dpkg-reconfigure, are you prompted for anything?
howdyhey
Junior
Posts: 37
Joined: Tue Jan 26, 2016 4:51 pm
United States of America

Re: mythtv-database (v.31) apt upgrade error

Post by howdyhey »

bill6502 wrote:
Fri Aug 28, 2020 5:24 pm
When running: sudo dpkg-reconfigure, are you prompted for anything?
asks whether other computers will run Mythtv (answered yes), then it crashes with the mysql error with the error in the OP.
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: mythtv-database (v.31) apt upgrade error

Post by bill6502 »

I did leave the --host=localhost line out of the test above. If that fails, need to
look at /etc/hosts (perhaps).

If not, I'd change this line in the file above, just adding the $:

Code: Select all

fail_database "mysql 'hidden SECURITY_INFO' --execute=$QUERY $database"

to

fail_database "mysql 'hidden $SECURITY_INFO' --execute=$QUERY $database"
to see what's being used. You can find the mythtv-database.postinst file with:
sudo updatedb && locate -b '\mythtv-database.postinst'

And, if the credentials are OK (shouldn't be the case based on the error message), I'd
manually do the three lines in the original error:

Code: Select all

CREATE USER IF NOT EXISTS 'mythtv'@'%' IDENTIFIED WITH mysql_native_password;
ALTER USER 'mythtv'@'%' IDENTIFIED BY 'TsBeeD3z';
GRANT ALL ON mythconverg.* TO 'mythtv'@'%';
The password above: TsBeeD3z, should be used in your config.xml.
howdyhey
Junior
Posts: 37
Joined: Tue Jan 26, 2016 4:51 pm
United States of America

Re: mythtv-database (v.31) apt upgrade error

Post by howdyhey »

1. adding the --host=localhost to the test worked fine.
2. changing the fail_database line in mythtv-database.postinst didn't make any difference with the error when doing the dpkg-reconfigure
3. doing the manual commands failed logging into mysql using the -user=debian-sys-maint, but worked using the -user=root

error with debian-sys-maint user:

Code: Select all

MariaDB [mysql]> GRANT ALL ON mythconverg.* TO 'mythtv'@'%';                                                                    
ERROR 1044 (42000): Access denied for user 'debian-sys-maint'@'localhost' to database 'mythconverg'
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: mythtv-database (v.31) apt upgrade error

Post by bill6502 »

SELECT * FROM user WHERE User IN ('root', 'debian-sys-maint')\G
howdyhey
Junior
Posts: 37
Joined: Tue Jan 26, 2016 4:51 pm
United States of America

Re: mythtv-database (v.31) apt upgrade error

Post by howdyhey »

Code: Select all

 mysql --user=root   mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 466
Server version: 10.4.14-MariaDB-1:10.4.14+maria~focal mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [mysql]> SELECT * FROM user WHERE User IN ('root', 'debian-sys-maint')\G
*************************** 1. row ***************************
                  Host: localhost
                  User: root
              Password: 
           Select_priv: Y
           Insert_priv: Y
           Update_priv: Y
           Delete_priv: Y
           Create_priv: Y
             Drop_priv: Y
           Reload_priv: Y
         Shutdown_priv: Y
          Process_priv: Y
             File_priv: Y
            Grant_priv: Y
       References_priv: Y
            Index_priv: Y
            Alter_priv: Y
          Show_db_priv: Y
            Super_priv: Y
 Create_tmp_table_priv: Y
      Lock_tables_priv: Y
          Execute_priv: Y
       Repl_slave_priv: Y
      Repl_client_priv: Y
      Create_view_priv: Y
        Show_view_priv: Y
   Create_routine_priv: Y
    Alter_routine_priv: Y
      Create_user_priv: Y
            Event_priv: Y
          Trigger_priv: Y
Create_tablespace_priv: Y
   Delete_history_priv: Y
              ssl_type: 
            ssl_cipher: 
           x509_issuer: 
          x509_subject: 
         max_questions: 0
           max_updates: 0
       max_connections: 0
  max_user_connections: 0
                plugin: mysql_native_password
 authentication_string: 
      password_expired: N
               is_role: N
          default_role: 
    max_statement_time: 0.000000
*************************** 2. row ***************************
                  Host: localhost
                  User: debian-sys-maint
              Password: *71C96AF47C7A7A5900A6647D8AC8455464DF6291
           Select_priv: Y
           Insert_priv: Y
           Update_priv: Y
           Delete_priv: Y
           Create_priv: Y
             Drop_priv: Y
           Reload_priv: Y
         Shutdown_priv: Y
          Process_priv: Y
             File_priv: Y
            Grant_priv: Y
       References_priv: Y
            Index_priv: Y
            Alter_priv: Y
          Show_db_priv: Y
            Super_priv: Y
 Create_tmp_table_priv: Y
      Lock_tables_priv: Y
          Execute_priv: Y
       Repl_slave_priv: Y
      Repl_client_priv: Y
      Create_view_priv: Y
        Show_view_priv: Y
   Create_routine_priv: Y
    Alter_routine_priv: Y
      Create_user_priv: Y
            Event_priv: Y
          Trigger_priv: Y
Create_tablespace_priv: N
   Delete_history_priv: N
              ssl_type: 
            ssl_cipher: 
           x509_issuer: 
          x509_subject: 
         max_questions: 0
           max_updates: 0
       max_connections: 0
  max_user_connections: 0
                plugin: mysql_native_password
 authentication_string: *71C96AF47C7A7A5900A6647D8AC8455464DF6291
      password_expired: N
               is_role: N
          default_role: 
    max_statement_time: 0.000000
2 rows in set (0.003 sec)
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: mythtv-database (v.31) apt upgrade error

Post by bill6502 »

On my 20.04 host running MySQL v8, Trigger_priv: Y, Create_tablespace_priv: Y.

And on my 20.04 host running MariaDB 10.3, debian-sys-maint doesn't exist in
the user's table. Someone (that would be me) changed the defaults file user to
root.
howdyhey
Junior
Posts: 37
Joined: Tue Jan 26, 2016 4:51 pm
United States of America

Re: mythtv-database (v.31) apt upgrade error

Post by howdyhey »

ok I granted all privileges to the debian-sys-maint user, and was able to run those 3 commands successfully. the dpkg-reconfigure also ran w/o error. so hopefully this solves the issues with the next update.

thanks!
Post Reply