You are not logged in.

#1 2012-10-07 15:03:14

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,417
Website

Mythtv 0.26-1 manual restart mythbackend in order to connect [solved]

The recent v0.26 update has done something odd to my setup such that I have to manually restart mythbackend in order for my clients to connect.

What I did after updating:
1) Added the timezone info to mysql per the release notes
2) Deleted ~/.mythtv/mysql.txt and replaced it with an updated config.xml

The problem:
Systemd loads both mysqld and mythbackend along with all my other daemons just fine.  Mythfrontend comes up after lxde loads as usual.  But I get an annoying:

"Could not connect to the master backend server.  Is it running?  Is the IP address set for it in mythtv-set correct?"

My solution is to restart the backend and then everything works as it should.

Questions I cannot answer:
Why do I have to restart mythbackend now in order to maintain normal functionality?
Why does stopping mythbackend take 90 secs?  In the past it tooks 2-3 sec.

Details and Log files:
~/.mythtv/config.xml --> http://pastebin.com/3hGdu5xn

Output from updated mysql to include timezones --> http://pastebin.com/WgVLRjFX
Output of the timezone test --> http://pastebin.com/WEbSq1un
Output of updated the db --> http://pastebin.com/4HPUj80D

Log (mythbackend) from freshly booted system --> http://pastebin.com/4YdJLYka
Log (mythlogserver) from freshly booted system --> http://pastebin.com/cRf1jMuy
Log (mythfrontend) from freshly booted system --> http://pastebin.com/xVi176HL

NOW!  When I manually stop mythbackend (which takes 90 sec for some reason), and when I exit and reload the frontend, everything is fine.

Log (mythfrontend) AFTER the manual restart --> http://pastebin.com/iTKtyqFQ

Last edited by graysky (2012-10-07 19:23:39)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2012-10-07 15:13:30

DarkCerberus
Member
From: England, United Kingdom
Registered: 2011-12-31
Posts: 246

Re: Mythtv 0.26-1 manual restart mythbackend in order to connect [solved]

Have you tried to google your problems other's seem to have had similar problems on other distros:

http://ubuntuforums.org/showthread.php?t=1967516

Try updating your tuner drivers if possible.


"Time travel is not just some technological marvel. It's the family business." - Mr Escher - Continuum

Offline

#3 2012-10-07 15:33:44

boomshalek
Member
Registered: 2007-10-12
Posts: 96

Re: Mythtv 0.26-1 manual restart mythbackend in order to connect [solved]

graysky wrote:

The recent 0.26-1 update has done something odd to my setup such that I have to manually restart mythbackend in order for my clients to connect. "Could not connect to the master backend server.  Is it running?  Is the IP address set for it in mythtv-set correct?"

Could it be that the issue is a consequence of the MySQL Changes ?
- The format of config.xml has changed and mysql.txt is no longer used. Example:
- MySQL must have time zone tables added, see MySQL Time Zone Tables.

EDIT: I had to insert the MySQL Time Zone Tables, before the DB Update ran through on starting the frontend

Last edited by boomshalek (2012-10-07 15:35:44)

Offline

#4 2012-10-07 15:39:31

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,417
Website

Re: Mythtv 0.26-1 manual restart mythbackend in order to connect [solved]

@DarkC - Of course I have, but found nothing relevant.  I don't see the connection in the link you kindly posted.

@Boom - Are you experiencing the issue I described or does your setup work just fine?  Also, I missed the change to ~/.mythtv/config.xml and modified mine per the link you posted.  Same problem for me though sad

Last edited by graysky (2012-10-07 15:48:11)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2012-10-07 16:08:24

boomshalek
Member
Registered: 2007-10-12
Posts: 96

Re: Mythtv 0.26-1 manual restart mythbackend in order to connect [solved]

graysky wrote:

@Boom - Are you experiencing the issue I described or does your setup work just fine?

I had the same error message "Could not connect to the master backend server.  Is it running?  Is the IP address set for it in mythtv-set correct?" but the mythtv-setup log said something about the mysql timezone issue. Therefore I checked the changelog again and found the resolution which I pointed out in my first post. After adding the mysql time zone tables my setup performs normally.

Last edited by boomshalek (2012-10-07 16:10:37)

Offline

#6 2012-10-07 16:27:51

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,417
Website

Re: Mythtv 0.26-1 manual restart mythbackend in order to connect [solved]

@boom - OK thanks.  I updated per the wiki but am still experiencing the problems I described.  I edited my first post to include the output of the update process.

My timezone is US/Eastern, but the example from the mythtv wiki suggested to use the following which I did... that shouldn't matter, no?

