SQLSTATE[42S22]: Column not found: 1054

Created on 7 August 2024, 11 months ago

Problem/Motivation

I tried to update from version 1x-dev, but nothing worked, when updating the database, errors were displayed and the updb operation was interrupted. I decided to do the update manually, exported the Site Setting type configurations (screenshot) and completely deleted 1x-dev, then installed 2.0.0-rc5. There were no errors during installation, I added all Site Setting types (34 pcs) via configuration import and manually added the necessary fields to them. The settings were not displayed on the Site Settings page and I started looking for the reason. It turned out that the "Group" parameter was not imported when importing the configuration. I manually added Group for all types, after which the settings appeared. Now I can open the settings adding pages, but when saving, I get the same error:

The website encountered an unexpected error. Try again later.

Drupal\Core\Entity\EntityStorageException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision_log' in 'field list': INSERT INTO "site_setting_entity_revision" ("id", "langcode", "revision_user", "revision_created", "revision_log", "revision_default") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => 18 [:db_insert_placeholder_1] => ru [:db_insert_placeholder_2] => 1 [:db_insert_placeholder_3] => 1723037475 [:db_insert_placeholder_4] => Created new new [:db_insert_placeholder_5] => 1 ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

I tried resetting the cache, updating the database, running cron, tried changing the module version to 2.0.x-dev and 2.0.0-rc1 - this did not give any results, I get the same error. I also tried to create a new type of settings "New" and a new text field filed_new - when adding settings, they also give an error, nothing helps (screenshot).

I tried to delete fields from the settings, when deleting fields, I also encountered errors (screenshot). In this case, the fields disappear after refreshing the page, but I suspect that the dependencies are not removed from the database. I think that these two problems may be related:

The website encountered an unexpected error. Try again later.

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'azprt_www.field_deleted_data_15006e6495' doesn't exist: SELECT DISTINCT "t"."entity_id" AS "entity_id" FROM "field_deleted_data_15006e6495" "t" WHERE "bundle" = :db_condition_placeholder_0 LIMIT 10 OFFSET 0; Array ( [:db_condition_placeholder_0] => calc_global ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->readFieldItemsToPurge() (line 1672 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇷🇺Russia tlthades

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

Comments & Activities

  • Issue created by @tlthades
  • 🇬🇧United Kingdom scott_euser

    It's these post update hooks that are meant to fire to create that table and those fields https://git.drupalcode.org/project/site_settings/-/blob/2.0.x/site_setti...

    Can you double check all update and post update hooks have run? Not 100% sure how to do that but I think if you search a bit commands to check + rerun a post update hook should show up.

    Revision log field does seem the be listed there.

    Those fields are meant to match the entity fields if you install it new, so if it did run perhaps there is a mismatch between the entity definition and those post updat hooks.

    Hope that at least helps point in the right direction.

  • Status changed to Closed: cannot reproduce 29 days ago
  • 🇬🇧United Kingdom scott_euser

    Haven't heard anything further nor further reports, so going to assume this was resolved on the project end

Production build 0.71.5 2024