MythWeb problems under Yosemite [They're Back!!]

For discussion of topics specific to MythTV on OSX
tvdave
Junior
Posts: 57
Joined: Sun Jun 29, 2014 10:11 am
Australia

MythWeb problems under Yosemite [They're Back!!]

Post by tvdave »

Since upgrading my Mac to Yosemite MythTV started doing some strange things.

The main issue is that the Mac Firewall is blocking the HTTPD. This means that I cannot access MythWeb unless I turn off the Mac firewall. The machine has a private IP address and only needs to be accessed internally (ideally from an iPad).

This is not just MythTV but even the default It Works! webpage so it is more of a Yosemite issue than MythWeb.

I cannot find any commands to permit HTTPD. Any ideas?

Another thing that I have noticed is that the Maria database can take 5 minutes to initialise. This makes it appear as if the Frontend cannot connect to the Backend. The Mac Mini is a Late 2012 i5 model with 4Gb RAM so it is not underresourced. This is more of a nuisance than a problem.

Other than that - when I upgraded to Yosemite, it was not pretty. Something ended up chewing resources so that the recordings for that week were choppy and unwatchable. That was after rebooting the device after Yosemite was installed. I ended up reinstalling MythTV to get it to work again. What are others' experiences with MythTV and Yosemite?
Last edited by tvdave on Sun Mar 15, 2015 11:19 pm, edited 2 times in total.
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: MythWeb problems under Yosemite (Firewall)

Post by pvr4me »

tvdave wrote:Since upgrading my Mac to Yosemite MythTV started doing some strange things.

The main issue is that the Mac Firewall is blocking the HTTPD. This means that I cannot access MythWeb unless I turn off the Mac firewall. The machine has a private IP address and only needs to be accessed internally (ideally from an iPad).

This is not just MythTV but even the default It Works! webpage so it is more of a Yosemite issue than MythWeb.

I cannot find any commands to permit HTTPD. Any ideas?
I'm not aware of any Yosemite-related issues. Most likely, you've missed one of the set-up or configuration steps. The instructions to configure MythWeb are, unfortunately, a bit tedious. Please go back and check each one carefully:

http://www.mythtv.org/wiki/MythWeb_via_MacPorts

What do you mean by a "private IP address"? (DHCP reservation?) Did you change the backend's IP address when you upgraded the OS? This could definitely cause problems for Myth.
Another thing that I have noticed is that the Maria database can take 5 minutes to initialise. This makes it appear as if the Frontend cannot connect to the Backend. The Mac Mini is a Late 2012 i5 model with 4Gb RAM so it is not underresourced. This is more of a nuisance than a problem.
The 5 minute delay could be Myth's backend. I've set it so that if mythbackend fails to start, it waits 5 minutes before trying again. (The default is 10 seconds which used to result in the ballooning logs if the backend was really borked. Check '/opt/dvr/var/log/mythtv.27/' for a mythbackendyyyymmddtttttt.nnn.log file created shortly after your restart. Perhaps it will identify what is happening.

If that doesn't shed any light, check the MariaDB log (file ending in .err in '/opt/dvr/var/db/mariadb/') and check the Console.app logs for start-up related messages.
Other than that - when I upgraded to Yosemite, it was not pretty. Something ended up chewing resources so that the recordings for that week were choppy and unwatchable. That was after rebooting the device after Yosemite was installed. I ended up reinstalling MythTV to get it to work again. What are others' experiences with MythTV and Yosemite?
As I said, I don't have any specific reports of Yosemite problems. More generally, it is not rare to have Spotlight problems create issues like you are describing. Spotlight can get wedged trying to index your disk(s) and ties up both the processor and (I think less often) a lot of disk i/o. Use Activity Monitor to look for processes hogging the CPU or disk activity.

Craig
Formerly the MacPorts guy.
tvdave
Junior
Posts: 57
Joined: Sun Jun 29, 2014 10:11 am
Australia

Re: MythWeb problems under Yosemite (Firewall)

Post by tvdave »

Hi Craig,

I have followed the instructions but it appears that the Apache built into OSX is running rather than the MacPorts version? Accessing localhost/MythWeb causes 404 errors. Even changing the index.html file in opt/dvr/apache2 does not reflect any changes.

Here is the error log from the Maria DB - it does not look great :-(

150228 22:14:11 InnoDB: Compressed tables use zlib 1.2.8
150228 22:14:11 InnoDB: Initializing buffer pool, size = 128.0M
150228 22:14:11 InnoDB: Completed initialization of buffer pool
150228 22:14:11 InnoDB: highest supported file format is Barracuda.
150228 22:14:11 InnoDB: Waiting for the background threads to start
150228 22:14:12 Percona XtraDB (http://www.percona.com) 5.5.38-MariaDB-35.2 started; log sequence number 4189608
150228 22:14:12 [Note] Server socket created on IP: '::'.
150228 22:14:12 [Note] Event Scheduler: Loaded 0 events
150228 22:14:12 [Note] /opt/dvr/lib/mariadb/bin/mysqld: ready for connections.
Version: '5.5.39-MariaDB' socket: '/opt/dvr/var/run/mariadb/mysqld.sock' port: 3306 Source distribution
150228 22:15:31 [Warning] IP address '192.168.0.225' could not be resolved: nodename nor servname provided, or not known
150228 22:15:32 [ERROR] mysqld: Table './mythconverg/settings' is marked as crashed and should be repaired
150228 22:15:32 [Warning] Checking table: './mythconverg/settings'
150228 22:15:39 [ERROR] mysqld: Table './mythconverg/program' is marked as crashed and should be repaired
150228 22:15:39 [Warning] Checking table: './mythconverg/program'
150228 22:18:55 [ERROR] mysqld: Table './mythconverg/oldrecorded' is marked as crashed and should be repaired
150228 22:18:55 [Warning] Checking table: './mythconverg/oldrecorded'
150228 22:18:58 [ERROR] mysqld: Table './mythconverg/recordmatch' is marked as crashed and should be repaired
150228 22:18:58 [Warning] Checking table: './mythconverg/recordmatch'
150228 22:21:33 [ERROR] mysqld: Table './mythconverg/eit_cache' is marked as crashed and should be repaired
150228 22:21:33 [Warning] Checking table: './mythconverg/eit_cache'

Given the issues - would a clean reinstall be the best solution? Or is it easy enough to repair?

Is it easy to uninstall the backend/frontend or would it be better to completely wipe the Mac and start again?
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: MythWeb problems under Yosemite (Firewall)

Post by pvr4me »

tvdave wrote:I have followed the instructions but it appears that the Apache built into OSX is running rather than the MacPorts version? Accessing localhost/MythWeb causes 404 errors. Even changing the index.html file in opt/dvr/apache2 does not reflect any changes.
Let's see if fixing the db problem resolves your MythWeb issues...
Here is the error log from the Maria DB - it does not look great :-(

...
150228 22:15:31 [Warning] IP address '192.168.0.225' could not be resolved: nodename nor servname provided, or not known
150228 22:15:32 [ERROR] mysqld: Table './mythconverg/settings' is marked as crashed and should be repaired
150228 22:15:32 [Warning] Checking table: './mythconverg/settings'
150228 22:15:39 [ERROR] mysqld: Table './mythconverg/program' is marked as crashed and should be repaired
150228 22:15:39 [Warning] Checking table: './mythconverg/program'
150228 22:18:55 [ERROR] mysqld: Table './mythconverg/oldrecorded' is marked as crashed and should be repaired
150228 22:18:55 [Warning] Checking table: './mythconverg/oldrecorded'
150228 22:18:58 [ERROR] mysqld: Table './mythconverg/recordmatch' is marked as crashed and should be repaired
150228 22:18:58 [Warning] Checking table: './mythconverg/recordmatch'
150228 22:21:33 [ERROR] mysqld: Table './mythconverg/eit_cache' is marked as crashed and should be repaired
150228 22:21:33 [Warning] Checking table: './mythconverg/eit_cache'

Given the issues - would a clean reinstall be the best solution? Or is it easy enough to repair?

Is it easy to uninstall the backend/frontend or would it be better to completely wipe the Mac and start again?
Do you have a backup of the machine? If not, I suggest you make one before doing anything else. Also, have you previously used '/opt/local/share/mythtv/mythconverg_backup.pl' to backup your MythTV database? If so, you might be able to restore a sound backup from before the tables crashed.

There is a script that _may_ be able to repair the crashed tables. It is located at:

Code: Select all

/opt/dvr/share/mythtv/contrib/optimize_mythdb.pl
Shut down the backend and paste that into Terminal and it should attempt the repair. Check the Terminal output for any errors it was unable to fix. There is a little bit of info at:

http://www.mythtv.org/wiki/User_Manual: ... e_Database

Assuming optimize_mythdb.pl is unsuccessful (given the number of crashed tables, pretty likely) and that you don't have a good, recent backup, you should drop the mythconverg database and go through setup again.

FWIW, crashed tables are pretty rare. I think they almost always happen due to a power failure at an unfortunate time. I run my backend machine on a UPS for just this reason.

Craig
Formerly the MacPorts guy.
tvdave
Junior
Posts: 57
Joined: Sun Jun 29, 2014 10:11 am
Australia

Re: MythWeb problems under Yosemite [Ignore]

Post by tvdave »

You were right - the machine borked completely. I wiped it, reloaded Yosemite, reloaded MythTV and everything is working smoothly including MythWeb, the backend etc. Now to make a good backup and get a UPS :D
tvdave
Junior
Posts: 57
Joined: Sun Jun 29, 2014 10:11 am
Australia

Re: MythWeb problems under Yosemite [They're Back!!]

Post by tvdave »

I spoke too soon!! Two weeks of joy then I enabled MythWeb as per the instructions. Everything went well until a reboot (I had to power down the Mac to install the UPS) and everything is back to the way it was!

The backend takes several minutes to get going. It does eventually work but clearly something is happening (nothing obvious in the logs) that is taking some to time to kick in. When you attempt to run the Myth Start/Stop script it says the backend is not running and you cannot start it so it isn't to do with the Frontend not communicating.
MythWeb only works if you disable the Mac Firewall - in other words the Firewall is blocking all attempts to access Apache.

It is a reasonably spec'ed 2012 Mac Mini - i5 processor with 4Gb RAM.

Any ideas??
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: MythWeb problems under Yosemite [They're Back!!]

Post by pvr4me »

If the backend is failing to load, there should be logs that indicate where it fell over. Please find the most recent mythbackend log file in '/opt/dvr/var/log/mythtv.27' and attach it here.

Given your previous problems, are there any database errors reported? Have you run optimize_mythdb.pl again?

Craig
Formerly the MacPorts guy.
tvdave
Junior
Posts: 57
Joined: Sun Jun 29, 2014 10:11 am
Australia

Re: MythWeb problems under Yosemite [They're Back!!]

Post by tvdave »

The current log file is 2.7Mb so I can't upload it. Here are some file from when I restarted the machine.

I will run the database fix as soon as I can as the machine is busy every night.

Thanks again for your help

David
Attachments
mythpreviewgen.20150315071151.888.log
Another log file
(4.41 KiB) Downloaded 108 times
mythfilldatabase.20150315062547.876.log
Log file
(6.44 KiB) Downloaded 121 times
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: MythWeb problems under Yosemite [They're Back!!]

Post by pvr4me »

tvdave wrote:The current log file is 2.7Mb so I can't upload it. Here are some file from when I restarted the machine.

I will run the database fix as soon as I can as the machine is busy every night.
No, the most recent mythbackend log from when it failed to start (not mythpreviewgen or mythfilldatabase).

Also, what about the database log?

Craig
Formerly the MacPorts guy.
tvdave
Junior
Posts: 57
Joined: Sun Jun 29, 2014 10:11 am
Australia

Re: MythWeb problems under Yosemite [They're Back!!]

Post by tvdave »

Hi Craig,

I ran the script - no errors. I ran Disk Utility - no errors and rebooted the machine. Here are the log file from the front and back end.
Attachments
mythfrontend.20150316191213.275.log
(85.18 KiB) Downloaded 91 times
mythbackend.20150316191144.19.log
(3.54 KiB) Downloaded 120 times
mythbackend.20150316191644.328.log
(7.38 KiB) Downloaded 108 times
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: MythWeb problems under Yosemite [They're Back!!]

Post by pvr4me »

So mythbackend<blah>.19.log clearly shows that the backend could not connect to the database.

As requested before, please supply the database log.

Craig
Formerly the MacPorts guy.
leejk
Junior
Posts: 65
Joined: Wed Mar 18, 2015 1:51 am

Re: MythWeb problems under Yosemite [They're Back!!]

Post by leejk »

tvdave wrote:I spoke too soon!! Two weeks of joy then I enabled MythWeb as per the instructions. Everything went well until a reboot (I had to power down the Mac to install the UPS) and everything is back to the way it was!

The backend takes several minutes to get going. It does eventually work but clearly something is happening (nothing obvious in the logs) that is taking some to time to kick in. When you attempt to run the Myth Start/Stop script it says the backend is not running and you cannot start it so it isn't to do with the Frontend not communicating.
MythWeb only works if you disable the Mac Firewall - in other words the Firewall is blocking all attempts to access Apache.

It is a reasonably spec'ed 2012 Mac Mini - i5 processor with 4Gb RAM.

Any ideas??
I had a similar issue with MythWeb after I had to change the IP address of my Mac Mini. MythWeb would not work anymore unless the firewall was off. I'm running Yosemite as well. It was only after I went back to the MythWeb install instructions and followed them to reinstall it did MythWeb start working with the firewall enabled. Maybe try that if you haven't already.

rgds
tvdave
Junior
Posts: 57
Joined: Sun Jun 29, 2014 10:11 am
Australia

Re: MythWeb problems under Yosemite [They're Back!!]

Post by tvdave »

Here is the error log from the database - sorry for being a bit dense.
Attachments
localhost.err.log
Error file (renamed with .log)
(14.53 KiB) Downloaded 115 times
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: MythWeb problems under Yosemite [They're Back!!]

Post by pvr4me »

tvdave wrote:Here is the error log from the database - sorry for being a bit dense.
You should have a database config file at '/opt/dvr/etc/mariadb/my.cnf'. If it does not exist, you missed the step that creates it:

Code: Select all

sudo cp /opt/dvr/share/mythtv/database/my.cnf /opt/dvr/etc/mariadb
If it does exist, please post here.

Also, please remind me what configuration you are running: machine (SSD?), os version, external drives, etc. Perhaps for some reason your machine boots very quickly and the network or something else is not ready for the database and/or Myth. I'm not aware of anyone else having this sort of problem, however.

Craig
Formerly the MacPorts guy.
leejk
Junior
Posts: 65
Joined: Wed Mar 18, 2015 1:51 am

Re: MythWeb problems under Yosemite [They're Back!!]

Post by leejk »

pvr4me wrote:So mythbackend<blah>.19.log clearly shows that the backend could not connect to the database.

As requested before, please supply the database log.

Craig
Seeing the same thing in my logs after a reboot. Normally it'll take several minutes after rebooting before the backend will be functional. No SSD drive or anything here. I said earlier that I had previously solved my MythWeb access problems with re-installing it, but I think once you reboot the machine or something it breaks again. Mine was working fine last night, but today you can't access it with the firewall turned on. All I've done today is reboot the Mac Mini, but I couldn't access it before the reboot either, so not sure rebooting is the cause. I've been reading thru this thread and thus far everything checks out here that's been mentioned.

Searching on the internet turned up a similar problem with mythbackend erroring after a reboot: http://ubuntuforums.org/showthread.php?t=1310458

I see that same type of error in my log:

Code: Select all

015-03-19 18:23:52.222969 C [19/2579] CoreContext main.cpp:129 (main) - Failed to init MythContext.
2015-03-19 18:23:52.224153 E [19/2579] CoreContext mmulticastsocketdevice.cpp:62 (MMulticastSocketDevice) - MMulticastSocketDevice(239.255.255.250:18): setsockopt - IP_ADD_MEMBERSHIP eno: Can't assign requested address (49)
Apparently the solution is to make the backend start later in the boot process, after the machine's IP address has been established. That could be contributing to the MythWeb problems maybe? Not sure how to do this tho on a Mac.
Post Reply