mysql> SELECT CONVERT_TZ('2012-06-07 12:00:00', 'GMT', 'America/New_York');

Last edited by graysky (2012-10-07 16:58:50)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#7 2012-10-07 17:11:37

boomshalek
Member
Registered: 2007-10-12
Posts: 96

Re: Mythtv 0.26-1 manual restart mythbackend in order to connect [solved]

graysky wrote:

My timezone is US/Eastern, but the example from the mythtv wiki suggested to use the following which I did... that shouldn't matter, no?

mysql> SELECT CONVERT_TZ('2012-06-07 12:00:00', 'GMT', 'America/New_York');

Your timezone does not matter. This is what you CAN enter in order to test your MySQL Installation if it shows the correct time conversion of New York to your local time (It is just an example using ONE possible input, in this case NY)
But in ArchLinux's default, mysql cannot do this timezone conversion calculation therefore the expected output would be NULL as explained in the WIKI.
To enable it you have to run in a normal console (not in mysql commandline) the following command:

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p<yourpassword> mysql

Then mysql timezone conversions should have been enabled.

Last edited by boomshalek (2012-10-07 17:13:06)

Offline

#8 2012-10-07 19:12:00

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,417
Website

Re: Mythtv 0.26-1 manual restart mythbackend in order to connect [solved]

OK!  The whole database update was a ruse!  The cause is I believe that the network is not ready when mythbackend starts.

Clue from the backend log starting it not by systemd but in a script:

...
2012-10-07 15:07:52.606487 C  ServerPool: Host is configured to listen on 192.168.0.102, but address is not used on any local network interfaces.
2012-10-07 15:07:52.606648 I  Listening on TCP 127.0.0.1:6544
2012-10-07 15:07:52.606712 I  Listening on TCP [::1]:6544
2012-10-07 15:07:52.641782 I  Added logging to mythlogserver at TCP:35327
2012-10-07 15:07:53.806462 E  Bonjour: Error: -65537
2012-10-07 15:07:53.806474 E  Bonjour: Failed to register service.
2012-10-07 15:07:53.806485 I  Main::Registering HttpStatus Extension
2012-10-07 15:07:53.811393 C  Backend exiting, MainServer
...

Now I have the backend disabled from systemd but I start it from a script when lxde loads and all is well:

#!/bin/bash
export LANG="en_US.UTF-8"

#debug mythbackend
#lxterminal --geometry=150x40 -e bash -c "/usr/bin/mythbackend --logpath /tmp"

sleep 4s && mythbackend --logpath /tmp &
sleep 2s && mythfrontend --logpath /tmp &
sleep 6s && mpd &

So two questions remain:

1) Why did this change with 0.26 when the box has been running fine for years with no modifications?
2) Is the problem with my static network configuration in systemd?

% cat /etc/systemd/system/network.service 
[Unit]
Description=Network Connectivity
Wants=network.target
Before=network.target
 
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/etc/conf.d/network
ExecStart=/sbin/ip link set dev ${interface} up
ExecStart=/sbin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev ${interface}
ExecStart=/sbin/ip route add default via ${gateway}
ExecStop=/sbin/ip addr flush dev ${interface}
ExecStop=/sbin/ip link set dev ${interface} down

[Install]
WantedBy=multi-user.target
% cat /etc/conf.d/network
interface=eth0
address=192.168.0.102
netmask=255.255.255.0
broadcast=192.168.0.255
gateway=192.168.0.1

Last edited by graysky (2012-10-07 19:19:40)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#9 2012-10-07 19:23:13

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,417
Website

Re: Mythtv 0.26-1 manual restart mythbackend in order to connect [solved]

This is really confusing...

% grep After /usr/lib/systemd/system/mythbackend.service
After=network.target mysqld.service

Why doesn't systemd honor this?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#10 2012-10-08 19:19:22

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,417
Website

Re: Mythtv 0.26-1 manual restart mythbackend in order to connect [solved]

Just for closure, I bugged this both here and with upstream.

https://bugs.archlinux.org/task/31846
http://code.mythtv.org/trac/ticket/11160


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#11 2012-10-14 14:40:47

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,417
Website

Re: Mythtv 0.26-1 manual restart mythbackend in order to connect [solved]

OK!  The problem is related to the way I configured my static network using a network.service per a suggestion on https://wiki.archlinux.org/index.php/Systemd/Services which I have now deleted.  In short, configuring the network this way causes systemd to not detect when the network is up and can have down-stream consequences on daemons that require an active network such as mythbackend in [community]/mythtv for example.

USERS SHOULD MAKE USE OF [core]/netcfg FOR STATIC CONFIGURATIONS. I have edited the wiki.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB