drupaldrupal-8drush

Cannot update to Drupal 8.7.1 because of taxonomy_post_update_make_taxonomy_term_revisionable


After running composer update drupal/core webflo/drupal-core-require-dev --with-dependencies to update to v8.7.1, and then running drush updb, the update fails here:

[notice] Update started: taxonomy_post_update_make_taxonomy_term_revisionable [4.77 sec, 33.46 MB]
[error]  Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null: INSERT INTO {tmp_b3edd9taxonomy_term_field_data} (tid, revision_id, vid, langcode, name, description__value, description__format, weight, changed, default_langcode, status, revision_translation_affected) 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, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11); 
Array
(
   [:db_insert_placeholder_0] => 1
   [:db_insert_placeholder_1] => 1
   [:db_insert_placeholder_2] => tags
   [:db_insert_placeholder_3] => zxx
   [:db_insert_placeholder_4] =>
   [:db_insert_placeholder_5] =>
   [:db_insert_placeholder_6] =>
   [:db_insert_placeholder_7] =>
   [:db_insert_placeholder_8] =>
   [:db_insert_placeholder_9] =>
   [:db_insert_placeholder_10] =>
   [:db_insert_placeholder_11] => 1
)
in Drupal\Core\Database\Connection->handleQueryException() (line 689 of /mnt/www/html/optivode42/docroot/core/lib/Drupal/Core/Database/Connection.php). [7.12 sec, 45.21 MB]
[error]  The entity update process failed while processing the entity type taxonomy_term, ID: 1. [8.17 sec, 45.24 MB]
[error]  Update failed: taxonomy_post_update_make_taxonomy_term_revisionable [8.17 sec, 38.9 MB]

Other solutions suggested bad data in the taxonomy_term_field_data field, but that doesn't seem to be the problem here.

I checked taxonomy_term_field_data and there are no records where name is NULL, nor do I even have any records with langcode zxx, so I'm a bit at a loss now. Seems like there's nothing I can delete to fix this like in the other answers.

*Edit: I do have langcode zxx records in the taxonomy_term_data, so I deleted these records, and I get the same error, but with:

Array
(
   [:db_insert_placeholder_0] => 2
   [:db_insert_placeholder_1] => 2
   [:db_insert_placeholder_2] => tags
   [:db_insert_placeholder_3] => en
   [:db_insert_placeholder_4] =>
   [:db_insert_placeholder_5] =>
   [:db_insert_placeholder_6] =>
   [:db_insert_placeholder_7] =>
   [:db_insert_placeholder_8] =>
   [:db_insert_placeholder_9] =>
   [:db_insert_placeholder_10] =>
   [:db_insert_placeholder_11] => 1
)

Solution

  • I found that this is linked to a bug in the replicate-ui module which actually creates taxonomies without creating a real parent record in the taxonomy_index table.

    Thus, I have opened up a bug report with the developer to fix this.

    In the meantime, I actually upgraded to Drupal v8.6.16 since that has the security update that I needed, and I don't need to go all the way to v8.7 just yet.