I've encountered the following problem:
On my 7.12 Drupal website I have had installed ds and ds_extras, but not using any features of ds (created and deleted a build mode and opened each ds admin page at most for checking features).
When using drush 5.x to disable and uninstalling the ds_extras module I got an ok message:

drush dis ds
The following extensions will be disabled: ds, ds_extras
Do you really want to continue? (y/n): y
ds was disabled successfully.                                                                                     [ok]
ds_extras was disabled successfully.                                                                              [ok]
The Display Suite module has been disabled. Any existing content that was using the Display Suite filter will now [status]
be visible in plain text. This might pose a security risk by exposing sensitive information, if any, used in the
PHP code.
drush pm-uninstall ds_extras
The following modules will be uninstalled: ds_extras
Do you really want to continue? (y/n): y
ds_extras was successfully uninstalled.                                                                           [ok]

But afterwards Drupal and drush have a serious problem and don't work anymore.
Trying to uninstall ds got me this error:

drush pm-uninstall ds
WD php: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision.ds_switch' in 'field list':[error]
SELECT revision.vid AS vid, base.uid AS uid, revision.title AS title, revision.log AS log, revision.status AS
status, revision.comment AS comment, revision.promote AS promote, revision.sticky AS sticky, revision.ds_switch AS
ds_switch, base.nid AS nid, base.type AS type, base.language AS language, base.created AS created, base.changed AS
changed, base.tnid AS tnid, base.translate AS translate, revision.timestamp AS revision_timestamp, revision.uid AS
revision_uid
FROM 
{node} base
INNER JOIN {node_revision} revision ON revision.vid = base.vid
WHERE  (base.nid IN  (:db_condition_placeholder_0)) ; Array
(
    [:db_condition_placeholder_0] => 9
)
 in DrupalDefaultEntityController->load() (line 196 of
/srv/www/vhosts/<domain.tld>/httpdocs/includes/entity.inc).
Drush command terminated abnormally due to an unrecoverable error.                                                [error]
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column &#039;revision.ds_switch&#039; in &#039;field list&#039;: SELECT revision.vid AS vid, base.uid AS uid, revision.title AS title, revision.log AS log, revision.status AS status, revision.comment AS comment, revision.promote AS promote, revision.sticky AS sticky, revision.ds_switch AS ds_switch, base.nid AS nid, base.type AS type, base.language AS language, base.created AS created, base.changed AS changed, base.tnid AS tnid, base.translate AS translate, revision.timestamp AS revision_timestamp, revision.uid AS revision_uid
FROM 
{node} base
INNER JOIN {node_revision} revision ON revision.vid = base.vid
WHERE  (base.nid IN  (:db_condition_placeholder_0)) ; Array
(
    [:db_condition_placeholder_0] => 9
)
 in DrupalDefaultEntityController->load() (Zeile 196 von /srv/www/vhosts/<domain.tld>/httpdocs/includes/entity.inc).

But not only that, afterwards Drupal and drush constantly crash with errors, regardless of the argument or page. Drupal now always displays the following similar error:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision.ds_switch' in 'field list': SELECT revision.vid AS vid, base.uid AS uid, revision.title AS title, revision.log AS log, revision.status AS status, revision.comment AS comment, revision.promote AS promote, revision.sticky AS sticky, revision.ds_switch AS ds_switch, base.nid AS nid, base.type AS type, base.language AS language, base.created AS created, base.changed AS changed, base.tnid AS tnid, base.translate AS translate, revision.timestamp AS revision_timestamp, revision.uid AS revision_uid FROM {node} base INNER JOIN {node_revision} revision ON revision.vid = base.vid WHERE (base.nid IN (:db_condition_placeholder_0)) ; Array ( [:db_condition_placeholder_0] => 9 ) in DrupalDefaultEntityController->load() (Zeile 196 von /srv/www/vhosts/<domain.tld>/httpdocs/includes/entity.inc).

Then I tried to be witty and removed the ds module directory, but drush and Drupal didn't recover. Drush still gives the same error and Drupal now adds two warnings upfront which seem not to be ds related (at least on the first glance, I've no dug deeper):

Notice: Undefined variable: navigation in include() (Zeile 52 von /srv/www/vhosts/<domain.tld>/httpdocs/sites/all/themes/zen/templates/maintenance-page.tpl.php).
    Notice: Undefined variable: navigation in include() (Zeile 67 von /srv/www/vhosts/<domain.tld>/httpdocs/sites/all/themes/zen/templates/maintenance-page.tpl.php).
    PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision.ds_switch' in 'field list': SELECT revision.vid AS vid, base.uid AS uid, revision.title AS title, revision.log AS log, revision.status AS status, revision.comment AS comment, revision.promote AS promote, revision.sticky AS sticky, revision.ds_switch AS ds_switch, base.nid AS nid, base.type AS type, base.language AS language, base.created AS created, base.changed AS changed, base.tnid AS tnid, base.translate AS translate, revision.timestamp AS revision_timestamp, revision.uid AS revision_uid FROM {node} base INNER JOIN {node_revision} revision ON revision.vid = base.vid WHERE (base.nid IN (:db_condition_placeholder_0)) ; Array ( [:db_condition_placeholder_0] => 9 ) in DrupalDefaultEntityController->load() (Zeile 196 von /srv/www/vhosts/<domain.tld>/httpdocs/includes/entity.inc).

So, it seems ds_extras uninstall didn't remove everything, something in the Drupal default entity controller has been left behind.

So, what steps did I wrong? Should i have left ds enabled for the first uninstallation? But there was no error stated in uninstalling ds_extras.

