Mailing List Archive

Can not connect to database after upgrading to Debian Bookworm
Hello,

today I upgraded my system from Debian Bullseye to Bookworm which
included an upgrade of MythTV from 31 to 33.

All seemed to be upgraded successfully but when I now try to start
mythtv-setup it can not connect to the database.

Were there any known changes between 31 and 33 that I have missed?

Any help would be appreciated!

mythtv@htpc:~$ cat /home/mythtv/.mythtv/config.xml
<Configuration>
<UPnP>
<MythFrontend>
<DefaultBackend>
<DBHostPing>no</DBHostPing>
</DefaultBackend>
</MythFrontend>
<UDN>
<MediaRenderer>7a464548-ef68-4115-9eae-792646d63b5f</MediaRenderer>
</UDN>
</UPnP>
<LocalHostName>htpc</LocalHostName>
<Database>
<PingHost>1</PingHost>
<Host>127.0.0.1</Host>
<UserName>mythtv</UserName>
<Password>********</Password>
<DatabaseName>mythconverg</DatabaseName>
<Port>3306</Port>
</Database>
<WakeOnLAN>
<Enabled>0</Enabled>
<SQLReconnectWaitTime>0</SQLReconnectWaitTime>
<SQLConnectRetry>5</SQLConnectRetry>
<Command>echo 'WOLsqlServerCommand not set'</Command>
</WakeOnLAN>
</Configuration>

Here's the output:

