drupal 10.1: 'api_key' not found in Drupal\Core\Entity\Query\Sql\Tables

Created on 10 September 2023, about 1 year ago
Updated 1 July 2024, 5 months ago

got this error generating new key:

'api_key' not found in Drupal\Core\Entity\Query\Sql\Tables->ensureEntityTable() (line 369 of core/lib/Drupal/Core/Entity/Query/Sql/Tables.php).

I've checked this issue:
https://www.drupal.org/project/key_auth/issues/3203785 🐛 api_key field isn't found in users_field_data table Needs work

but can't manage to get it work with ver 2.1 and drupal 10.1.
helps needed,,many thanks.

💬 Support request
Status

Active

Version

2.1

Component

Code

Created by

🇨🇳China marcolam

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

Comments & Activities

  • Issue created by @marcolam
  • Try reinstalling the module. I'm using Drupal 10.1, and I can generate an API key.

  • 🇫🇮Finland ronttizz Helsinki

    For me similar happened on our Azure based testing environment and `drush cr` couple of times solved the situation. Problem itself might be on Azure end but I was wondering this also for a while.

  • 🇮🇹Italy marajah

    I had the same problem.
    The column "api_key" is not created in "user_field_data". I realised it when I tried to create a key for a user.
    I tried to uninstall the module, but it wasn't possible because of the problem discussed in https://www.drupal.org/project/key_auth/issues/3203785 🐛 api_key field isn't found in users_field_data table Needs work
    The site got broken with an error:
    TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in in_array() (line 70 of modules/contrib/key_auth/src/KeyAuth.php)
    The only way to uninstall the module and make the site work again was to create that column manually.

Production build 0.71.5 2024