[SOLVED] database connection fails on Fire Stick 4k Myth-Frontend

For discussion of topics specific to MythTV on Android devices
Post Reply
User avatar
AnalogBill
Junior
Posts: 29
Joined: Fri Feb 10, 2017 2:11 am
United States of America

[SOLVED] database connection fails on Fire Stick 4k Myth-Frontend

Post by AnalogBill »

Installed both full frontend and leanfront onto my Fire Tv Stick 4k. Lean Front found everything with no problems, but the full frontend isn't connecting to my database.
My setup has been a combined FE/BE, working fine for many years. A recent version upgrade made my remote control lose functionality so I thought this was the time to put an app on my Fire Tv Stick 4k.
Since the lean-frontend "just worked" I assume the full frontend should also. Setup screen is able to find my backend, but error is "unable to login"
Any ideas?
Last edited by AnalogBill on Sat Aug 21, 2021 10:01 pm, edited 1 time in total.
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: database connection fails on Fire Stick 4k Myth-Frontend

Post by jfabernathy »

If your previous system was a combo FE/BE, then maybe the remote capability is not turned on.
Make sure on your backend that you have in your /etc/mysql/mysql.conf.d/mythtv.conf

[mysqld]
bind-address=::
max_connections=100

The bind-address=:: is critical. Since I don't mess with mysql for anything else, I've never checked the other files but make sure there is not another bind-address that gets processed after this one and overrides it.

Also your backend setup in General -> Host backend setup -> Security Pin (Required) needs to be 0000.

Also make sure your backend IP addresses in backend setup are real, not 127.0.0.1.

After that and a reboot, you can use Firetv setup for apps and clear the cache data and all the other data for mythfrontend, then when it comes up, you can search and find the backend. At least that works for me.
User avatar
AnalogBill
Junior
Posts: 29
Joined: Fri Feb 10, 2017 2:11 am
United States of America

Re: database connection fails on Fire Stick 4k Myth-Frontend

Post by AnalogBill »

All settings correct except bind address was commented out. After fixing that, and a reboot, I did as you suggested clearing cache and data. A couple of things happened: Myth Frontend still isn't connecting, and the Lean Frontend is no longer connecting.
I suspect there is another mythtv.cnf file somewhere. Something to look for in the morning.
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: database connection fails on Fire Stick 4k Myth-Frontend

Post by jfabernathy »

As far as I know, Leanfront only needs the IP address of the backend, it you haven't changed any port numbers. Don't see why there is any related effect on it.
User avatar
AnalogBill
Junior
Posts: 29
Joined: Fri Feb 10, 2017 2:11 am
United States of America

Re: database connection fails on Fire Stick 4k Myth-Frontend

Post by AnalogBill »

Tried various changes today, broke my original FE/BE box, but now everything is working again. Interestingly, both LeanFront and Kodi had been setup and working fine using only my host name, not IP address. I changed both to use the IP, and they connected.
I'm wondering if I need to locate the /etc/mythtv/config.xml file on the remote FE. This is from my server, but shouldn't work on the remote FE:

<Database>
<PingHost>1</PingHost>
<Host>localhost</Host>
<UserName>mythtv</UserName>
<Password>mythtv</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>

FWIW, I changed <Host>localhost</Host> to <Host>ACTUAL HOSTNAME</Host> and also tried the real IP address. Both versions broke my box.

In searching for the bind-address locations I found that mine were not exactly in the same path as you suggested as I changed to the mariadb a couple of years ago. So
sudo grep --recursive bind.address /etc/mysql
got this
/etc/mysql/conf.d/mythtv.cnf:#bind-address=::
/etc/mysql/mariadb.conf.d/50-server.cnf:bind-address = 127.0.0.1

Again I tried various combinations of real IPs and actual host name, but they all broke my box.
Maybe I'm missing something basic...Shouldn't a combo FE/BE box and a couple of Fire Stick 4K installations be able to co-exist ?
User avatar
pgbennett
Developer
Posts: 504
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: database connection fails on Fire Stick 4k Myth-Frontend

Post by pgbennett »

Here are some things to check:
If a remote frontend is using upnp to connect to the backend, you need to have the actual ip address (not 127.0.0.1) in the config.xml on the backend.
In the fire stick setup you have to use actual ip addresses, not host names. (for both leanfront and mythfrontend)
If using mysql, the line "bind-address = 127.0.0.1" must be commented in the appropriate cnf file
If using mariadb, the line "bind-address = ::" must be set in the appropriate cnf file
User avatar
AnalogBill
Junior
Posts: 29
Joined: Fri Feb 10, 2017 2:11 am
United States of America

Re: database connection fails on Fire Stick 4k Myth-Frontend

Post by AnalogBill »

Thanks. The mariadb bind-address = :: was the fix. What is proper way to mark this as solved?
Post Reply