mythtv@htpc:~$ mythtv-setup
libEGL warning: DRI3: failed to query the version
libEGL warning: DRI2: failed to authenticate
2023-10-28 19:26:35.625300 I Display: Requesting EGL for vendor 'Mesa Project, 1.5'
2023-10-28 19:26:35.784247 I Setup Avbruten (SIGINT) handler
2023-10-28 19:26:35.784267 I Setup Avslutad handler
2023-10-28 19:26:35.784293 I Setup Segmenteringsfel handler
2023-10-28 19:26:35.784309 I Setup Avbruten (SIGABRT) handler
2023-10-28 19:26:35.784325 I Setup Flyttalsfel handler
2023-10-28 19:26:35.784342 I Setup Otillåten instruktion handler
2023-10-28 19:26:35.784357 I Setup Bussfel handler
2023-10-28 19:26:35.784376 I Setup Realtidssignal 0 handler
2023-10-28 19:26:35.784390 I Setup Avringd handler
2023-10-28 19:26:35.784802 C mythtv-setup version: [v33.1] www.mythtv.org
2023-10-28 19:26:35.784809 C Qt version: compile: 5.15.8, runtime: 5.15.8
2023-10-28 19:26:35.784878 I Debian GNU/Linux 12 (bookworm) (i386)
2023-10-28 19:26:35.784883 N Enabled verbose msgs: general
2023-10-28 19:26:35.784915 N Setting Log Level to LOG_INFO
2023-10-28 19:26:35.797406 I Added logging to the console
2023-10-28 19:26:36.016777 N Using runtime prefix = /usr
2023-10-28 19:26:36.016782 N Using configuration directory = /home/mythtv/.mythtv
2023-10-28 19:26:36.016840 I Assumed character encoding: sv_SE.UTF-8
2023-10-28 19:26:36.019537 I Loading sv translation for module mythfrontend
2023-10-28 19:26:36.020001 I Using a profile name of: 'htpc' (Usually the same as this host's name.)
2023-10-28 19:26:36.020308 I Start up testing connections. DB 127.0.0.1, BE , attempt 0, status dbAwake, Delay: 2000
2023-10-28 19:26:37.021611 I Start up testing connections. DB 127.0.0.1, BE , attempt 1, status dbAwake, Delay: 2000
2023-10-28 19:26:42.026449 I Start up testing connections. DB 127.0.0.1, BE , attempt 2, status dbAwake, Delay: 2000
2023-10-28 19:26:42.037676 E DB Error (StorageGroup::StorageGroup()):
Query was:

Driver error was [1/]:
Driver not loaded
Database error was:
Driver not loaded

2023-10-28 19:26:42.038477 I Display: Defaulting to primary screen (HDMI-3)
2023-10-28 19:26:42.038494 I Display: Using screen 'HDMI-3' (Make: Dell Inc. Model: DELL U2715H-)
2023-10-28 19:26:42.038508 I Display: Qt screen pixel ratio: 1.00
2023-10-28 19:26:42.038528 I Display: Geometry: 2560x1440+0+0 Size(Qt): 597mmx336mm
2023-10-28 19:26:42.079192 W EDID: Chromaticity mismatch!
2023-10-28 19:26:42.143277 I VRR: No variable refresh rate support detected
2023-10-28 19:26:42.143317 N Display: Desktop video mode: 2560x1440 59.951Hz
2023-10-28 19:26:42.143322 N Display: Display is using sRGB colourspace
2023-10-28 19:26:42.143370 N Display: Supported HDR formats: Ingen
2023-10-28 19:26:42.143432 I InputHandler: Starting
...

/Peter
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Can not connect to database after upgrading to Debian Bookworm [ In reply to ]
> On Oct 28, 2023, at 1:53?PM, Peter Carlsson <peter.jm.carlsson@gmail.com> wrote:
>
> Hello,
>
> today I upgraded my system from Debian Bullseye to Bookworm which
> included an upgrade of MythTV from 31 to 33.
>
> All seemed to be upgraded successfully but when I now try to start
> mythtv-setup it can not connect to the database.
>

Check the logs of mythbackend to see why it isn’t starting. Log lines with ‘ E ‘ will help.

Also check to make sure mysql is running. Easiest is to do ps -ef | grep mysql.

Post relevant logs from myth back end to see what’s happening. Use pastebin.com <http://pastebin.com/> to share the logs from mythbackend.

Regards.
Re: Can not connect to database after upgrading to Debian Bookworm [ In reply to ]
On Sat, Oct 28, 2023 at 02:53:56PM -0400, Jay Harbeston wrote:
>
>
> > On Oct 28, 2023, at 1:53?PM, Peter Carlsson <peter.jm.carlsson@gmail.com> wrote:
> >
> > Hello,
> >
> > today I upgraded my system from Debian Bullseye to Bookworm which
> > included an upgrade of MythTV from 31 to 33.
> >
> > All seemed to be upgraded successfully but when I now try to start
> > mythtv-setup it can not connect to the database.
> >
>
> Check the logs of mythbackend to see why it isn’t starting. Log lines with ‘ E ‘ will help.
>
> Also check to make sure mysql is running. Easiest is to do ps -ef | grep mysql.
>
> Post relevant logs from myth back end to see what’s happening. Use pastebin.com <http://pastebin.com/> to share the logs from mythbackend.
>
> Regards.
>

> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org

Hello,

thanks for the quick answer. See https://pastebin.com/Uk4x8hN5 for the
mythbackend log and below for more information.

mythtv@htpc:~$ ps -ef | grep mariadb
mysql 20173 1 0 19:24 ? 00:00:01 /usr/sbin/mariadbd
mythtv 21759 20462 0 21:24 pts/0 00:00:00 grep mariadb

mythtv@htpc:~$ systemctl status mariadb
? mariadb.service - MariaDB 10.11.4 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; preset: enabled)
Active: active (running) since Sat 2023-10-28 19:24:27 CEST; 2h 0min ago
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Process: 20098 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Process: 20100 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 20102 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 20189 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 20191 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
Main PID: 20173 (mariadbd)
Status: "Taking your SQL requests now..."
Tasks: 8 (limit: 4915)
Memory: 207.5M
CPU: 5.578s
CGroup: /system.slice/mariadb.service
??20173 /usr/sbin/mariadbd

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Can not connect to database after upgrading to Debian Bookworm [ In reply to ]
>>
>
>> _______________________________________________
>> mythtv-users mailing list
>> mythtv-users@mythtv.org <mailto:mythtv-users@mythtv.org>
>> http://lists.mythtv.org/mailman/listinfo/mythtv-users
>> http://wiki.mythtv.org/Mailing_List_etiquette
>> MythTV Forums: https://forum.mythtv.org <https://forum.mythtv.org/>
>
> Hello,
>
> thanks for the quick answer. See https://pastebin.com/Uk4x8hN5 for the
> mythbackend log and below for more information.

Doesn’t look like your back end is running , as it isn’t making a connection to the database.

Someone on here will need to give you assistance as I am not familiar with using mariadb as the database, since I use mysql on ubuntu..

I’m sure there are some settings that will need to be tweaked for mariadb to make the connection, but I am not sure what they are.

You might search some of the mythtv mailing list archives for hints as this sounds like a familiar problem, or someone here on the list may chime in with hints. I know there are some ‘incantations’ required to make it work. :-)

Regards,
Re: Can not connect to database after upgrading to Debian Bookworm [ In reply to ]
On Sat, Oct 28, 2023 at 04:09:11PM -0400, Jay Harbeston wrote:
> >>
> >
> >> _______________________________________________
> >> mythtv-users mailing list
> >> mythtv-users@mythtv.org <mailto:mythtv-users@mythtv.org>
> >> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> >> http://wiki.mythtv.org/Mailing_List_etiquette
> >> MythTV Forums: https://forum.mythtv.org <https://forum.mythtv.org/>
> >
> > Hello,
> >
> > thanks for the quick answer. See https://pastebin.com/Uk4x8hN5 for the
> > mythbackend log and below for more information.
>
> Doesn’t look like your back end is running , as it isn’t making a connection to the database.
>
> Someone on here will need to give you assistance as I am not familiar with using mariadb as the database, since I use mysql on ubuntu..
>
> I’m sure there are some settings that will need to be tweaked for mariadb to make the connection, but I am not sure what they are.
>
> You might search some of the mythtv mailing list archives for hints as this sounds like a familiar problem, or someone here on the list may chime in with hints. I know there are some ‘incantations’ required to make it work. :-)
>
> Regards,

Yes, I think I recall a discussion about problems similar to mine some
time ago, but I could not find it in the maillist archive.

Thanks you for your time!

/Peter
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Can not connect to database after upgrading to Debian Bookworm [ In reply to ]
On 10/28/23 15:15, Peter Carlsson wrote:
> On Sat, Oct 28, 2023 at 04:09:11PM -0400, Jay Harbeston wrote:
>>>> _______________________________________________
>>>> mythtv-users mailing list
>>>> mythtv-users@mythtv.org <mailto:mythtv-users@mythtv.org>
>>>> http://lists.mythtv.org/mailman/listinfo/mythtv-users
>>>> http://wiki.mythtv.org/Mailing_List_etiquette
>>>> MythTV Forums: https://forum.mythtv.org <https://forum.mythtv.org/>
>>> Hello,
>>>
>>> thanks for the quick answer. See https://pastebin.com/Uk4x8hN5 for the
>>> mythbackend log and below for more information.
>> Doesn’t look like your back end is running , as it isn’t making a connection to the database.
>>
>> Someone on here will need to give you assistance as I am not familiar with using mariadb as the database, since I use mysql on ubuntu..
>>
>> I’m sure there are some settings that will need to be tweaked for mariadb to make the connection, but I am not sure what they are.
>>
>> You might search some of the mythtv mailing list archives for hints as this sounds like a familiar problem, or someone here on the list may chime in with hints. I know there are some ‘incantations’ required to make it work. :-)
>>
>> Regards,
> Yes, I think I recall a discussion about problems similar to mine some
> time ago, but I could not find it in the maillist archive.
>
> Thanks you for your time!
>
> /Peter
> _______________________________________

It's been a while since I've had database issues (knock on wood), but a
few times I've had to do things like dig around in the my.cnf (mariadb
usually still uses this file) and comment out "skip-networking."  You
should maybe also check the bind-address setting.

The other thing I noticed, although it shouldn't make a difference, is
in your pastebin you have 127.0.0.1 set as the address.  Change it to
"localhost" and see if that makes it difference.  At least one of my
installations years back wouldn't accept the actual address of the
backend, but would accept the machine name.  Go figure.

Jeremy

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Can not connect to database after upgrading to Debian Bookworm [ In reply to ]
On Sat, 28 Oct 2023 19:53:28 +0200, you wrote:

>Hello,
>
>today I upgraded my system from Debian Bullseye to Bookworm which
>included an upgrade of MythTV from 31 to 33.
>
>All seemed to be upgraded successfully but when I now try to start
>mythtv-setup it can not connect to the database.
>
>Were there any known changes between 31 and 33 that I have missed?

First, check that MariaDB is listening on the correct ports:

sudo netstat -nap | grep mariadb

I get this:

tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
4217/mariadbd
tcp6 0 0 :::3306 :::* LISTEN
4217/mariadbd
unix 2 [ ACC ] STREAM LISTENING 50057 4217/mariadbd
/run/mysqld/mysqld.sock
unix 3 [ ] STREAM CONNECTED 65860 4217/mariadbd
/run/mysqld/mysqld.sock
unix 3 [ ] STREAM CONNECTED 66100 4217/mariadbd
/run/mysqld/mysqld.sock
unix 3 [ ] STREAM CONNECTED 6942083
4217/mariadbd /run/mysqld/mysqld.sock
unix 3 [ ] STREAM CONNECTED 6942134
4217/mariadbd /run/mysqld/mysqld.sock
unix 3 [ ] STREAM CONNECTED 5828916
4217/mariadbd /run/mysqld/mysqld.sock
unix 3 [ ] STREAM CONNECTED 6868086
4217/mariadbd /run/mysqld/mysqld.sock
unix 3 [ ] STREAM CONNECTED 65928 4217/mariadbd
/run/mysqld/mysqld.sock
unix 3 [ ] STREAM CONNECTED 6942073
4217/mariadbd /run/mysqld/mysqld.sock

