Problem/Motivation

Hey everybody,

i just wanted to update my dev-site to 8.7.0 from 8.6.15 but received and error while running the updates:

...
 [notice] Update started: taxonomy_post_update_make_taxonomy_term_revisionable
 [notice] Taxonomy terms have been converted to be revisionable.
 [ok] Update completed: taxonomy_post_update_make_taxonomy_term_revisionable
 [notice] Update started: taxonomy_post_update_make_taxonomy_term_revisionable
 [error]  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'lawioDB.taxonomy_term_data' doesn't exist: SELECT revision.langcode AS langcode, base.tid AS tid, base.vid AS vid, base.uuid AS uuid, CASE base.revision_id WHEN revision.revision_id THEN 1 ELSE 0 END AS isDefaultRevision
FROM
{taxonomy_term_data} base
INNER JOIN {taxonomy_term_revision} revision ON revision.revision_id = base.revision_id
WHERE base.tid IN (:db_condition_placeholder_0, :db_condition_placeholder_1, :db_condition_placeholder_2, :db_condition_placeholder_3, :db_condition_placeholder_4, :db_condition_placeholder_5, :db_condition_placeholder_6); Array
(
    [:db_condition_placeholder_0] => 93189
    [:db_condition_placeholder_1] => 93190
    [:db_condition_placeholder_2] => 93191
    [:db_condition_placeholder_3] => 93192
    [:db_condition_placeholder_4] => 93193
    [:db_condition_placeholder_5] => 93194
    [:db_condition_placeholder_6] => 93195
)
 
 [error]  Update failed: taxonomy_post_update_make_taxonomy_term_revisionable 
 [error]  Update aborted by: taxonomy_post_update_make_taxonomy_term_revisionable 
 [error]  Finished performing updates. 

After that error i checked my db, because i was sure to have this table. But every table of the format taxonomy_* got deleted, except of taxonomy_index.

I didn't looked further into it yet and just wanted to inform. It seems that the user from comment #10 in this report got the same error.

Best Regards
FirstSanny

Steps to reproduce

Aside from running the update, it also happens (only with the s3fs tables), when i use the cache clearing action from the S3FS Module. See #24.

Proposed resolution

The work around used in in #19.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

FirstSanny created an issue. See original summary.

FirstSanny’s picture

Issue summary: View changes
xjm’s picture

Version: 8.7.0 » 8.7.x-dev
Priority: Normal » Critical
Issue tags: +8.7.0 update
Related issues: +#3040129: Fatals in make_menu_link_content_revisionable when combined with make_taxonomy_term_revisionable
larowlan’s picture

Status: Active » Postponed (maintainer needs more info)

Can you confirm that the taxonomy_term_data table exists before the update?

amateescu’s picture

Also, this update function creates backup tables with the prefix old_[6-random-chars], can you confirm that they exist after the failed update process?

FirstSanny’s picture

@larowlan
I can confirm, that the tables existed at the last backup. That was made approx. 12h before the update and there were no big actions on the side which could have deleted the tables or changed any important content. That's why i didn't made a fresh backup right before. But i will test the update again with the restored backup soon, so i can confirm that the deletion came from the update.
Also there were no tables with the name old_* created.
EDIT: I can now cofirm, that the tables were deleted when the update is executed.

amateescu’s picture

@FirstSanny, see my comment from #3039586-28: Cannot rename tmp_2362aemenu_link_content_revision to menu_link_content_revision for a possible explanation for this failed update. It's really good that you have a backup available, it will be very helpful for trying to figure out the root cause :)

FirstSanny’s picture

@amateescu After reading your comment i recognized that the tables menu_link_* were also deleted. I restored all the deleted tables.
If i am understanding your comment correctly you suggest, that i have to delete all my views and try the update again?

amateescu’s picture

@FirstSanny, that depends on how much time you have available to try and debug this issue :)

If you can do a "test only" update after deleting all the views from the backup, it would help at least to establish that the problem is within \Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber.

In any case, the most important thing is to only try these test updates on the non-live environment/database!

FirstSanny’s picture

@amateescu Of corse i'm not doing this on a live site. ;)

And i'll retry the update with deleted views. I don't know if i have the time to do it on the next hours, but today i'm quite sure i can rerun it.

FirstSanny’s picture

