PDA

View Full Version : 0.23 Can't Connect to Backend



uncle hammy
April 16th, 2010, 11:22 PM
I just tried upgrading to 0.23 from 0.22 on 9.10. The upgrade went fine, I ran mythtv-setup, and the database upgrade appeared to go through fine. I then fired up the frontend (it's a BE/FE machine) and that upgrade also seemed to go fine. However, I was then greeted with a "Cannot connect to master backend is it running or the ip correct" message...continually.

I went through and checked everything I could think of. dpkg-reconfigure mythtv-common, dpkg-reconfigure mythtv-database, IP address settings on the frontend and backend setups, password from MySQL.txt, pgrep mythbackend to ensure it was running, reboots, etc, etc, with no luck. I ended up having to roll back to 0.22 because I have things going on tonight.

Anyone have any suggestions I can do when I try this again? Then again, I may just wait for 10.04 and do a fresh install.

ian dobson
April 17th, 2010, 02:46 PM
Hi,

Have a look at your mysql configuraion (my.cnf) an check if the server is only binding to a local address (localhost) rather than your external IP address.

Regards
Ian Dobson

uncle hammy
April 17th, 2010, 06:22 PM
I ended up going nuclear on it. I did a "Completely Remove" of all things mythtv and dropped my mythconverg table. Then installed fresh 0.23, confirmed it could connect with a new/empty mythconverg table. Once that was done, dropped mythconverg again and restored my backup and allowed the upgrade. Seems to be working.

tgm4883
April 17th, 2010, 06:25 PM
Can only guess without logs. I would post logs from both the frontend and backend

Lepy
April 18th, 2010, 02:46 AM
I had a similar issue doing a db restore on 9.10/.22. The default mysql port somehow had been changed, but restoring it to 3306 fixed the connection issues. I'm planning on upgrading my systems to 10.04/.23 tomorrow, so I'll see if this happens again.

mars76
April 18th, 2010, 04:14 AM
Hi All.

I updated my mythtv backend schema from 0.22 ro to.23 and i am having the same issue that OP has stated.

I ran the mythfilldatabase and it ran fine..

When i went to mythtv backend setup i see the following ports..

Local backend
IP: 127.0.0.1
Port : 6543 Status Port : 6544

Master backend
IP: 127.0.0.1
Port :6543

As i am running my frontend and backend on the same machine the IPs make sense..

When i checked the my.cnf file it has port 3306 .So i changed the local back end port to 3306 with no luck ??

And in the LOgs i see the following:

! Error: Jamu must be run on a MythTV backend. Local host (my-pvr) is not a MythTV backend.

With any -M option Jamu must be run on a MythTV backend
! Warning - Failed to connect to backend at 127.0.0.1:6543

MythContext: Connecting to backend server: 127.0.0.1:6543 (try 1 of 1)
2010-04-17 23:02:56.668 Connection to master server timed out.
Either the server is down or the master server settings
in mythtv-settings does not contain the proper IP address

Thanks

Lepy
April 18th, 2010, 07:47 AM
I don't know if this problem is similar to the one I had...but, the local backend port should stay 6543, so change it back.

Try testing your mysql connection from myth control-center to see if it is successful.

If so, but you still can't get mythfrontend to connect, make sure DBPort=3306 is set in ~/.mythtv/mysql.txt and all other relevant files and try again.

dannyboy79
April 19th, 2010, 09:24 PM
Hi All.

I updated my mythtv backend schema from 0.22 ro to.23 and i am having the same issue that OP has stated.

I ran the mythfilldatabase and it ran fine..

When i went to mythtv backend setup i see the following ports..

Local backend
IP: 127.0.0.1
Port : 6543 Status Port : 6544

Master backend
IP: 127.0.0.1
Port :6543

As i am running my frontend and backend on the same machine the IPs make sense..

When i checked the my.cnf file it has port 3306 .So i changed the local back end port to 3306 with no luck ??

And in the LOgs i see the following:

! Error: Jamu must be run on a MythTV backend. Local host (my-pvr) is not a MythTV backend.

With any -M option Jamu must be run on a MythTV backend
! Warning - Failed to connect to backend at 127.0.0.1:6543

MythContext: Connecting to backend server: 127.0.0.1:6543 (try 1 of 1)
2010-04-17 23:02:56.668 Connection to master server timed out.
Either the server is down or the master server settings
in mythtv-settings does not contain the proper IP address

Thanks
i noticed this happened to me also, the problem was that for some reason the password within mythtv-setup was chnaegd so it couldn't access mysql as user mythtv any longer. check that out.

tsp_2177
May 3rd, 2010, 04:23 AM
i noticed this happened to me also, the problem was that for some reason the password within mythtv-setup was chnaegd so it couldn't access mysql as user mythtv any longer. check that out.
i have this problem to guys i have fixed the password and got it working i thought but i still can't get it to connect and i continuously get the message that the ip address is wrong even though i've checked it a million times. any help?

David Grigor
May 3rd, 2010, 04:41 PM
On the same screen where you see this info:


Local backend
IP: 127.0.0.1
Port : 6543 Status Port : 6544

Master backend
IP: 127.0.0.1
Port :6543

Do you have the pin set to 0000. When I did my recent upgrade, If I play with using a pin other than 0000 It wouldn't connect even when syncing the remote frontends with the same pin. So first try with 0000 if you haven't already.

dannyboy79
May 3rd, 2010, 04:46 PM
i have this problem to guys i have fixed the password and got it working i thought but i still can't get it to connect and i continuously get the message that the ip address is wrong even though i've checked it a million times. any help?

does your box have a static ip? if so, hard code that in example: 192.168.0.2;
versus using loopback ip address of 127.0.0.1. if it's DHCP i am not sure if you should hard code in for example: 192.168.0.2 because if you have other devices on teh network, the ip's may change between shutdowns and startups. i use static ip's for everything on my network except my xbox 360's, UPNP and xbox live dont seem to like static ips.

jaripetteri
May 4th, 2010, 10:31 PM
I can connect backend only if I run mythbackend on terminal. Find out that then I have two backends running, one owned by mythtv and one owned by my username and I can connect to later one. What might be wrong here?

I have fresh install of 10.04 desktop and mythtv 0.23.

dannyboy79
May 5th, 2010, 03:27 PM
don't run mythbackend from the terminal. that's then running as your username and yes will create 2 instances of mythbackend. you want mythbackend to startup upon bootup and run by user mythtv. (you should have been added to the mythtv group when you ran mythtv-setup). there should be a service (upstart) or a init script (within /etc/init.d/) that tells mythbackend to start when the computer starts.
there maybe mutliple issues with your install. let's troubleshoot one at a time.

questions:
1. how did you install mythtv .23?
2. did you use mythbuntu or ubuntu + mythtv (what repo's are you using. mythbuntu auto-builds or just plain ubuntu repos? do you have proposed repo's enabled or backports enabled?
3. are you in the mythtv group?

id -Gn usernamehere
that should return all the groups you're in. mythtv should be listed
4. you did run mythtv-setup correct?
5. is mysqld running?

ps aux | grep mysqld
can you connect to it?

mysql -u mythtv -p
when it asks for the password, enter the password you find in /etc/mythtv/mysql.txt. that was the password created during your install of mythtv. it may also be located within your user's home directory here: ~/.mythtv/config.xml
If you can connect then we're making progress. If you can't you'll have to follow this great troubleshooting site.

https://help.ubuntu.com/community/MythTV/Install/Troubleshooting

good luck

circushair
May 6th, 2010, 05:49 AM
I ran into this problem as well. The frontend would not connect to the master backend on the same machine using 127.0.0.1.

When I stopped the mythbackend daemon and ran it from the shell I was able to connect with mythfrontend. I then killed the manual instance of mythbackend and started the background daemon again. Now Mythfrontend continues to connect with no issues.

I have no way of explaining this.

dannyboy79
May 6th, 2010, 04:19 PM
I ran into this problem as well. The frontend would not connect to the master backend on the same machine using 127.0.0.1.

When I stopped the mythbackend daemon and ran it from the shell I was able to connect with mythfrontend. I then killed the manual instance of mythbackend and started the background daemon again. Now Mythfrontend continues to connect with no issues.

I have no way of explaining this.

if you're running it from a shell, then most likely it is running as your user versus the mythtv user. if you're not in the mythtv group I don't think you can connect to the backend which is suppose to be running by user mythtv. just my 2 cents but it may be invalid info.

danb0087
May 15th, 2010, 04:50 PM
I was having the same problem described above:

Could not connect to backend.
Mysql is working, CAN login as mythtv

Found this thread:
http://www.gossamer-threads.com/lists/mythtv/users/431321

which points out that the logfile shows the backend trying to load the configuration mysql.txt from "/.mythtv/", instead of "/home/mythtv/.mythtv/

Temporarily fixed with the following (run from "/"):
sudo ln -s /home/mythtv/.mythtv/

Why it broke in the first place? Will it break again??

dannyboy79
May 17th, 2010, 02:48 PM
I was having the same problem described above:

Could not connect to backend.
Mysql is working, CAN login as mythtv

Found this thread:
http://www.gossamer-threads.com/lists/mythtv/users/431321

which points out that the logfile shows the backend trying to load the configuration mysql.txt from "/.mythtv/", instead of "/home/mythtv/.mythtv/

Temporarily fixed with the following (run from "/"):
sudo ln -s /home/mythtv/.mythtv/

Why it broke in the first place? Will it break again??
are you saying that you have a .mythtv in the root directory / or did you mean that it was loading the mysql.txt file from roots .mythtv directory? it make more sense that user root has a .mythtv directory. /root/.mythtv/

the above symlink command isn't complete either because there is no linkname or directory, you only a target. Besides that it is not correct. you don't want the mysql.txt file to be read from /root/.mythtv/ anyway. root shouldn't have a .mythtv folder. it's most likely because you ran mythtv-setup as root and you're not suppose to.

i may be wrong on all accounts but from my little bit of experience with mythtv i believe what I have said to be true

danb0087
May 19th, 2010, 01:23 AM
are you saying that you have a .mythtv in the root directory / or did you mean that it was loading the mysql.txt file from roots .mythtv directory? it make more sense that user root has a .mythtv directory. /root/.mythtv/

the above symlink command isn't complete either because there is no linkname or directory, you only a target. Besides that it is not correct. you don't want the mysql.txt file to be read from /root/.mythtv/ anyway. root shouldn't have a .mythtv folder. it's most likely because you ran mythtv-setup as root and you're not suppose to.

i may be wrong on all accounts but from my little bit of experience with mythtv i believe what I have said to be true

Allow me to clarify:

I created a symlink in the root directory. By root directory, I mean "/". Just to be clear, you can get to this directory with

>cd /

The symlink syntax I used only specifies a target. This creates a symlink with the same name as the target in the current directory. You'll notice I also said to create the symlink while in the root directory. There is probably a better synatax to create a symlink with more parameters, but this was easy for me and it worked.

As to why it worked:
Mythbackend was trying to load the config file from a directory that didn't exist. I created a symlink to the correct directory in "/". Now when it starts up, it still looks in the wrong place, but finds the link which takes it to the right place.

I'm not advocating this as a good fix - but my myth was broken and this got it working.

Please let me know if you have any more questions, or if you make an update to the packages in synaptic that will correct this latest problem. I would much rather fix this with update/upgrade.