I recently updated our site to Drupal 7.26, as well as updated the Media and Entity modules, for security purposes. I followed the instructions carefully, including updating our staging/test site to be a mirror of the live site and performing the updates there first. Everything went fine on the test site; however, when I performed the same process on the live site, I received an error message, saying in brief:
Table 'dbtable.cache_page' doesn't exist
Regardless, nothing appeared broken; when I took the live site out of Maintenance Mode, everything displayed properly.
However, I can't clear caches: every time I do so, I get a useless error message: it gives no more information than, "there has been an error, try again later".
The Recent Log Messages contains an error message with the Location
http://www.mysite.com/admin_menu/flush-cache?token=something&destination=admin/reports/event/something
and the Message
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'database.cache_page' doesn't exist: TRUNCATE {cache_page} ; Array ( ) in cache_clear_all() (line 165 of /home/mysite/public_html/includes/cache.inc).
Does anyone know
- why this happens, especially considering no such problem happened on the test site?
- how to fix it?
Comments
OK, by referencing a related
OK, by referencing a related post at
https://drupal.org/node/2160645
I found other people have been having problems with missing 'cache_' tables. To that end, I tried to run the following SQL command on our MySQL database, using PHPMyAdmin:
However, I keep getting these error messages:
ERROR 1146 (42S02): Table 'db.cache_page' doesn't exist
Now, the command will run IF I use another table name like 'cache_pages', there's no problem- the table gets created without a hitch. But I can neither create, NOR rename to, the actual table I need. Anyone encounter this?
Do you see the table in your
Do you see the table in your database?
No, the table is not visible
No, the table is not visible in the database; I cannot create a table with the 'cache_page', nor can I create the table with another name and rename it to 'cache_page'.
It sounds like the table has
It sounds like the table has become corrupted somehow to the point of not being readable at all. Maybe try to drop it first, then recreate it?
A corrupted table makes sense
A corrupted table makes sense; it concurs with other research I have done. Problem now is, I have tried to drop the table and re-create it, and that doesn't work either: I get "Unknown table 'cache_page'" as an error message, but I still can't create the table. I THINK the user privileges I'm functioning with are insufficient, and have turned to our hosting tech support for assistance.
ISSUE CLOSED: The 'cache_page' table in the database was corrupt
The 'cache_page' table in the database was corrupt; it was removed by renaming the *.ibd file on the server:
Hopefully this will help the next person: if a Drupal 'cache_' table seems to disappear, and the Recent Log Messages includes a notice similar to this:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table '[database].cache_page' doesn't exist
then you can suspect a corrupt table is to blame.
For anyone who may come
For anyone who may come across this in the future, it's safe to delete and recreate cache_ tables, as the data is meant to be disposable. Other tables will cause issues, as the data is not meant to be disposable. Use with care.