View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 10 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject: R6 issue after update
PostPosted: Fri Sep 25, 2009 5:52 pm 
Offline
Joined: Tue Jul 15, 2008 6:57 pm
Posts: 24
A few days ago I ran pacman -Syu. There were a couple of warning messages, but nothing that seemed sinister. I did not restart, and continued to run myth for a few days without issue.

Today I came home and found that mythtv was reporting "no recordings found". Being mostly a windows user, when something goes wrong my first instinct is to restart and see if it goes away, so I did that.

When the system came back up, instead of going into mythfrontend as usual, a screen came up asking me to select my preferred language, followed by a complaint that "No UPnP backends found", and then a Database Configuration screen.

After a little bit of poking I've found that mysql isn't starting
Code:
$ sudo sv status mysql
down: mysql: 0s, normally up, want up


and my disk is full (even though I have mythtv set to keep 15 GB of free disk space)
Code:
$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1              5044188   5043088         0 100% /
none                   1027760         0   1027760   0% /dev/shm
/dev/sda3            300595856 285326672         0 100% /myth

I tried deleting a file, but it didn't seem to free up any space.

I don't know if these are causes or symptoms, though.

How do I go about diagnosing what's going wrong here?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 25, 2009 6:07 pm 
Offline
Joined: Mon Nov 28, 2005 9:05 pm
Posts: 200
First find out where your disk space went. I had a pacman -Syu hose my myth database which was fixed by running a database repair. Look at running the optimize_db.sh script if your database is still giving you fits after you address your drive space issue..

_________________
Knoppmyth 7.02 Kernel 2.6.39-LINHES
[MBE] SilverStone LC-10 HTPC Case, Asus M2NPV-VM, AMD X2 4200+, 1G RAM, Nvidia 9500 PCIe, PVR500 and a HD-PVR - Rockin VDPAU


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 25, 2009 7:07 pm 
Offline
Joined: Tue Jul 15, 2008 6:57 pm
Posts: 24
I don't know what was up with deleting a file and not having the free space show up earlier, but I tried again and freed up some space in /myth; that didn't seem to help anything.

I looked around and found that /var/log/everything.log.1 and /var/log/messages.log.1 were >1gb in size. I deleted one of these and restarted, and apparently with some space free everything was able to start up normally.

So, why were these log files getting so big? Apparently they were filling up with this set of mesages repeated over and over:
Code:
Sep 25 17:06:30 mythtv mythbackend: QSqlQuery::exec: database not open
Sep 25 17:06:30 mythtv mythbackend: QSqlQuery::exec: database not open
Sep 25 17:06:30 mythtv mythbackend: 2009-09-25 17:06:30.560 DB Error (KickDatabase):
Sep 25 17:06:30 mythtv mythbackend: Query was:
Sep 25 17:06:30 mythtv mythbackend: SELECT NULL;
Sep 25 17:06:30 mythtv mythbackend: No error type from QSqlError?  Strange...
Sep 25 17:06:30 mythtv mythbackend: 2009-09-25 17:06:30.610 Cannot login to database?
Sep 25 17:06:30 mythtv mythbackend: 2009-09-25 17:06:30.610 Cannot login to database?
Sep 25 17:06:30 mythtv mythbackend:
Sep 25 17:06:30 mythtv mythbackend: Cannot login to database?
Sep 25 17:06:30 mythtv mythbackend:
Sep 25 17:06:30 mythtv mythbackend: Would you like to configure the database connection now? [yes]
Sep 25 17:06:30 mythtv mythbackend: [console is not interactive, using default 'yes']
Sep 25 17:06:30 mythtv mythbackend: Database host name: [localhost]
Sep 25 17:06:30 mythtv mythbackend: [console is not interactive, using default 'localhost']
Sep 25 17:06:30 mythtv mythbackend: Should I test connectivity to this host using the ping command? [yes]
Sep 25 17:06:30 mythtv mythbackend: [console is not interactive, using default 'yes']
Sep 25 17:06:30 mythtv mythbackend: Database non-default port: [0]
Sep 25 17:06:30 mythtv mythbackend: [console is not interactive, using default '0']
Sep 25 17:06:30 mythtv mythbackend: Database name: [mythconverg]
Sep 25 17:06:30 mythtv mythbackend: [console is not interactive, using default 'mythconverg']
Sep 25 17:06:30 mythtv mythbackend: Database user name: [mythtv]
Sep 25 17:06:30 mythtv mythbackend: [console is not interactive, using default 'mythtv']
Sep 25 17:06:30 mythtv mythbackend: Database password: [mythtv]
Sep 25 17:06:30 mythtv mythbackend: [console is not interactive, using default 'mythtv']
Sep 25 17:06:30 mythtv mythbackend: Unique identifier for this machine (if empty, the local host name will be used):
Sep 25 17:06:30 mythtv mythbackend: [console is not interactive, using default '']
Sep 25 17:06:30 mythtv mythbackend: Would you like to use Wake-On-LAN to retry database connections? [no]
Sep 25 17:06:30 mythtv mythbackend: [console is not interactive, using default 'no']
Sep 25 17:06:30 mythtv mythbackend: 2009-09-25 17:06:30.610 Unable to connect to database!
Sep 25 17:06:30 mythtv mythbackend: 2009-09-25 17:06:30.610 Driver error was [1/2002]:
Sep 25 17:06:30 mythtv mythbackend: QMYSQL3: Unable to connect
Sep 25 17:06:30 mythtv mythbackend: Database error was:
Sep 25 17:06:30 mythtv mythbackend: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)


