InMotion Hosting Support Center

Drupal Error cause crashed table

Category: Drupal 7

marcellom
Asked:
2014-06-18 6:37 pm EST

Hits: 1,425
Hi, during last 4 weeks
for 2 times my drupal website show an error into "semaphore" table...
I solved simply lounching the table repair function in PhpMyAdmin... But I'd like to know the reason of this problem... to solve it... I try to search this error message, but I didn't found anything interesting...
Could anyone help me or suggest something please?

Thanks!
Marcello
=================================================================================
Error

The website encountered an unexpected error. Please try again later.
Error message
PDOException: SQLSTATE[HY000]: General error: 145 Table './tper_tper/semaphore' is marked as crashed and should be repaired: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => variable_init ) in lock_may_be_available() (line 167 of/home/tper/public_html/includes/lock.inc).
Uncaught exception thrown in shutdown function.
PDOException: SQLSTATE[HY000]: General error: 145 Table './tper_tper/semaphore' is marked as crashed and should be repaired: DELETE FROM {semaphore} WHERE (value = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 53901627553a01652d5e581.16679255 ) in lock_release_all() (line 269 of /home/tper/public_html/includes/lock.inc).

==================================================================================

You must login before you can ask a follow up question.

You must login before you can submit an answer.

OTHER ANSWERS

0

JacobIMH
Staff
9,968 Points
2014-06-18 7:02 pm EST
Hello Marcello, and thanks for your question.

Was there anything that you've been doing in Drupal lately or MySQL before this table started to crash on you? Being that your site is on a VPS, anything related to your MySQL tables is going to be logged in your MySQL error log found at:

/var/lib/mysql/vpsXXXXX.inmotionhosting.com.err

It looks like the InnoDB database was not shut down properly before your tables started crashing on 6/1 and 6/17:

140601  8:09:39  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
...
140601 8:09:42 [ERROR] /usr/sbin/mysqld: Incorrect key file for table './tper_tper/semaphore.MYI'; try to repair it
140601 8:09:42 [ERROR] Got an error from thread_id=12, /home/rpmbuild/rpm-build/BUILD/mysql-5.5.36/mysql-5.5.36/storage/myisam/mi_write.c:226
140601 8:09:42 [ERROR] MySQL thread id 12, OS thread handle 0x7f5c788ba700, query id 1961 localhost tper_d7tper update
INSERT INTO semaphore (name, value, expire) VALUES ('cron', '219215740538b1806d1da94.90282662', '1401624822.86')
...
140601 8:31:38 [ERROR] /usr/sbin/mysqld: Table './tper_tper/semaphore' is marked as crashed and should be repaired


140617  2:51:05  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
...
140617 5:48:47 [ERROR] /usr/sbin/mysqld: Incorrect key file for table './tper_tper/semaphore.MYI'; try to repair it
140617 5:48:47 [ERROR] Got an error from thread_id=61477, /home/rpmbuild/rpm-build/BUILD/mysql-5.5.36/mysql-5.5.36/storage/myisam/mi_delete.c:121
140617 5:48:47 [ERROR] MySQL thread id 61477, OS thread handle 0x7f6a5bd2a700, query id 4191106 localhost tper_d7tper updating
DELETE FROM semaphore
WHERE (name = 'cron') AND (value = '392161749539fe4cc14e7f5.68802805') AND (expire <= '1402987964.27')
140617 6:12:43 [ERROR] /usr/sbin/mysqld: Table './tper_tper/semaphore' is marked as crashed and should be repaired


This can sometimes happen if the MySQL service is abruptly stopped without properly shutting down. Unfortunately I don't see anything in the MySQL logs giving an exact reason why it's crashing at times. Have you noticed any other problems other than just crashed tables with your MySQL databases?

- Jacob

You must login before you can post a comment about this answer.

Thanks Jacob, for your patience and for your info.
At the moment I did not notice any other problems in my Drupal than just crashed tables...
But I'm going to investigate better thanks your info.
Marcello
marcellom
35 Points
2014-06-19 4:59 am EST
Like this Question?

Forum Login

You are NOT logged in. You can still browse our Support Center.

To participate within our Community Support Forum:

Need more Help?

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!