@amateescu After deleting most of the views the update ran into the same error as in this post.

 ...
 [notice] Update started: layout_discovery_post_update_recalculate_entity_view_display_dependencies
 [ok] Update completed: layout_discovery_post_update_recalculate_entity_view_display_dependencies
 [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
 [error]  Exception thrown while performing a schema update. Die Tabelle old_9818bbmenu_link_content kann nicht nach menu_link_content umbenannt werden: Die Tabelle old_9818bbmenu_link_content existiert nicht. 
 [error]  Update failed: menu_link_content_post_update_make_menu_link_content_revisionable 
 [error]  Update aborted by: menu_link_content_post_update_make_menu_link_content_revisionable 
 [error]  Finished performing updates. 
amateescu’s picture

@FirstSanny, ok, I've posted a patch at #3052492: ViewsEntitySchemaSubscriber should not make an entity update fail if a view cannot be resaved that should help a bit in the cases where these updates fail because of an unrelated View can not be saved anymore. Can you please try the update again without removing any view and with that patch applied?

FirstSanny’s picture

@amateescu i'll retry soon, but i think that won't happen today.

FirstSanny’s picture

@amateescu
ran the update. it dosen't deleted the taxonomy tables this time, but the menu_link* tables again.
here is the log:

 [notice] Update started: system_update_8701
 [ok] Update completed: system_update_8701
 [notice] Update started: comment_update_8700
 [ok] Update completed: comment_update_8700
 [notice] Update started: system_update_8702
 [ok] Update completed: system_update_8702
 [notice] Update started: comment_update_8701
 [ok] Update completed: comment_update_8701
 [notice] Update started: file_update_8700
 [ok] Update completed: file_update_8700
 [notice] Update started: node_update_8700
 [ok] Update completed: node_update_8700
 [notice] Update started: taxonomy_update_8701
 [ok] Update completed: taxonomy_update_8701
 [notice] Update started: comment_post_update_add_ip_address_setting
 [ok] Update completed: comment_post_update_add_ip_address_setting
 [notice] Update started: layout_discovery_post_update_recalculate_entity_form_display_dependencies
 [ok] Update completed: layout_discovery_post_update_recalculate_entity_form_display_dependencies
 [notice] Update started: layout_discovery_post_update_recalculate_entity_view_display_dependencies
 [ok] Update completed: layout_discovery_post_update_recalculate_entity_view_display_dependencies
 [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
 [error]  Exception thrown while performing a schema update. Die Tabelle old_bbcc8cmenu_link_content kann nicht nach menu_link_content umbenannt werden: Die Tabelle old_bbcc8cmenu_link_content existiert nicht. 
 [error]  Update failed: menu_link_content_post_update_make_menu_link_content_revisionable 
 [error]  Update aborted by: menu_link_content_post_update_make_menu_link_content_revisionable 
 [error]  Finished performing updates. 

the error roughly translated: couldn't rename old_***menu_link_content to menu_link_content because old_***menu_link_content dosen't exist. In my database there are only the tmp_*** tables and no sign of an old_*** table.
I hope this can help.

amateescu’s picture

I'm afraid I'm out of quick tips here.. can you try to debug the update manually, maybe by putting some breakpoints and going through it with a debugger? The first place to look is in \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::postUpdateEntityTypeSchema(), specifically the first try / catch block from that method.

FirstSanny’s picture

@amateescu
I'll block some time to debug this in the following days.
Thanks for your fast answers and quick help. :)

pameeela’s picture

@FirstSanny: Thanks for taking part in this issue. If you'd like to help us make sure the 8.8.0 update is as smooth as possible, please consider signing up for the beta testing program at https://goo.gl/forms/bMBTMRSY3sKEscUJ3

FirstSanny’s picture

@amateescu

I found something really interesting. That was not exactly while debuging, but when i checked that comment. I ran these SQL-Statements and got a little bit confused, because it said, that i have a lot of these old_* tables. After double-checking my table i can garantee, they were not there. So i ran
SELECT * FROM information_schema.tables where table_name like "old%";
to find these tables.
And it appears i had a lot of them. But i another scheme. There was a new scheme called 'website' with the following tables:

field_deleted_data_259c1ff83c
field_deleted_data_2aa24c79f7
field_deleted_data_30621e39c9
field_deleted_data_69c84695bc
field_deleted_data_734353e483
field_deleted_data_941360460a
field_deleted_data_a51e85d2aa
field_deleted_data_a9cec61b62
field_deleted_data_abe2a7b2d0
field_deleted_data_c556c5fa74
field_deleted_data_d311e3b6ba
field_deleted_data_d563e27051
field_deleted_data_e9e2d77231
field_deleted_data_fd87dd85ff
field_deleted_revision_259c1ff83c
field_deleted_revision_30621e39c9
field_deleted_revision_69c84695bc
field_deleted_revision_941360460a
field_deleted_revision_a9cec61b62
field_deleted_revision_c556c5fa74
field_deleted_revision_d563e27051
field_deleted_revision_e9e2d77231
lawioDBcache_config
lawioDBcache_container
menu_link_content
menu_link_content_data
menu_link_content_field_revision
menu_link_content_revision
old_141941menu_link_content
old_141941menu_link_content_data
old_1cb80ftaxonomy_term__3a0aadac84
old_1cb80ftaxonomy_term__3ffd6b90f7
old_1cb80ftaxonomy_term__525c25dee6
old_1cb80ftaxonomy_term__98ca3d7319
old_1cb80ftaxonomy_term__a84ddcc8bc
old_1cb80ftaxonomy_term__field_ausschlussantwort
old_1cb80ftaxonomy_term__field_ausschlussfrage
old_1cb80ftaxonomy_term__field_beispielbild
old_1cb80ftaxonomy_term__field_bild
old_1cb80ftaxonomy_term__field_extraload
old_1cb80ftaxonomy_term__field_feucht
old_1cb80ftaxonomy_term__field_groesse
old_1cb80ftaxonomy_term__field_hausnummer_bis
old_1cb80ftaxonomy_term__field_hausnummer_von
old_1cb80ftaxonomy_term__field_hausnummern
old_1cb80ftaxonomy_term__field_info
old_1cb80ftaxonomy_term__field_ja_frage
old_1cb80ftaxonomy_term__field_nein_frage
old_1cb80ftaxonomy_term__field_ort
old_1cb80ftaxonomy_term__field_speicherfeld
old_1cb80ftaxonomy_term__field_staerke
old_1cb80ftaxonomy_term__field_strasse
old_1cb80ftaxonomy_term__field_stufe
old_1cb80ftaxonomy_term__field_tooltip
old_1cb80ftaxonomy_term__field_url
old_1cb80ftaxonomy_term__field_zeitverlust
old_1cb80ftaxonomy_term__field_zusatzangaben
old_1cb80ftaxonomy_term__field_zusatzbeweise
old_1cb80ftaxonomy_term__field_zusatzfragen
old_1cb80ftaxonomy_term__parent
old_1cb80ftaxonomy_term_data
old_1cb80ftaxonomy_term_field_data
old_56dba4menu_link_content
old_56dba4menu_link_content_data
old_5abbbfmenu_link_content
old_5abbbfmenu_link_content_data
old_9818bbmenu_link_content
old_9818bbmenu_link_content_data
old_9d90demenu_link_content
old_9d90demenu_link_content_data
old_a79d91menu_link_content
old_a79d91menu_link_content_data
old_a97919menu_link_content
old_a97919menu_link_content_data
old_bbcc8cmenu_link_content
old_bbcc8cmenu_link_content_data
old_de7271menu_link_content
old_de7271menu_link_content_data
old_ed880dmenu_link_content
old_ed880dmenu_link_content_data
old_facbf1menu_link_content
old_facbf1menu_link_content_data
old_fbfd3cmenu_link_content
old_fbfd3cmenu_link_content_data
taxonomy_term__field_alternative_referenzurteil
taxonomy_term__field_ausschlussantwort
taxonomy_term__field_ausschlussfrage
taxonomy_term__field_beispielbeschreibung
taxonomy_term__field_beispielbild
taxonomy_term__field_bild
taxonomy_term__field_extraload
taxonomy_term__field_feucht
taxonomy_term__field_groesse
taxonomy_term__field_hausnummer_bis
taxonomy_term__field_hausnummer_von
taxonomy_term__field_hausnummern
taxonomy_term__field_in_wizard_anzeigen
taxonomy_term__field_info
taxonomy_term__field_ja_frage
taxonomy_term__field_minderung_berechtigt
taxonomy_term__field_nein_frage
taxonomy_term__field_ort
taxonomy_term__field_schadensart_alternative
taxonomy_term__field_speicherfeld
taxonomy_term__field_staerke
taxonomy_term__field_strasse
taxonomy_term__field_stufe
taxonomy_term__field_tooltip
taxonomy_term__field_url
taxonomy_term__field_zeitverlust
taxonomy_term__field_zusatzangaben
taxonomy_term__field_zusatzbeweise
taxonomy_term__field_zusatzfragen
taxonomy_term__parent
taxonomy_term_data
taxonomy_term_field_data
taxonomy_term_field_revision
taxonomy_term_r__3a0aadac84
taxonomy_term_r__3ffd6b90f7
taxonomy_term_r__98ca3d7319
taxonomy_term_r__a84ddcc8bc
taxonomy_term_revision
taxonomy_term_revision__field_ausschlussantwort
taxonomy_term_revision__field_ausschlussfrage
taxonomy_term_revision__field_beispielbild
taxonomy_term_revision__field_bild
taxonomy_term_revision__field_extraload
taxonomy_term_revision__field_feucht
taxonomy_term_revision__field_groesse
taxonomy_term_revision__field_hausnummer_bis
taxonomy_term_revision__field_hausnummer_von
taxonomy_term_revision__field_hausnummern
taxonomy_term_revision__field_in_wizard_anzeigen
taxonomy_term_revision__field_info
taxonomy_term_revision__field_ja_frage
taxonomy_term_revision__field_nein_frage
taxonomy_term_revision__field_ort
taxonomy_term_revision__field_speicherfeld
taxonomy_term_revision__field_staerke
taxonomy_term_revision__field_strasse
taxonomy_term_revision__field_stufe
taxonomy_term_revision__field_tooltip
taxonomy_term_revision__field_url
taxonomy_term_revision__field_zeitverlust
taxonomy_term_revision__field_zusatzangaben
taxonomy_term_revision__field_zusatzbeweise
taxonomy_term_revision__field_zusatzfragen
taxonomy_term_revision__parent

So here are the tables that could'nt be renamed or deleted, because they were not in my normal scheme. And after deleting all the tables from this sheme the update ran successfully. Most likely because the tables from the old attempts in this scheme were blocking the new updates.

I think there is some point in the code, where the update is ignoring my scheme. Because even after updating successfully, all the revision and old_* tables went to the website scheme.
After a clean update with a cleaned website-scheme before updating, it got blown up again:

menu_link_content
menu_link_content_data
menu_link_content_field_revision
menu_link_content_revision
old_181ef4menu_link_content
old_181ef4menu_link_content_data
old_1a3b7ctaxonomy_term__3a0aadac84
old_1a3b7ctaxonomy_term__3ffd6b90f7
old_1a3b7ctaxonomy_term__525c25dee6
old_1a3b7ctaxonomy_term__98ca3d7319
old_1a3b7ctaxonomy_term__a84ddcc8bc
old_1a3b7ctaxonomy_term__field_ausschlussantwort
old_1a3b7ctaxonomy_term__field_ausschlussfrage
old_1a3b7ctaxonomy_term__field_beispielbild
old_1a3b7ctaxonomy_term__field_bild
old_1a3b7ctaxonomy_term__field_extraload
old_1a3b7ctaxonomy_term__field_feucht
old_1a3b7ctaxonomy_term__field_groesse
old_1a3b7ctaxonomy_term__field_hausnummer_bis
old_1a3b7ctaxonomy_term__field_hausnummer_von
old_1a3b7ctaxonomy_term__field_hausnummern
old_1a3b7ctaxonomy_term__field_info
old_1a3b7ctaxonomy_term__field_ja_frage
old_1a3b7ctaxonomy_term__field_nein_frage
old_1a3b7ctaxonomy_term__field_ort
old_1a3b7ctaxonomy_term__field_speicherfeld
old_1a3b7ctaxonomy_term__field_staerke
old_1a3b7ctaxonomy_term__field_strasse
old_1a3b7ctaxonomy_term__field_stufe
old_1a3b7ctaxonomy_term__field_tooltip
old_1a3b7ctaxonomy_term__field_url
old_1a3b7ctaxonomy_term__field_zeitverlust
old_1a3b7ctaxonomy_term__field_zusatzangaben
old_1a3b7ctaxonomy_term__field_zusatzbeweise
old_1a3b7ctaxonomy_term__field_zusatzfragen
old_1a3b7ctaxonomy_term__parent
old_1a3b7ctaxonomy_term_data
old_1a3b7ctaxonomy_term_field_data
taxonomy_term__field_alternative_referenzurteil
taxonomy_term__field_ausschlussantwort
taxonomy_term__field_ausschlussfrage
taxonomy_term__field_beispielbeschreibung
taxonomy_term__field_beispielbild
taxonomy_term__field_bild
taxonomy_term__field_extraload
taxonomy_term__field_feucht
taxonomy_term__field_groesse
taxonomy_term__field_hausnummer_bis
taxonomy_term__field_hausnummer_von
taxonomy_term__field_hausnummern
taxonomy_term__field_in_wizard_anzeigen
taxonomy_term__field_info
taxonomy_term__field_ja_frage
taxonomy_term__field_minderung_berechtigt
taxonomy_term__field_nein_frage
taxonomy_term__field_ort
taxonomy_term__field_schadensart_alternative
taxonomy_term__field_speicherfeld
taxonomy_term__field_staerke
taxonomy_term__field_strasse
taxonomy_term__field_stufe
taxonomy_term__field_tooltip
taxonomy_term__field_url
taxonomy_term__field_zeitverlust
taxonomy_term__field_zusatzangaben
taxonomy_term__field_zusatzbeweise
taxonomy_term__field_zusatzfragen
taxonomy_term__parent
taxonomy_term_data
taxonomy_term_field_data
taxonomy_term_field_revision
taxonomy_term_r__3a0aadac84
taxonomy_term_r__3ffd6b90f7
taxonomy_term_r__98ca3d7319
taxonomy_term_r__a84ddcc8bc
taxonomy_term_revision
taxonomy_term_revision__field_ausschlussantwort
taxonomy_term_revision__field_ausschlussfrage
taxonomy_term_revision__field_beispielbild
taxonomy_term_revision__field_bild
taxonomy_term_revision__field_extraload
taxonomy_term_revision__field_feucht
taxonomy_term_revision__field_groesse
taxonomy_term_revision__field_hausnummer_bis
taxonomy_term_revision__field_hausnummer_von
taxonomy_term_revision__field_hausnummern
taxonomy_term_revision__field_in_wizard_anzeigen
taxonomy_term_revision__field_info
taxonomy_term_revision__field_ja_frage
taxonomy_term_revision__field_nein_frage
taxonomy_term_revision__field_ort
taxonomy_term_revision__field_speicherfeld
taxonomy_term_revision__field_staerke
taxonomy_term_revision__field_strasse
taxonomy_term_revision__field_stufe
taxonomy_term_revision__field_tooltip
taxonomy_term_revision__field_url
taxonomy_term_revision__field_zeitverlust
taxonomy_term_revision__field_zusatzangaben
taxonomy_term_revision__field_zusatzbeweise
taxonomy_term_revision__field_zusatzfragen
taxonomy_term_revision__parent

EDIT: So the tables actually weren't deleted, like i said in the previous comments. They just got moved to a different scheme.

FirstSanny’s picture

Little workaround (it worked for me ;) ) for a successfull update:
1. clear website-scheme
2. reset normal scheme at pre-update version
3. run updates with latest drupal version
4. dump website-scheme
5. import dump into your main scheme
6. clear website-scheme