So maybe something brought mysql down and then the logs filled up with reconnect messages?

Still, why did /myth fill up as well?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 26, 2009 2:53 am 
Offline
Joined: Sun Aug 28, 2005 7:07 pm
Posts: 821
Location: Melbourne, Australia
LastToKnow0 wrote:
Still, why did /myth fill up as well?


You'll probably find that /myth filled up first and the backend filled up /var/log/myth/mythbackend logging the resultant out of space errors. If you delete something that's in use the kernel will not free it up until the process that's using it and that may be what you're seeing. The myth backend process is probably using the files you're trying to delete.

I would:
1. Stop the backend, then the frontend before deleting anything.

2. In an xterm, delete things you know you don't want by zeroing them i.e.
Code:
su -c 'echo "" > /myth/tv/1002_20090925120000.mpg'

You'll need to enter the root password.

3. Zero the offending log file (or copy it to the /myth directory if you want to save it).

Now check the disk usage with df -h. If either is still at 100%, you can find out which process is using it. If, for example, /myth is still at 100% after you deleted /myth/afile, do this (as root):
Code:
lsof |grep \/myth\/afile

It should return a process id of whatever is using the file. Let's say it's pid 12345.
Code:
ps -ef|grep 12345
will tell you the process that's using it, and after you've determined that you want to, you can then kill (kill 12345) or restart the process.

I said to stop the backend first because it's really likely that you delete the log file and since the backend has this open, it won't free up the space. Stopping it first ensures you can free up the space straight away.

Don't start the backend yet. Tidy up the root file system (make sure you've now got plenty of space) and then run mysqlchecks on all of the mythconverg database tables. It's normal for some corruption to occur
(especially in your case where you've tried to start it) and either mysql won't start after the space is freed up or you'll get some undesireable behaviour happening. When all tables are checked/repaired, start the backend again and then the frontend and delete some more of what's filling up /myth.

Mike

_________________
*********************
LinHES 7.4
Australian Dragon
*********************


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 26, 2009 10:44 am 
Offline
Joined: Tue Jul 15, 2008 6:57 pm
Posts: 24
Well, I think I tracked down the problem.

Somehow I got into the situation where mythbackend was running as user mythtv, but all the files in /myth/tv were owned by root. That meant myth couldn't delete files to clean up space, so the disk filled up and things started to choke. I chown'ed everything in /myth/tv to mythtv:mythtv, and things seem to be running fine now; myth can delete files successfully.

Could updating have changed the user that mythbackend runs as from root to mythtv? Could something else have changed the files in /myth/tv to be owned by root? I guess the other option is that at some point I accidentally manually started mythbackend as root?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 26, 2009 11:16 am 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
All of the above are possibilities. File ownership problems have a nasty habit of creeping in during system maintenance when something is run or restarted as the wrong user.

Be sure to take a pass through the DB recovery process described on the wiki again now that you have some free disk space on the root partition. Mysql tends to get into a bad state when you run out of disk space


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 18, 2009 4:27 pm 
Offline
Joined: Fri May 30, 2008 11:49 am
Posts: 12
I did the upgrade today and after I worked through everything my wife tried to delete some files as we have 13% free space (1.5 tera) so when she would delete something it would come back a few seconds later. About a week ago I went through and deleted some items pre upgrade and it worked fine. I have never launched this guy from command line and in reality it has only been restarted a couple of times since it was fresh built in June with .09. I would suggest anyone else doing the upgrade check their myth/tv file system to make sure their recordings are owned by mythtv.

Fortunately I normally do some reading before taking the plunge and had read this before my wife reported the issue to me so it was a quick fix.

I ran the upgrade as root and I am pretty sure that is required but I didn't try it any other way. It went through with only one question which had already been covered on the forum.

Oh and it set the color (or hue) in mythfrontend on recordings and live tv to 0 causing all of the colors to be whacked out. A quick google revealed pressing F toggled through until I got to the offending setting which I set to 50% like the rest of them and voila.

Pretty painless upgrade barring those two issues and the harder one was already documented here.

As always the ease of this is what I love and thanks to all of you guys who make this possible. I can do it the hard way but why kill myself while making my wife mad!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 21, 2009 8:50 pm 
Offline
Joined: Sun May 31, 2009 6:28 pm
Posts: 2
I got bit by this permissions problem too. It showed up after I upgraded the R6 beta iso to the latest using pacman -Syu. This was the first time I ever tried pacman -Syu.

I did a chown mythtv:mytthv /myth/tv/* and things started working again.

My theory is that the backend used to run as root and now it doesn't.

Do I have stale recordings in /myth/tv? Is there a way to tell if I have orphan recordings in /myth/tv?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 22, 2009 4:43 am 
Offline
Joined: Mon Oct 09, 2006 11:27 am
Posts: 75
Location: Raleigh, NC
westrick85's theory is correct:

http://linhes.org/flyspray/index.php?do=details&task_id=248

It was fixed back in June


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 21, 2011 3:32 pm 
Offline
Joined: Mon Apr 10, 2006 3:48 pm
Posts: 997
Location: Lexington, Ky
FYI

Just ran the same symptom. I was getting the Country screen and No UPnP server message. After looking at the logs also noticed this statement in the backend log

Code:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)


I tried to touch a file as a normal user and got "permission denied" error.

Well it seems that prior to the last reboot I had un-tared several .gz files into /tmp one of them must have changed permissions.

chmod 777 /tmp

Followed by a reboot and the problem was resolved.

Put that one in you back pocket ....


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu