api_key field isn't found in users_field_data table

Created on 16 March 2021, over 3 years ago
Updated 22 March 2023, over 1 year ago

Installing this module on 9.1.5 resulted in the following error:

Drupal\Core\Entity\Query\QueryException: 'api_key' not found in Drupal\Core\Entity\Query\Sql\Table s->ensureEntityTable() (line 368 of /code/web/core/lib/Drupal/Core/Ent ity/Query/Sql/Tables…

I wasn’t able to then uninstall the module:

drush pm:uninstall key_auth               

In Connection.php line 896:
                                                                               
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'api_key' in 'where   
  clause': SELECT 1 AS "expression"                                            
  FROM                                                                         
  {users_field_data} "t"                                                       
  WHERE "api_key" IS NOT NULL                                                  
  LIMIT 1 OFFSET 0; Array                                                      
  (                                                                            
  )                                                                            
                                                                               
In StatementWrapper.php line 116:
                                                                               
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'api_key' in 'where   
  clause'

Could this be related to Support for automatic entity updates has been removed ?

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

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.

  • 🇬🇧United Kingdom pobster

    Just noting you now get;

    Mismatched entity and/or field definitions
    The following changes were detected in the entity type and field definitions.

    User
    * The API key field needs to be uninstalled.

    ...when the module is uninstalled.

  • 🇧🇪Belgium weseze

    Current release 2.1 is broken because of this issue... I had to patch it with the diff from the merge requests to be able to use this module.

Production build 0.69.0 2024