Upgrade to 2:33.1+fixes.202303020919 broke mythweb
Moderator: Forum Moderators
-
- Senior
- Posts: 244
- Joined: Thu Feb 23, 2023 8:55 pm
- Location: Safe outside my gilded cage
Upgrade to 2:33.1+fixes.202303020919 broke mythweb
The (html) error message had a link to creating a ticket, but I don't have a login, so I guess.... here?
Upgraded mythtv on backend to 2:33.1+fixes.202303020919.c273ed0f9a~ubuntu22.04.1, from v33.1+fixes.202302200304.c273ed0f9a~ubuntu22.04.1. This broke mythweb.
Updating /etc/apache2/sites-available/mythweb.conf with correct access info and restarting apache2 fixed the issue.
Tried to attach the backtrace, but "Sorry the board attachment quota has been reached." Anyway, it was trying to access mysql using user ''@'localhost'
Upgraded mythtv on backend to 2:33.1+fixes.202303020919.c273ed0f9a~ubuntu22.04.1, from v33.1+fixes.202302200304.c273ed0f9a~ubuntu22.04.1. This broke mythweb.
Updating /etc/apache2/sites-available/mythweb.conf with correct access info and restarting apache2 fixed the issue.
Tried to attach the backtrace, but "Sorry the board attachment quota has been reached." Anyway, it was trying to access mysql using user ''@'localhost'
-
- Senior
- Posts: 244
- Joined: Thu Feb 23, 2023 8:55 pm
- Location: Safe outside my gilded cage
Re: Upgrade to 2:33.1+fixes.202303020919 broke mythweb
Did it again....
mythweb -- http://mythbackend/mythweb/tv/upcoming
[Note: that error from mythweb is not the error we really want to see. That's a separate error where the code that is supposed to report a db connection error is also broken]
fix:
Code: Select all
mythtv-database/jammy,jammy 2:33.1+fixes.202303140136.7f288be61b~ubuntu22.04.1 all [upgradable from: 2:33.1+fixes.202303020919.c273ed0f9a~ubuntu22.04.1]
Code: Select all
Setting up mythtv-database (2:33.1+fixes.202303140136.7f288be61b~ubuntu22.04.1)
...
mysql 'hidden SECURITY_INFO' --execute=CREATE USER IF NOT EXISTS ''@'%' IDENTIFIED WITH mysql_native_password; ALTER USER ''@'%' IDENTIFIED BY 'lpoJ6DkO'; GRANT ALL ON .* TO ''@'%'; failed, (incorrect admin username/password or syntax?)
Try:
sudo dpkg-reconfigure mythtv-database
root@mythbackend:/var/log/mythtv# dpkg-reconfigure mythtv-database
mysql 'hidden SECURITY_INFO' --execute=CREATE USER IF NOT EXISTS ''@'%' IDENTIFIED WITH mysql_native_password; ALTER USER ''@'%' IDENTIFIED BY 'lpoJ6DkO'; GRANT ALL ON .* TO ''@'%'; failed, (incorrect admin username/password or syntax?)
Try:
sudo dpkg-reconfigure mythtv-database
Code: Select all
Fatal error: Uncaught Error: Undefined constant "tmpl" in /usr/share/mythtv/mythweb/modules/_shared/tmpl/_errors/site_down.php:19 Stack trace: #0 /usr/share/mythtv/mythweb/includes/errordisplay.php(186): require_once() #1 /usr/share/mythtv/mythweb/includes/database.php(97): tailored_error() #2 /usr/share/mythtv/mythweb/includes/init.php(43): require_once('...') #3 /usr/share/mythtv/mythweb/mythweb.php(20): require_once('...') #4 {main} thrown in /usr/share/mythtv/mythweb/modules/_shared/tmpl/_errors/site_down.php on line 19
fix:
Code: Select all
root@mythbackend:/var/log/mythtv# cp /etc/apache2/sites-available/mythweb.conf.dpkg-old /etc/apache2/sites-available/mythweb.conf
root@mythbackend:/var/log/mythtv# systemctl restart apache2
Re: Upgrade to 2:33.1+fixes.202303020919 broke mythweb
Hi,
Next time, I'd post a diff of the two files:
Hide the password if you like.
Next time, I'd post a diff of the two files:
Code: Select all
diff /etc/apache2/sites-available/mythweb.conf.dpkg-old /etc/apache2/sites-available/mythweb.conf
-
- Senior
- Posts: 244
- Joined: Thu Feb 23, 2023 8:55 pm
- Location: Safe outside my gilded cage
Re: Upgrade to 2:33.1+fixes.202303020919 broke mythweb
Sorry, thought I did. Probably put it in the file that wouldn't attach.
Hmm, I think I see the problem:
The backend/database used to run on a different machine. I assume that password in root's config.xml was generated when I installed on the new VM, it's not one I've ever used. And since I don't run things like mythtv-setup as root, it probably never got populated with the correct values. Everything else db related works fine, as mythtv's config.xml has the correct info, but the upgrade is running as root.
Probably also explains why I had to edit mythweb.conf when I first set up the new backend, even though it says it's no longer needed.
Code: Select all
mythbackend$ diff /etc/apache2/sites-available/mythweb.conf*
70,73c70,73
< setenv db_server ""
< setenv db_name ""
< setenv db_login ""
< setenv db_password "lpoJ6DkO"
---
> setenv db_server "localhost"
> setenv db_name "mythconverg"
> setenv db_login "mythtv"
> setenv db_password "i&wldf,,4"
Code: Select all
root@mythbackend:~/.mythtv# more config.xml
<Configuration>
<Database>
<PingHost>0</PingHost>
<Host></Host>
<UserName></UserName>
<Password>lpoJ6DkO</Password>
<DatabaseName></DatabaseName>
<Port>3306</Port>
</Database>
Probably also explains why I had to edit mythweb.conf when I first set up the new backend, even though it says it's no longer needed.
Last edited by white_haired_uncle on Fri Mar 24, 2023 2:35 am, edited 1 time in total.
Re: Upgrade to 2:33.1+fixes.202303020919 broke mythweb
See if this exists: /etc/mysql/debian.cnf (it's only readable by root). If it's there,
then try this: sudo mysql --defaults-file=/etc/mysql/debian.cnf . You should end
up with a mysql prompt.
The code where the 'hidden SECURITY_INFO' text prints was last changed in April of 2020.
then try this: sudo mysql --defaults-file=/etc/mysql/debian.cnf . You should end
up with a mysql prompt.
The code where the 'hidden SECURITY_INFO' text prints was last changed in April of 2020.
-
- Senior
- Posts: 244
- Joined: Thu Feb 23, 2023 8:55 pm
- Location: Safe outside my gilded cage
Re: Upgrade to 2:33.1+fixes.202303020919 broke mythweb
That works. This concerns me a bit:bill6502 wrote: ↑Fri Mar 24, 2023 2:30 amSee if this exists: /etc/mysql/debian.cnf (it's only readable by root). If it's there,
then try this: sudo mysql --defaults-file=/etc/mysql/debian.cnf . You should end
up with a mysql prompt.
The code where the 'hidden SECURITY_INFO' text prints was last changed in April of 2020.
Code: Select all
MariaDB [(none)]> select host,user from mysql.user;
+----------------+------------------+
| Host | User |
+----------------+------------------+
| % | |
| 172.30.219.% | mythtv |
| 172.30.219.110 | mythtv |
| 192.168.124.1 | mythtv |
| localhost | debian-sys-maint |
| localhost | mariadb.sys |
| localhost | mysql |
| localhost | mythtv |
| localhost | root |
+----------------+------------------+
If I were to update root's config.xml, and run dpkg-reconfigure mythtv-database, would that be a valid test? I do have a libvirtd snapshot taken just before the upgrade, but I've had recordings since then and I don't know enough about snapshots to know if I can make a second/current one, revert to the old one
to test, and then get back to where I am now.
Re: Upgrade to 2:33.1+fixes.202303020919 broke mythweb
I'd move the .mythtv directory to .was_mythtv or at least fix the empty <UserName></UserName>.
I don't have one on my test host. There was one last changed in 2014 on my production box. The
only file in it was config.xml (which matched my 'normal' config.xml files.)
I'm loathe to modify the packaging scripts to address this issue (even though I agree with you that
the missing name shouldn't cause an issue). If empty, a reasonable guess would be 'mythtv', but there
are users that don't use that and I don't want to stomp on their choices. Although I disagree with
not using the standard.
I don't have one on my test host. There was one last changed in 2014 on my production box. The
only file in it was config.xml (which matched my 'normal' config.xml files.)
I'm loathe to modify the packaging scripts to address this issue (even though I agree with you that
the missing name shouldn't cause an issue). If empty, a reasonable guess would be 'mythtv', but there
are users that don't use that and I don't want to stomp on their choices. Although I disagree with
not using the standard.
-
- Senior
- Posts: 244
- Joined: Thu Feb 23, 2023 8:55 pm
- Location: Safe outside my gilded cage
Re: Upgrade to 2:33.1+fixes.202303020919 broke mythweb
What's been bugging me is why /root/.mythtv/config.xml never got populated. Seems like that's destined to cause problems. While I didn't build the backend from source, I did notice this:
https://www.mythtv.org/wiki/Build_from_ ... base_Setup
Seems to me like that should be
sudo mythtv-setup
https://www.mythtv.org/wiki/Build_from_ ... base_Setup
Code: Select all
Run mythtv-setup. This will automatically create your database or upgrade your previous mythconverg database schema to the latest version:
mythtv-setup
If config.xml has not been created, setup will prompt for database info. You can then continue with setting up your system in mythtv-setup.
mythtv-setup
sudo mythtv-setup
Re: Upgrade to 2:33.1+fixes.202303020919 broke mythweb
mythtv-setup should be run as user mythtv. I updated the Wiki.