Skip to main content

plesk won't start after tweaking mysql

i've had this happen to me again the other week and as always, felt like kicking myself for not remembering.

we do a lot of performance tuning on mysql, and as a result, we almost always manage to get plesk mangled. not its fault, it just can't run without mysql, doh.

not of preference, but plesk happens to be there to make handling domains easier, as a single editing point when you want to change something and not worry about missing something out.

so there's a custom /etc/my.cnf that we use, and with changes to limits done (both on mysql and via ulimit), you'd think that a reload of mysqld would do. (we use InnoDB btw)

normally, that's all you need to have mysqld read off the new settings. if you've grown so dependent on plesk (like i have), you would not notice that mysqld didn't actually start, and you will get an error when you load plesk, thinking that it's a plesk error:


ERROR: PleskMainDBException
MySQL query failed: Incorrect information in file: './psa/misc.frm'

0: /usr/local/psa/admin/plib/common_func.php3:218
db_query(string 'select param, val from misc')
1: /usr/local/psa/admin/plib/common_func.php3:497
get_param(string 'mysql41_compatible')
2: /usr/local/psa/admin/plib/common_func.php3:394
db_set_names()
3: /usr/local/psa/admin/plib/common_func.php3:373
db_connect_real(string 'localhost', string 'admin', string '********', string 'psa')
4: /usr/local/psa/admin/plib/common_func.php3:353
db_connect()
5: /usr/local/psa/admin/auto_prepend/auth.php3:82

even a restart of the plesk service will not work:


[root@jedi]# /etc/init.d/psa restart
Unable to query parameter by query select val from misc where param='mysql41_compatible': Incorrect information in file: './psa/misc.frm'
Unable to query parameter by query select val from misc where param='mysql41_compatible': Incorrect information in file: './psa/misc.frm'
Mysql error: Incorrect information in file: './psa/key_history.frm'
Processing config directory: /usr/local/psa/admin/conf/httpsd.*.include
Syntax OK
/usr/local/psa/admin/bin/httpsdctl restart: httpd restarted
ERROR 1033 (HY000) at line 1: Incorrect information in file: './psa/sessions.frm'

so this is a mysqld failing to start properly problem. to fix this, go to your mysql datadir and see if the sizes of your innodb log files match those in your .cnf. we usually set innodb_log_file_size = 256M and innodb_log_buffer_size = 256M in /etc/my.cnf.

if they don't match, stop mysqld, remove the ib_logfile0 and ib_logfile1 files, and start mysqld. be careful not to delete the ibdata1 or ibdata2 files or you lose your data. avoid using rm -r ib* (yea, wildcards and fast fingers give sysads their most stupefying moments)

innodb will recreate the log files to match your .cnf and mysqld now becomes available for plesk.

Comments

Popular posts from this blog

March was a good month. Not just because it's my birthday month, but I've been able to do more physical exercises as far as I'm allowed, and I've also been able to get through my first month back in the job. For the first couple of weeks, I thought I was going to do 4 hours a day at most, and turn up the heat bit by bit until I'm able to do 100% again. But I suppose having to rest over a month does have its toll. It took significant effort to try not go all in with guns blazing on the first day back at work. LOL Anyway, I'm trying something new this year. We've migrated our applications to a better platform, and we'd like to push that to the cloud this year. It'll obviously need a lot of liaising and cooperative work with other teams and domains so I'm going to do more engagement and solutioning than the usual engineering this time. Last week, we did a platform-related hackathon and a critical refresh across clusters. There's going to be a lo

On Planning and Reports

In my previous employment, I didn't have any problems with submitting reports, practically because we used a time management/monitoring tool and the reports sort of generated by themselves. So when submitting daily reports isn't the norm here at the unit, quarterly reports become quite tricky. I've resorted to referring to Google Calendar as most of the stuff we do are usually scheduled. I've also thought of logging everything on a text file and have pelican publish this to my website. Meantime, my reading list for the day as I decide on a workflow that will allow multiple teams to work on the university website: http://www.sitepoint.com/one-click-app-deployment-server-side-git-hooks/ http://stackoverflow.com/questions/425692/what-is-your-preferred-php-deployment-strategy https://www.digitalocean.com/community/tutorials/how-to-automate-php-app-deployment-process-using-capistrano-on-ubuntu-13

Thank you!

I am home, and enjoying my second lease in life, one slow day at a time. I have never been hospitalized for something as life-threatening as DHF with complications before, so it's a bit frustrating that even when I'm already out of the hospital, I could not move around as much as I want. I could not even attempt to lift and carry my son when he feels like asking me to hoist him up. I can only manage a few hours of work now and what's more disheartening is knowing that I can no longer recoup a week's worth of missed work. Well, that's how it is with us road warriors/freelancers. But I am alive. I survived my first bout against DHF + pneumonia, and I have God, family, and all the people He used to get to me, to thank for. So I'm taking this moment to write and thank EVERYONE who reached out, spread the word, contacted other people, prayed, donated blood, consoled my wife, watched over me when everyone else was exhausted, and so much more. You are all AWESOME and I