I set up a custom content type in Drupal 8.3.2. After the content type was built I installed and enabled DS 8.x-3.1. When I created a new node in my content type, I received an error that "the website encountered an unexpected error. Please try again later" and the content was not added.

In the server error log is this message: Uncaught PHP Exception Drupal\\Core\\Entity\\EntityStorageException: "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ds_switch' in 'field list': INSERT INTO {node_field_data} (nid, vid, type, langcode, status, title, uid, created, changed, promote, sticky, revision_translation_affected, default_langcode, ds_switch)...

I assume the "ds_switch" column refers to a column in Display Suite. It doesn't seem that enabling DS to my site after the content type was created should have caused the error but that's what the error message seems to imply.

I then built another content type, this time with DS already enabled, but I still encounter the same error.

Finally, I tried to uninstall Display Suite but I encountered the same error in the browser, with this error in the log file: Uncaught PHP Exception Drupal\\Core\\Database\\DatabaseExceptionWrapper: "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ds_switch' in 'where clause': SELECT 1 AS expression\nFROM \n{node_field_data} t\nWHERE ds_switch IS NOT NULL\nLIMIT 1 OFFSET 0; Array\n(\n)\n" at /[webroot]/core/lib/Drupal/Core/Database/Connection.php line 685, referer: http://[webroot]/admin/modules

Comments

rvanderh1 created an issue. See original summary.

rvanderh1’s picture

I also just backed down to DS 8.x-3.0 but the errors I described above still persist.

aspilicious’s picture

Your database seems corrupt.
Did you run update.php?

Have you access to drush?
You could try:

drush entity-updates

It fixes your schema.

rvanderh1’s picture

I did run update.php several times but each time it came back and said no pending updates. I was working on a pretty fresh installation of Drupal 8.3.2 so I'm not sure how the database could get corrupted.

I do not currently have access to drush but I'm interested in learning more about it.

rvanderh1’s picture

BTW, doesn't this look a lot like this thread:

https://www.drupal.org/node/2770171

aspilicious’s picture

Hmm, I'll need to test this myself....
Seems we are lacking test coverage if there is still a problem...

This column is only needed when you have the switch viewmode submodule enabled.

swentel’s picture

Version: 8.x-3.1 » 5.0.x-dev
Status: Active » Closed (outdated)
swentel’s picture

Status: Closed (outdated) » Active

Oops, didn't want to close it yet

swentel’s picture

Status: Active » Closed (cannot reproduce)

Tested installing, setting a value, then uninstalling, no errors, Entity/field definitions are up to date, so assuming everything is fine nowadays.