plach’s picture

Title: Update deleted all my taxonomy_* Tables » Update from 8.6.15 to 8.7.0 moved all my taxonomy_* and menu_link_content* tables to a different DB schema

Tentatively demoting this to major since it seems it's very uncommon and environment-specific and there's not actual data loss involved.

plach’s picture

Title: Update from 8.6.15 to 8.7.0 moved all my taxonomy_* and menu_link_content* tables to a different DB schema » Update from 8.6.15 to 8.7.0 moved all taxonomy_* and menu_link_content* tables to a different DB schema
hchonov’s picture

Priority: Critical » Major

Tentatively demoting this to major since it seems it's very uncommon and environment-specific and there's not actual data loss involved.

:)

amateescu’s picture

@FirstSanny, the DB schema change during the update is an interesting case, I haven't seen that in any other bug report about 8.7.x updates. What database driver are you using? And are you using some non-default/generic database configuration?

FirstSanny’s picture

@amateescu
This is our DB-Config. Hope, this helps. If you want to know whats behind this variables, just ask. :)
And we are using the mysql driver for a normal mysql on Amazon RDS.

$databases['default']['default'] = array (
  'database' => $_SERVER['RDS_DB_NAME'],
  'username' => $_SERVER['RDS_USERNAME'],
  'password' => $_SERVER['RDS_PASSWORD'],
  'prefix' => $_SERVER['RDS_DB_SCHEMA'].'.',
  'host' => $_SERVER['RDS_HOSTNAME'],
  'port' => $_SERVER['RDS_PORT'],
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
);

Edit: I don't know if this helps, but it also happens (only with the s3fs tables), when i use the cache clearing action from the S3FS Modul.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.9 was released on November 6 and is the final full bugfix release for the Drupal 8.7.x series. Drupal 8.7.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.8.0 on December 4, 2019. (Drupal 8.8.0-beta1 is available for testing.)

Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
quietone’s picture

Issue summary: View changes

As pointed on in #20, this seems it's very uncommon.

It has been three years and there has been this one report of this particular problem.

Is anyone else experiencing this problem? Is so, add a comment including the database and version being used. If we don't receive additional report, this may be closed after three months.

Thanks!

quietone’s picture

Issue tags: +Bug Smash Initiative

Adding tag

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

@FirstSanny, thanks for you help working to solve this and posting a workaround in #19.

There have been no further reports of this particular problem, so I am closing this as outdated. If you have encountered this problem, open a new issue and refer to this one.

Thanks.