(Sorry, my email client wraps long lines)

The tcp6 line should only be there if your system has IPv6 enabled.
You may only have localhost enabled for tcp - if so, you should see
127.0.0.1:3306 listed as the listening port, and ::1:3306 for tcp6.

If MariaDB is listening properly, my guess would be that the problem
is that MariaDB has been upgraded and some new option is causing
problems. The sort of thing that comes to mind is the method used to
encrypt the login data. If it is now set to a method that MythTV does
not support, that could cause this problem. To see the method being
used, run this:

sudo mysql
show * from mysql.users\G
quit

That will list all the users in the mysql.user table. Look at the
"plugin:" line in the users that you use for MythTV. The "plugin:" is
the authentication plugin. If it does not show
"mysql_native_password", then that is the likely problem.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Can not connect to database after upgrading to Debian Bookworm [ In reply to ]
On Saturday 28 October 2023 10:11:06 PM (-05:00), Stephen Worthington
wrote:


...


> If MariaDB is listening properly, my guess would be that the problem

> is that MariaDB has been upgraded and some new option is causing

> problems. The sort of thing that comes to mind is the method used to

> encrypt the login data. If it is now set to a method that MythTV does

> not support, that could cause this problem. To see the method being

> used, run this:

>



FYI.


I've tried using caching_sha2_password on my MySQL server (so far):


SELECT Host,User,plugin FROM user WHERE User='mythtv';


I didn't print the authentication_string because it messes up the output,
but
this is working on my production backend:


+-----------+--------+-----------------------+
| Host | User | plugin |
+-----------+--------+-----------------------+
| % | mythtv | caching_sha2_password |
| localhost | mythtv | caching_sha2_password |
+-----------+--------+-----------------------+


The "Note" right at the beginning here:



https://dev.mysql.com/doc/refman/8.0/en/native-pluggable-authentication.html



says:


As of MySQL 8.0.34, the mysql_native_password authentication plugin is
deprecated and subject to removal in a future version of MySQL.


I haven't tried MariaDB yes.


--
Bill
Re: Can not connect to database after upgrading to Debian Bookworm [ In reply to ]
On Sun, Oct 29, 2023 at 04:11:06PM +1300, Stephen Worthington wrote:
> On Sat, 28 Oct 2023 19:53:28 +0200, you wrote:
>
> >Hello,
> >
> >today I upgraded my system from Debian Bullseye to Bookworm which
> >included an upgrade of MythTV from 31 to 33.
> >
> >All seemed to be upgraded successfully but when I now try to start
> >mythtv-setup it can not connect to the database.
> >
> >Were there any known changes between 31 and 33 that I have missed?
>
> First, check that MariaDB is listening on the correct ports:
>
> sudo netstat -nap | grep mariadb
>
> I get this:
>
> tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
> 4217/mariadbd
> tcp6 0 0 :::3306 :::* LISTEN
> 4217/mariadbd
> unix 2 [ ACC ] STREAM LISTENING 50057 4217/mariadbd
> /run/mysqld/mysqld.sock
>
> (Sorry, my email client wraps long lines)
>
> The tcp6 line should only be there if your system has IPv6 enabled.
> You may only have localhost enabled for tcp - if so, you should see
> 127.0.0.1:3306 listed as the listening port, and ::1:3306 for tcp6.

Thanks for making me look in the right direction!

It turned out that I had previously added a bind-address=:: that got
precedence.

I changed that to bind-address=0.0.0.0 and now the backend can connect
to the database.

Best regards,
Peter Carlsson
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Can not connect to database after upgrading to Debian Bookworm [ In reply to ]
On Sun, 29 Oct 2023 21:29:16 +0100, you wrote:

>Thanks for making me look in the right direction!
>
>It turned out that I had previously added a bind-address=:: that got
>precedence.
>
>I changed that to bind-address=0.0.0.0 and now the backend can connect
>to the database.

Right, I should have remembered that one. They changed the meaning of
:: from binding all IPv4 and IPv6 addresses to just binding IPv6
addresses. So you have to change it to * if you now want to bind all
IPv4 and IPv6 addresses. Using 0.0.0.0 will only bind all IPv4
addresses. I hate subtle breaking changes like that.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org