Maybe the uninstalling hook of ds_extras needs to be enhanced to remove the problematic db content or don't allow uninstalling when ds is disabled already?

I wonder what damage ds/ds_extras can do to the Drupal core database so that Drupal will not recover to work when ds/ds_extras are disabled and removed. It seems to me that Drupal core (entity controller) would need to have some recovering code in such cases, at least when related modules are disabled, but that is probably only wishful thinking, as I have not dug deep enough into the Drupal architecture to know.

Br,
meichr.

CommentFileSizeAuthor
#8 list_of_modules.txt24.31 KBardnet

Comments

meichr’s picture

Title: Drupal 7 crashing after ds_extras had been disabled and unistalled » Drupal 7 crashing after ds_extras had been disabled and uninstalled

So, I've found out that the problem is caused by the cached 'entity_info' item.
When I deleted that record manually from the cache table Drupal and drush again work.

Suggested solution to ds_extras uninstall hook:

Delete 'entity_info' from the cache or flush the cache as needed. Otherwise, it is not possible to recover by any drush or drupal means as they crash.

Br,
meichr.

swentel’s picture

Interesting, looks like this is also reported in #1153504: SOLVED * Error on all pages with Extras module enabled - I've asked people to look at your solution in #1 - if it works for them, the fix will be easy.

dgtlmoon’s picture

Same issue here, flushing cache didnt work

meichr’s picture

Yes, flushing the cache would only be possible during the uninstall hook as further on neither drush nor the website can be used anymore.
What you can do, is to use a tool to directly access the underlying database and delete the record 'entity_info%' from the cache table.
You could do this using phpMyAdmin or the command line tool mysql, if you have access and are familiar with one or both.
A possible sql command to delete the record would be:

delete from cache where cid like 'entity_info%';

The reason I use a wildcard (%) is, that in my localised installation the exact cid is 'entity_info:de', having the German language code added. You might have a different language code there or even none (I havn't tested a non-localised Drupal installation), the above select would work for all languages.

If you can't access the database used by Drupal directly, I am sorry you are out of luck currently, as far as I know.

muranod’s picture

I get this message when enabling extras:

Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of C:\wamp\www\drupal-7.10\includes\entity.inc).
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 354 of C:\wamp\www\drupal-7.10\includes\entity.inc).
Notice: Undefined index: in ds_extras_entity_view_alter() (line 895 of C:\wamp\www\drupal-7.10\sites\all\modules\ds\modules\ds_extras\ds_extras.module).

(POSTING THIS IN #1153504, as that looks like the right place. )

frega’s picture

Status: Active » Closed (cannot reproduce)

Could not be reproduced during the DS easter sprint.
module_disable in Drupal<7.12 was definitely missing a entity_info_cache_clear()-call (http://drupal.org/node/996236#comment-5537162) and there is still work in core being done on the various invalidation of caches involved (cf. http://drupal.org/node/1404198).
If problem persists please reopen, ds could implement hook_modules_uninstalled to e.g. force cache flushes.

frega’s picture

Issue summary: View changes

Changed explicit domain reference in the error messages to in one left-over case.

ardnet’s picture

This thread and the other one (https://drupal.org/node/1153504) seems related each other after I encountered the same issue.

Every time I install DS Extra, I got this message below in admin/backend page:
DatabaseSchemaObjectExistsException: Table ds_vd already exists. in DatabaseSchema->createTable() (line 657 of /Library/WebServer/Documents/clubvivre/includes/database/schema.inc). and when I refresh the admin/backend page, the message gone.

But on the other hand, all my frontend can not display at all, and instead got this message below:
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision.ds_switch' in 'field list': SELECT revision.vid AS vid, base.uid AS uid, revision.title AS title, revision.log AS log, revision.status AS status, revision.comment AS comment, revision.promote AS promote, revision.sticky AS sticky, revision.ds_switch AS ds_switch, revision.vuuid AS vuuid, base.nid AS nid, base.type AS type, base.language AS language, base.created AS created, base.changed AS changed, base.tnid AS tnid, base.translate AS translate, base.uuid AS uuid, base.cv_menu_pick AS cv_menu_pick, revision.timestamp AS revision_timestamp, revision.uid AS revision_uid, base.cv_menu_pick AS base_cv_menu_pick FROM {node} base INNER JOIN {node_revision} revision ON revision.vid = base.vid WHERE (base.nid IN (:db_condition_placeholder_0, :db_condition_placeholder_1, :db_condition_placeholder_2)) ; Array ( [:db_condition_placeholder_0] => 67 [:db_condition_placeholder_1] => 74 [:db_condition_placeholder_2] => 72 ) in DrupalDefaultEntityController->load() (line 191 of /Library/WebServer/Documents/clubvivre/includes/entity.inc).

All kind of way suggested as mentioned in this thread are not working for me, still find a way how to solve this.

The only way to solve this is by disabling the DS Extra module, but I can't as I need it.
Please advise.
Thanks

ardnet’s picture

Status: Closed (cannot reproduce) » Active
StatusFileSize
new24.31 KB

Sorry, I had to change the title and the status for this thread.
Btw, I attached txt files that list out all the modules that I used for reference.

Thanks

laserlight’s picture

@ardnet Your issue is not related to the topic. This is about having trouble removing ds_extras and ds from D7.

@meichr This is what I ended up using. Hope it helps someone else if they run into it.

function hook_update_N() {
  $modules = array('ds_extras','ds');
  module_disable($modules);
  drupal_uninstall_modules($modules, FALSE);
  db_truncate('cache')->execute();
}
aspilicious’s picture

Status: Active » Closed (fixed)

I couldn't reproduce either. And there is a solution in the end.