My site has been up and running for three months or so now with no major issues. Then I wake up this morning and load it up to be greeted by nothing but the following error:

Uncaught exception thrown in shutdown function.

PDOException: SQLSTATE[HY000]: General error: 1033 Incorrect information in file: './wishpatc_drupal2/semaphore.frm': DELETE FROM {semaphore} WHERE (value = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 14329979314e9b32f301b163.13621459 ) in lock_release_all() (line 269 of /home/wishpatc/public_html/includes/lock.inc).

It appears that somehow MySQL completely crashed overnight. If I try to repair the database I just get a list of the files that have been corrupted, but no progress on actually fixing anything.

There was one post about this issue several months ago, but just three different people saying they'd encountered the error and hadn't found any solution. I'm hoping hoping hoping there's something that can be done here. Any ideas?

Thanks for any help.

Comments

Codeblind’s picture

Addendum at the frontofem: How are you trying to repair the tables? Also, are the damaged tables InnoDB or MyISAM or something else?

Your tables are probably corrupt. If you have phpmyadmin installed, you can run check all tables and run CHECK TABLE and REPAIR TABLE and needed. If not, you may want to review the following Mysql docs:

http://dev.mysql.com/doc/refman/5.1/en/check-table.html

http://dev.mysql.com/doc/refman/5.1/en/repair-table.html

If things are really bad, you may require root access to mysql and/or the server to use some of the other repair tools.

penguinz’s picture

Ouch, my site just went down.

Uncaught exception thrown in shutdown function.
PDOException: SQLSTATE[HY000]: General error: 1033 Incorrect information in file: './zenpengu_main/semaphore.frm': DELETE FROM {semaphore} WHERE (value = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 6957029024eb325651bc5c4.19819344 ) in lock_release_all() (line 269 of /home/zenpengu/public_html/includes/lock.inc).

From phpMyAdmin, select main database, select all tables and run 'repair'
got this message on all tables.

repair Error Incorrect information in file: './zenpengu_main/ac...

Doesn't look good, could Mysql just trash every table?

faqing’s picture

I also got the same message for my two Drupal 7 sites. When I checked it at cpanel, I found the two databases (D7) are empty.
I am running Drupal 7.9. All Drupal 6 websites on the same server have no problem, but the two Drupal 7 databases corrupted.
I suspect Drupal 7 has a bug.

Update:
My two D7 sites are working now. The host company has restored last week's database. But the cause of this corruption of data is still unknown. I only know it is related to D7 database.

faqing’s picture

I also got the same message for my two Drupal 7 sites:

"PDOException: SQLSTATE[HY000]: General error: 1033 Incorrect information in file: './xxx/semaphore.frm': SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => variable_init ) in lock_may_be_available() (line 167 of /home/xxx/public_html/SMS/includes/lock.inc)."

When I checked it at cpanel, I found the two databases (D7) are empty. When I use phpmyadmin to check the database I got the following message:

1033: Incorrect information in file: './xxx/accesslog.frm' when using LOCK TABLE

I am running Drupal 7.9. All Drupal 6 websites on the same server have no problem, but the two Drupal 7 databases corrupted.

I suspect Drupal 7 has a bug.

What I can do now is to ask my host company to restore the database for me.

contractor’s picture

I just experienced the same issue on my two D7 sites that run on an ISP shared cloud server and which had been running well for several months.

My ISP experienced slowdown problems on that server earlier this morning, and when the sites came up (possibly after an ISP reboot?) both D7 sites displayed the same 1033 error as listed above whenever I attempted to access any part of the websites.

So the issue is not with a "1033 error" but rather that this is just happens to be displayed when the database gets wiped out and D7 wakes up; apparently its first task at startup is a look-see into the database to see if there is some type of a lock or semaphore present, IMHO. The real issue is is not a lock or semaphore specifically but rather that the entire database has been corrupted.

A closer examination via phpadmin revealed that both D7 databases were now zero (0) bytes in length - i.e., the tables were present but all records within them were gone.

My attempts to repair the D7 databases via phpadmin indicated there was nothing to repair - as if to say that the databases were fine but merely contained only empty tables. I thus was not sure whether all the db records were erased or whether there was a structural problem with the database.

As a test to determine if phpadmin was correctly reporting the situation I deleted all the (empty) tables and attempted to redefine the tables and to import their original data from a MySQL backup. I immediately got an error message (didn't write it down) indicating that something structure-wise was not going to allow this import to proceed. This means that although phpadmin thinks the database is not corrupted but merely empty that actually there was some corruption problem within it which was preventing me from importing into it, so I abandoned it completely and created a new database and imported successfully into it and got the D7 sites back online.

Note that I have a D6 site on the same server and it was completely unaffected.

So, my running guess is that there is some combination of events that will cause D7 to somehow send a bad SQL command to the database that wipes it out. Is this possible? Or is it something else?

TurtlePower’s picture

Similar problem for me... all Drupal 7 sites went down together and Drupal 6 were fine. The D7 databases showed 0 bytes in phpmyadmin so I thought they were corrupted and lost.

Some googling revealed that the problem could be related to the InnoDB engine, which had somehow become disabled in MySQL. While I was typing up a support ticket to my host, the MySQL server got restarted (maybe from another ticket?), InnoDB was enabled again and the D7 sites and databases were all fine again.

Hope that helps...

cspiker’s picture

This also appeared to be an InnoDB problem for me. Restarting MySQL server worked for me as well.

gjaswal’s picture

Yup. Restarting did nothing for me. At some point I'm just going to start all over again and learn my lesson and do periodic backups of my db.

wordup’s picture

This same thing just happened to me. After 2 days of bothering my host admins I found this post. I'm glad it's not just my imagination. Would really like to know the cause of this problem so I can avoid this situation in the future. BACK UP YOUR SITES FOLKS!!!

mydigitaladvertising’s picture

May 2013 - My sites all using drupal 7 have the:

PDOException: SQLSTATE[HY000]: General error: 1033 Incorrect information in file: './mydigital/semaphore.frm':

error. Not sure how to fix. Of course I can restore from backup, but I have so many Drupal sites on my server it is tough. Hoping someone can help me with this issue. This is terrible.

martin74’s picture

Same here last weekend my database got corrupted.

several drupal site beond repair.. im so depressed

faqing’s picture

Your host should have copied your database. Ask them to restore the database for you.