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
Comment #2
Syntapse commentedComment #3
Syntapse commentedComment #4
Syntapse commentedI 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.
Comment #5
Syntapse commentedComment #6
andyrigby commentedThis 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.%')
Every environment we tried worked fine, up until production, so it's not an easy one to trace.
Comment #7
andyrigby commentedInteresting - our installed version of drush calls
\Drupal::entityDefinitionUpdateManager()->applyUpdates();when running drush entup, which is deprecated and does nothing in Drupal 8.7I don't think we should be reliant on using drush entup anyway, but it may be a clue.
Comment #8
Syntapse commentedThanks. Did you resolve your issue with different versions. I'm happy to use any recent version combination to get it working.
Comment #9
Syntapse commented"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
Comment #10
citricguy commentedSo 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.
Comment #11
citricguy commentedJust 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.
Comment #12
bradjones1