http://json.syntapse.co.uk/admin/config/services/consumer

is rendering:


The website encountered an unexpected error. Please try again later.

and reporting error in log:

Type	php
Date	Wednesday, September 4, 2019 - 16:00
User	user1
Location	http://json.syntapse.co.uk/admin/config/services/consumer
Referrer	http://json.syntapse.co.uk/admin/reports
Message	Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'json.consumer__roles' doesn't exist: SELECT t.* FROM {consumer__roles} t WHERE (entity_id IN (:db_condition_placeholder_0)) AND (deleted = :db_condition_placeholder_1) AND (langcode IN (:db_condition_placeholder_2, :db_condition_placeholder_3, :db_condition_placeholder_4)) ORDER BY delta ASC; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => 0 [:db_condition_placeholder_2] => en [:db_condition_placeholder_3] => und [:db_condition_placeholder_4] => zxx ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->loadFromDedicatedTables() (line 1266 of /var/www/html/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Severity	Error
Hostname	172.28.2.1
Operations	

i'm using dev versions of simple_oauth and consumers. there are database updates required but i cant apply them.


bash-4.4# composer show drupal/simple_oauth
No composer.json in current directory, do you want to use the one at /var/www/html? [Y,n]? y
Do not run Composer as root/super user! See https://getcomposer.org/root for details
name     : drupal/simple_oauth
descrip. : The Simple OAuth module for Drupal
keywords :
versions : 4.x-dev, * dev-4.x
type     : drupal-module
license  : GNU General Public License v2.0 or later (GPL-2.0+) (OSI approved) https://spdx.org/licenses/GPL-2.0+.html#licenseText
source   : [git] https://git.drupalcode.org/project/simple_oauth.git bfc0d73d4f2ea2aa8e1bb7d84d6893345956df21
dist     : []
path     : /var/www/html/web/modules/contrib/simple_oauth
names    : drupal/simple_oauth

support
source : https://git.drupalcode.org/project/simple_oauth

requires
drupal/consumers ^1.2
drupal/core *
league/oauth2-server ^7.1
bash-4.4# composer show drupal/consumers
No composer.json in current directory, do you want to use the one at /var/www/html? [Y,n]? y
Do not run Composer as root/super user! See https://getcomposer.org/root for details
name     : drupal/consumers
descrip. : Declare all the consumers of your API
keywords :
versions : 1.x-dev, * dev-1.x
type     : drupal-module
license  : GNU General Public License v2.0 or later (GPL-2.0-or-later) (OSI approved) https://spdx.org/licenses/GPL-2.0-or-later.html#licenseText
source   : [git] https://git.drupalcode.org/project/consumers.git 898abd9b27bfdd45c4f2418af60cd574ff264593
dist     : []
path     : /var/www/html/web/modules/contrib/consumers
names    : drupal/consumers

support
source : https://git.drupalcode.org/project/consumers

requires
drupal/core *
bash-4.4# drush updatedb:status
 [warning] The following module is missing from the file system: simple_oauth_extras bootstrap.inc:277
 ------------------------------- ----------- --------------- ----------------------------------------------------------
  Module                          Update ID   Type            Description
 ------------------------------- ----------- --------------- ----------------------------------------------------------
  consumer entity type                        entity-update   The Secret field needs to be installed.
  consumer entity type                        entity-update   The Is Confidential? field needs to be installed.
  consumer entity type                        entity-update   The Scopes field needs to be installed.
  oauth2_token entity type                    entity-update   The OAuth2 token entity type needs to be installed.
  oauth2_token_type entity type               entity-update   The OAuth2 Token Type entity type needs to be installed.
 ------------------------------- ----------- --------------- ----------------------------------------------------------
bash-4.4# drush updatedb
 [warning] The following module is missing from the file system: simple_oauth_extras bootstrap.inc:277
 [success] No pending updates.
bash-4.4# drush updatedb:status
 [warning] The following module is missing from the file system: simple_oauth_extras bootstrap.inc:277
 ------------------------------- ----------- --------------- ----------------------------------------------------------
  Module                          Update ID   Type            Description
 ------------------------------- ----------- --------------- ----------------------------------------------------------
  consumer entity type                        entity-update   The Secret field needs to be installed.
  consumer entity type                        entity-update   The Is Confidential? field needs to be installed.
  consumer entity type                        entity-update   The Scopes field needs to be installed.
  oauth2_token entity type                    entity-update   The OAuth2 token entity type needs to be installed.
  oauth2_token_type entity type               entity-update   The OAuth2 Token Type entity type needs to be installed.
 ------------------------------- ----------- --------------- ----------------------------------------------------------
