{"id":77,"date":"2013-12-30T03:20:24","date_gmt":"2013-12-30T03:20:24","guid":{"rendered":"http:\/\/www.eminozlem.com\/?p=77"},"modified":"2015-11-23T10:06:47","modified_gmt":"2015-11-23T10:06:47","slug":"the-server-quit-without-updating-pid-file-and-all-that-jazz","status":"publish","type":"post","link":"https:\/\/eminozlem.com\/tr\/the-server-quit-without-updating-pid-file-and-all-that-jazz\/","title":{"rendered":"The server quit without updating PID file and all that jazz."},"content":{"rendered":"<p><strong>The story:<\/strong><br \/>\nI was getting session file write errors (<em>write failed: No space left on device (28)<\/em> ) in wp admin, i checked <strong>\/tmp<\/strong> folder but it was <strong>not full<\/strong>, only 60% percent was used. So not being able to pinpoint what the problem was, i thought a reboot would be a good idea. But everything went straight to hell from there. The reboot returned with a &#8220;<strong>Error establishing a database connection<\/strong>&#8220;, so i went on to restart mysql. Needless to say it failed. While i was at it, i decided to upgrade mysql to 5.5 &#8211; but i dont know if that made matters worse, or effected it in any way.<br \/>\nI kept getting &#8216;unrecognized service&#8217; errors for <strong>mysql<\/strong> and <strong>mysqld <\/strong>in my restart attempts. Which made absolutely no sense because i was damn sure mysql was installed since i had a properly running server 10 minutes ago.<\/p>\n<p>Despite the fact that i was unable to start mysql, i was still able to access phpmyadmin. My tables seemed to be corrupt but i could not neither check or repair them. They were marked as <strong>#Unknown Storage Engine innodb<\/strong> &amp; <strong>in use<\/strong>.<\/p>\n<blockquote><p>Turns out; all the problem stemmed from \/tmp running out of &#8216;<strong>inodes<\/strong>&#8216;.But we&#8217;ll get to that.<\/p><\/blockquote>\n<p>Before i figured that out, i tried a lot of things. I removed(renamed) the <strong>host.domain.pid<\/strong> &amp;<strong> ib_logfile1<\/strong>,<strong> ib_logfile2<\/strong> files in <em>var\/lib\/mysql. <\/em>At this point i started to get <strong>The server quit without updating PID file<\/strong> errors. Google searches suggested restarting <em>mysqld<\/em> and it&#8217;d be taken care of, but i wasnt able to do that already. When i figured i was out of inodes by doing a <strong>#df -i <\/strong> as in the picture, i wondered what wore them out and found out it was <strong>eaccelerator.<\/strong> So i&#8217;ve cleaned up <strong>\/tmp\/eaccelerator<\/strong> folder and moved it to \/var\/cache\/eaccelerator, and defined it in php.ini as <strong>eaccelerator.cache_dir=&#8221;\/tmp\/eaccelerator&#8221; <\/strong>. Cleaning out the inodes, i was able to start mysql now. But my troubles wasnt done yet.<\/p>\n<p>I had a highly customized <strong>my.cnf<\/strong> and thought something might be conflicting. It didnt make any sense for a conflict to appear out of the blue, but to my surprise, something was. But i was already tired by now and definitely wasnt in the mood to go over tens of my.cnf lines to pinpoint the problematic line. So i chose one of the defaults inside <strong>\/usr\/share\/mysql\/<\/strong> . Dont worry, these mysql configs are specifically generated for your server so you should be fine, just pick one that suits you (i picked the most suitable one for me: #DESCR: 4GB RAM, few connections, heavy queries).<\/p>\n<p>I don&#8217;t know if it was the 5.5 mysql upgrade or something else i did along the way, but when i try to go in phpmyadmin, i was rejected with a <strong>#2002 Cannot log in to the MySQL server while trying to connect to phpmyadmin <\/strong>&amp; now i was welcomed by a shocking &#8220;wordpress install&#8221; page. Oddly enough, i had to reconfigure my phpmyadmin config &amp; accordingly wp config. Had to change connection type of phpmyadmin from tcp to socket and change &#8220;localhost&#8221; to &#8220;127.0.0.1&#8221; and again localhost to 127.0.0.1 in wp-config to reflect the changes.<\/p>\n<p>Yeah, so that&#8217;s all, those are what i ended up having to do. Maybe if i noticed i was out of inodes in the beginning, i wouldnt have to change a thing (other than the eaccelerator cache folder), eh, what you gonna do.. live &amp; learn.<\/p>\n<p><strong>Problems:<\/strong><br \/>\nIf your <strong>WordPress defaults-reverts to install screen<\/strong><br \/>\nif you get wp error: <strong>Error establishing a database connection<\/strong><br \/>\nIf your tables are marked<strong> #Unknown Storage Engine innodb<\/strong> or &#8216;<strong>in use<\/strong>&#8216; in phpmyadmin,<br \/>\nif you <strong>cannot start mysql<\/strong><br \/>\nIf you get mysqld: <strong>unrecognized service<\/strong> or mysql: unrecognized service when trying to start\/restart them.<br \/>\nIf you get <strong>#2002 Cannot log in to the MySQL server while trying to connect to phpmyadmin.<br \/>\n<\/strong>If you get <strong>WordPress database error: [Can&#8217;t create\/write to file &#8216;\/tmp\/#sql_xxxx.MYI&#8217; (Errcode: 28)]<\/strong><\/p>\n<p><strong>Causes:<\/strong><br \/>\nYour \/tmp is full (the fact that<strong> it has unused space doesnt mean it&#8217;s NOT FULL<\/strong>. It might have run out of <strong>inodes<\/strong> &#8211; read above)<br \/>\nYour phpmyadmin configuration is wrong.<br \/>\nYour wp-config is wrong.<\/p>\n<p><strong>Solutions:<\/strong><\/p>\n<p>Make sure your \/tmp folder is not full BOTH in terms of space &amp; inodes.<br \/>\nIf you are sure of that, check your my.cnf and try loading one of the default ones, see if that solves it.<br \/>\nCheck your phpmyadmin config &amp; your wp-config complies with it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The story: I was getting session file write errors (write failed: No space left on device (28) ) in wp admin, i checked \/tmp folder but it was not full, only 60% percent was used. So not being able to pinpoint what the problem was, i thought a reboot would be a good idea. But&#8230;<\/p>\n","protected":false},"author":1,"featured_media":78,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[18,2],"tags":[19,22,21,20,68],"class_list":["post-77","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","category-wordpress","tag-mysql","tag-phpmyadmin","tag-server","tag-ssh","tag-wordpress"],"acf":[],"_links":{"self":[{"href":"https:\/\/eminozlem.com\/tr\/wp-json\/wp\/v2\/posts\/77","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eminozlem.com\/tr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eminozlem.com\/tr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eminozlem.com\/tr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eminozlem.com\/tr\/wp-json\/wp\/v2\/comments?post=77"}],"version-history":[{"count":0,"href":"https:\/\/eminozlem.com\/tr\/wp-json\/wp\/v2\/posts\/77\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eminozlem.com\/tr\/wp-json\/wp\/v2\/media\/78"}],"wp:attachment":[{"href":"https:\/\/eminozlem.com\/tr\/wp-json\/wp\/v2\/media?parent=77"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eminozlem.com\/tr\/wp-json\/wp\/v2\/categories?post=77"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eminozlem.com\/tr\/wp-json\/wp\/v2\/tags?post=77"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}