After updating features from 2.5 to 2.6 when I rebuild my site using Drush I get this error:

WD php: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ff_dev.cache_features' doesn't [error]
exist: TRUNCATE {cache_features} ; Array
(
)
in cache_clear_all() (line 167 of /home/drupalpro/websites/ff.dev/includes/cache.inc).
Cannot modify header information - headers already sent by (output started at [warning]
/home/drupalpro/drush/includes/output.inc:37) bootstrap.inc:1232
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ff_dev.cache_features' doesn't exist: TRUNCATE {cache_features} ; Array
(
)
in cache_clear_all() (line 167 of /home/drupalpro/websites/ff.dev/includes/cache.inc).

Comments

leewoodman created an issue. See original summary.

njbarrett’s picture

Category: Bug report » Support request
Priority: Major » Normal

Can you verify whether the table it is trying to truncate exists? `ff_dev.cache_features`
If not try uninstalling the module and reinstalling.

jrearick’s picture

I am getting the same error when trying to drush up features from 2.5 to 2.6. The only thing I can think of is that this site just doesn't have any features installed, so there is nothing to cache and the cache_features table never got created.

I was able to get around the issue by creating an empty table called cache_features, didn't need to match the correct schema. Ran drush up features, then deleted the table to make sure if and when I do need the table it will be created properly.

Uninstalling and reinstalled would have probably worked too.

mpotter’s picture

Did you run the update hooks via "drush updb" or the /update.php script? There is an update hook in Features 2.6 that creates that table. You should ALWAYS run update hooks after downloading new module versions.

/**
 * Add {cache_features} table.
 */
function features_update_7200() {
  if (!db_table_exists('cache_features')) {
    $schema = drupal_get_schema_unprocessed('system', 'cache');
    db_create_table('cache_features', $schema);
  }
}