Strange MySQL Error

mike-h30 wrote on Tuesday, November 24, 2009:

I was logged into openemr from off site when I suddenly lost connection to the application. I received this error:

Can’t create/write to file ‘/var/lib/mysql/.tmp/#sql_d31_0.MYI’ (Errcode: 30)

We have been using OpenEMR since version 2.83 ( currently using 3.0).  I did some googling on the subject but did not find a definitive answer. I was guessing that the Internet connection was down at the office because I was unable to ping the server.
So I drove to the office to investigate. The Internet was up as I could connect from other desktops and interestingly I could ping the server (SLES10-SP2) from inside the network although
I was not able to ping it from off site. The server display was unresponsive and remained black. I tried hitting several keys on the keyboard but was still unable to get the display to respond.
As a last resort I hit the power button and turned the server off (it has not been rebooted in a little over 2 months). I let it sit for a couple minutes then turned it back on.
Everything was fully functional and back to normal with no MySQL error message.

Here is the last line of the Apache error log before rebooting.

   PHP Notice:  Undefined index:  use_set_names_utf8 in /srv/www/htdocs/openemr/library/translation.inc.php on line 11, referer: http://XX.XXX.XXX.XXX/openemr/interface/patient_file/summary/patient_summary.php
PHP Warning:  Module ‘fileinfo’ already loaded in Unknown on line 0
  Apache/2.2.3 (Linux/SUSE) configured - resuming normal operations

Was this caused by the “PHP Notice: Undefined index”?

Thanks.

-Mike

bradymiller wrote on Tuesday, November 24, 2009:

hey,

Notices are generally just benign things, so wouldn’t attribute to that. Do a google search on ErrCode: 30 (it means a “read-only file system”) and brings up several pages, , that give your behavior that seem to be attributed to permission issues, corruption, disk full, or disk failings of the mysql directory/files. I’d check those things and for mysql database corruption with mysqlcheck command.

-brady

  : http://forums.opensuse.org/archives/sls-archives/archives-suse-linux/archives-general-questions/382734-mysql-errcode-30-a.html

mike-h30 wrote on Tuesday, November 24, 2009:

Thanks Brady! 

I will check out some more links on the matter.  I want to make sure that MySQL has not become corrupted.  I am going to run the “mysqlcheck” command you mention and look into other MySQL utilities.

-Mike

mike-h30 wrote on Tuesday, November 24, 2009:

From a database maintenance standpoint, how often should mysqlcheck be run?

-Mike

penguin8r wrote on Wednesday, November 25, 2009:

Might want to run an fsck on your /var filesystem too, problems in /var are no fun since MySQL lives there.  Lots of other important OS stuff in there too, so that might help to explain the server being locked up & unresponsive.
Some people run mysqlcheck nightly, I’m not sure that’s necessary, depends on the server load & number of active databases I suppose.  Running it weekly certainly wouldn’t hurt anything, & you can always cron it to run on the weekend when nobody’s using the system.

mike-h30 wrote on Wednesday, November 25, 2009:

Thanks penguin8r!

Perhaps I should put MySQL on its own partition.  I was thinking of doing that when I upgrade my server OS in the next couple of months.  Do you see any problems with having MySQL on its own partition?

-Mike