2

I just emptied the cache in my Drupal database via MySQL, and all of a sudden I'm getting this error on my home page? Help! How can I fix this? It almost seems like a table was deleted by accident?

Original

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'databasename.entity_test_type' doesn't exist: SELECT et.* FROM {entity_test_type} et; Array ( ) in entity_test_entity_info() (line 73 of /var/www/drupal/true-001/sites/all/modules/contrib/entity/tests/entity_test.module).

Additional

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'databasename.locales_source' doesn't exist: SELECT lid, location FROM {locales_source} WHERE source = :source AND context = :context AND textgroup = 'default'; Array ( [:source] => An AJAX HTTP error occurred. [:context] => ) in _locale_parse_js_file() (line 1563 of /var/www/drupal/true-001/docroot/includes/locale.inc).

1 Answer 1

1

Yes that is correct, the errors are saying entity_test_type and locales_source do not exists. Try searching for them with PHPMyAdmin or any other DB viewer and you will very likely not find them. So yes, somehow those tables got deleted or possibly renamed?

Help! How can I fix this?

If they got deleted, you have the following options:

A) Disable and uninstall those modules, then enable them again and they should create the missing tables.

B) Revert back to a DB backup where those tables exist, then export the 2 tables only. Now revert back to your latest DB backup where they are missing and just import those 2 tables.

C) Manually re-create those tables with the proper column names

1
  • 1
    I agree with your answer, but I also find it suspecious to see those "databasename" occurences in both error messages. Maybe that rings other bells? BTW, for "b)", how about first creating a new backup "now", so that in the 2nd phrase of this bulet you revert to the now-backup? Commented Nov 25, 2016 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.