bash-4.4#

thanks

Comments

Syntapse created an issue. See original summary.

Syntapse’s picture

Title: Can't install correctly: version incompatibility with Consumers (>=8.x-1.0-beta3) » Can't install correctly: version incompatibility with Consumers (>=8.x-1.0-beta3) reported
Syntapse’s picture

Title: Can't install correctly: version incompatibility with Consumers (>=8.x-1.0-beta3) reported » Can't install correctly: version incompatibility with Consumers (...>=8.x-1.0-beta3 ?) reported
Syntapse’s picture

I am completely stalled working this issue out. do you have any insight into what versions may be mismatched? i can send any config/version info to help this along.

thanks.

Syntapse’s picture

Title: Can't install correctly: version incompatibility with Consumers (...>=8.x-1.0-beta3 ?) reported » consumers config white screen error and database updates are not working.
Version: 8.x-3.x-dev » 8.x-4.x-dev
Issue summary: View changes
andyrigby’s picture

This has happened to us too. We've only seen it happen once (unfortunately on production!). Our versions are:

drupal/consumers: 1.9.0
drupal/simple_oauth: 3.16.0

Neither modules were enabled, and on deployment they were enabled by config management. There were no errors from drush updb or drush cim.

Runing drush entup didn't install the fields (which may be a symptom of why they didn't get installed in the first place?). The roles, secret, confidential ,redirect and user_id fields are missing from the key_value table (SELECT `collection`, `name`, `value` FROM `key_value` WHERE `name` LIKE '%consumer.%')

arigby@master:/var/www/portal.xxx.com/public$ drush entup
The following updates are pending:

consumer entity type :
  The Secret field needs to be installed.
  The Is Confidential? field needs to be installed.
  The Scopes field needs to be installed.
  The Redirect URI field needs to be installed.
  The User field needs to be installed.
webform_submission entity type :
  The Language field needs to be updated.
Do you wish to run all pending updates? (y/n): y

Cache rebuild complete.                                                                                                                                       [ok]
Finished performing updates.                                                                                                                                  [ok]
arigby@master:/var/www/portal.xxx.com/public$
arigby@master:/var/www/portal.xxx.com/public$ drush entup
The following updates are pending:

consumer entity type :
  The Secret field needs to be installed.
  The Is Confidential? field needs to be installed.
  The Scopes field needs to be installed.
  The Redirect URI field needs to be installed.
  The User field needs to be installed.
webform_submission entity type :
  The Language field needs to be updated.
Do you wish to run all pending updates? (y/n): n
Cancelled.                                                                                                                                                    [cancel]

Every environment we tried worked fine, up until production, so it's not an easy one to trace.

andyrigby’s picture

Interesting - our installed version of drush calls \Drupal::entityDefinitionUpdateManager()->applyUpdates(); when running drush entup, which is deprecated and does nothing in Drupal 8.7

  public function applyUpdates() {
    trigger_error('EntityDefinitionUpdateManagerInterface::applyUpdates() is deprecated in 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface::getChangeList() and execute each entity type and field storage update manually instead. See https://www.drupal.org/node/3034742.', E_USER_DEPRECATED);
  }

I don't think we should be reliant on using drush entup anyway, but it may be a clue.

Syntapse’s picture

Thanks. Did you resolve your issue with different versions. I'm happy to use any recent version combination to get it working.

Syntapse’s picture

"This has happened to us too".

may i ask: do you mean exactly the same output and reaction to updatedb that I have experienced?

thanks

citricguy’s picture

So I believe I experienced this same exact error.

It started when I ran the suggested string on the install page:

"composer config repositories.drupal composer https://packages.drupal.org/8 && composer require drupal/simple_oauth:^3"

This is were I started seeing the table/field SQL complaints you mentioned.

This hosed my site so I restored a backup and then ran:

composer config repositories.drupal composer https://packages.drupal.org/8 && composer require drupal/simple_oauth:^4

Now version 4 was installed.

I kept getting errors however and had to move simple_oauth out of /web/modules/contrib/* and up a directory into /web/modules/*.

So after specifically installing version 4 and then manually moving simple_oauth out of the contrib folder (leaving consumers in the contrib folder) everything started working just fine.

I'm really new to drupal 8, so there is likely something I'm not doing correctly, but I think the installation steps could be a little more clear.

My setup isn't fancy and simple_oauth and consumers are the only contrib/custom modules I use other than RESTUI.

citricguy’s picture

Just completely started from scratch and everything seems to work as it should. I think it may have had something to do with mixing Drush and Composer.

bradjones1’s picture

Status: Active » Closed (cannot reproduce)