Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table

Created on 17 November 2021, almost 3 years ago
Updated 29 June 2023, over 1 year ago

Problem/Motivation

I got following error:

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'd9.consumer' doesn't exist: SELECT COUNT(*) AS "expression" FROM (SELECT 1 AS "expression" FROM "consumer" "base_table" GROUP BY base_table.id) "subquery"; Array ( ) in Drupal\Core\Entity\Query\Sql\Query->result() (line 266 of /app/core/lib/Drupal/Core/Entity/Query/Sql/Query.php).

Steps to reproduce

I installed and enable simple oauth β†’ and consumers β†’ using composer and drush.

When I clicked on 'Client' tab ('admin/config/services/consumer') under Configuration >> People >> Simple Oauth, I got error: "The website encountered an unexpected error. Please try again later."

I checked the error log message and found that it's related to

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'd9.consumer' doesn't exist: SELECT COUNT(*) AS "expression" FROM (SELECT 1 AS "expression" FROM "consumer" "base_table" GROUP BY base_table.id) "subquery"; Array ( ) in Drupal\Core\Entity\Query\Sql\Query->result() (line 266 of /app/core/lib/Drupal/Core/Entity/Query/Sql/Query.php).

NOTE: when I check the database, I could not find the 'consumer' table though it has 'consumer__roles' table.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.11

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States npcoder

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024