1

I was having some issues with syncing a site to Acquia via their devdesktop application, and so I started doing some troubleshooting -- including trying to copy the database over to a new site. At some point during the process, I must have installed/uninstalled something that the site didn't like. The frontend of the site is still functional, but the admin side is toast, giving me the "The website encountered an unexpected error. Please try again later." error on every page. I tried repairing the key_value table, but phpmyadmin fails, stating that "The storage engine for the table doesn't support repair".

I've seen suggestions in other similar issues on how to properly drop and recreate this table. I'm hoping that somebody can provide similar help here, assuming that that is the issue.

If it's helpful, here's the full log that is returned via drush when I try to do something like drush pm-disable modulename. I have the feeling that it's mostly not applicable to this issue, but I figured it wouldn't hurt to include it.

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'jakesfireworksdev_dev.key_value_expire' doesn't exist in                                                                                                  [error]
/Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/lib/Drupal/Core/Database/Statement.php:59
Stack trace:
#0 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/lib/Drupal/Core/Database/Statement.php(59): PDOStatement->execute(Array)
#1 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/lib/Drupal/Core/Database/Connection.php(610): Drupal\Core\Database\Statement->execute(Array, Array)
#2 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php(81): Drupal\Core\Database\Connection->query('DELETE FROM {ke...', Array, Array)
#3 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/lib/Drupal/Core/Database/Query/Delete.php(55): Drupal\Core\Database\Driver\mysql\Connection->query('DELETE FROM {ke...', Array, Array)
#4 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php(165): Drupal\Core\Database\Query\Delete->execute()
#5 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/modules/update/update.module(642): Drupal\Core\KeyValueStore\DatabaseStorage->deleteAll()
#6 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/modules/update/update.module(258): update_storage_clear()
#7 [internal function]: update_themes_uninstalled(Array)
#8 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(402): call_user_func_array('update_themes_u...', Array)
#9 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/lib/Drupal/Core/Extension/ThemeInstaller.php(269): Drupal\Core\Extension\ModuleHandler->invokeAll('themes_uninstal...', Array)
#10 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/lib/Drupal/Core/Extension/ThemeHandler.php(173): Drupal\Core\Extension\ThemeInstaller->uninstall(Array)
#11 /Users/mrweiner/.composer/vendor/drush/drush/commands/core/drupal/environment.inc(320): Drupal\Core\Extension\ThemeHandler->uninstall(Array)
#12 /Users/mrweiner/.composer/vendor/drush/drush/commands/core/drupal/pm_8.inc(83): drush_theme_uninstall(Array)
#13 /Users/mrweiner/.composer/vendor/drush/drush/commands/pm/pm.drush.inc(1237): _drush_pm_uninstall(Array)
#14 /Users/mrweiner/.composer/vendor/drush/drush/includes/command.inc(422): drush_pm_uninstall('rdfui')
#15 /Users/mrweiner/.composer/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#16 /Users/mrweiner/.composer/vendor/drush/drush/includes/command.inc(199): drush_command('rdfui')
#17 /Users/mrweiner/.composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#18 /Users/mrweiner/.composer/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#19 /Users/mrweiner/.composer/vendor/drush/drush/drush.php(12): drush_main()
#20 {main}

Next Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'jakesfireworksdev_dev.key_value_expire' doesn't exist: DELETE FROM {key_value_expire} 
WHERE  (collection = :db_condition_placeholder_0); Array
(
    [:db_condition_placeholder_0] => update
)
 in /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/lib/Drupal/Core/Database/Connection.php:671
Stack trace:
#0 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/lib/Drupal/Core/Database/Connection.php(635): Drupal\Core\Database\Connection->handleQueryException(Object(PDOException), 'DELETE FROM {ke...', Array,
Array)
#1 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php(81): Drupal\Core\Database\Connection->query('DELETE FROM {ke...', Array, Array)
#2 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/lib/Drupal/Core/Database/Query/Delete.php(55): Drupal\Core\Database\Driver\mysql\Connection->query('DELETE FROM {ke...', Array, Array)
#3 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php(165): Drupal\Core\Database\Query\Delete->execute()
#4 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/modules/update/update.module(642): Drupal\Core\KeyValueStore\DatabaseStorage->deleteAll()
#5 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/modules/update/update.module(258): update_storage_clear()
#6 [internal function]: update_themes_uninstalled(Array)
#7 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(402): call_user_func_array('update_themes_u...', Array)
#8 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/lib/Drupal/Core/Extension/ThemeInstaller.php(269): Drupal\Core\Extension\ModuleHandler->invokeAll('themes_uninstal...', Array)
#9 /Users/mrweiner/Sites/devdesktop/jakesfireworksdev-dev/docroot/core/lib/Drupal/Core/Extension/ThemeHandler.php(173): Drupal\Core\Extension\ThemeInstaller->uninstall(Array)
#10 /Users/mrweiner/.composer/vendor/drush/drush/commands/core/drupal/environment.inc(320): Drupal\Core\Extension\ThemeHandler->uninstall(Array)
#11 /Users/mrweiner/.composer/vendor/drush/drush/commands/core/drupal/pm_8.inc(83): drush_theme_uninstall(Array)
#12 /Users/mrweiner/.composer/vendor/drush/drush/commands/pm/pm.drush.inc(1237): _drush_pm_uninstall(Array)
#13 /Users/mrweiner/.composer/vendor/drush/drush/includes/command.inc(422): drush_pm_uninstall('rdfui')
#14 /Users/mrweiner/.composer/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#15 /Users/mrweiner/.composer/vendor/drush/drush/includes/command.inc(199): drush_command('rdfui')
#16 /Users/mrweiner/.composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#17 /Users/mrweiner/.composer/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#18 /Users/mrweiner/.composer/vendor/drush/drush/drush.php(12): drush_main()
#19 {main}
0

It turns out that the table I was attempting to repair was key_value, and not key_value_expire which is what was throwing the error. I'm not sure what happened to the table, but it seems like something caused it to be deleted. I was able to import the key_value_expire table from another database and the error halted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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