When processing lingotek_update_8011() for update from Lingotek 8.x-1.12 to 8.x-2.0-rc1, the update process errors with the following error and the update aborts and lingotek_update_8011() can not completely process, which leaves the site unresponsive with "Base table or view not found: 1146 Table 'manh_mcdev.lingotek_metadata' doesn't exist" reported in logs.

Here's the exact error message. going to continue looking into this. Based on the update hook number, I think this is a 8.x.1.x issue. I think the site db I'm working had previously updated the code, but the update hook never processed completely. The lingotek_temporary_content_metadata table exists already.

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'hash' cannot be null: INSERT INTO {lingotek_temporary_content_metadata} (entity_type, entity_id, [error]
document_id, hash, profile, translation_source, translation_status) 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); Array
(
[:db_insert_placeholder_0] => node
[:db_insert_placeholder_1] => 6566
[:db_insert_placeholder_2] => 0bb5fa44-0f47-4ca5-a9a3-5bc139176b34
[:db_insert_placeholder_3] =>
[:db_insert_placeholder_4] =>
[:db_insert_placeholder_5] =>
[:db_insert_placeholder_6] =>
{"en":"CURRENT","en-au":"REQUEST","en-gb":"REQUEST","en-in":"REQUEST","en-nl":"REQUEST","fr":"CURRENT","nl":"CURRENT","es":"CURRENT","zh-hans":"CURRENT","ja":"CURRENT","nl-be":"REQUEST","en-hk":"REQUEST","en-id":"REQUEST","en-nz":"REQUEST","en-sg":"REQUEST","en-za":"REQUEST","en-ae":"REQUEST","fi":"REQUEST","hu":"REQUEST","is":"REQUEST","de":"REQUEST","it":"REQUEST","pt-br":"REQUEST","ms-my":"REQUEST","nb":"REQUEST","pl":"REQUEST","pt-pt":"REQUEST","ro":"REQUEST","ru":"REQUEST","es-es":"REQUEST","es-pa":"REQUEST","sv":"REQUEST","th":"REQUEST"}
)

Performing lingotek_update_8011 [ok]
Failed: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'hash' cannot be null: INSERT INTO {lingotek_temporary_content_metadata} (entity_type, [error]
entity_id, document_id, hash, profile, translation_source, translation_status) 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); Array
(
[:db_insert_placeholder_0] => node
[:db_insert_placeholder_1] => 6566
[:db_insert_placeholder_2] => 0bb5fa44-0f47-4ca5-a9a3-5bc139176b34
[:db_insert_placeholder_3] =>
[:db_insert_placeholder_4] =>
[:db_insert_placeholder_5] =>
[:db_insert_placeholder_6] =>
{"en":"CURRENT","en-au":"REQUEST","en-gb":"REQUEST","en-in":"REQUEST","en-nl":"REQUEST","fr":"CURRENT","nl":"CURRENT","es":"CURRENT","zh-hans":"CURRENT","ja":"CURRENT","nl-be":"REQUEST","en-hk":"REQUEST","en-id":"REQUEST","en-nz":"REQUEST","en-sg":"REQUEST","en-za":"REQUEST","en-ae":"REQUEST","fi":"REQUEST","hu":"REQUEST","is":"REQUEST","de":"REQUEST","it":"REQUEST","pt-br":"REQUEST","ms-my":"REQUEST","nb":"REQUEST","pl":"REQUEST","pt-pt":"REQUEST","ro":"REQUEST","ru":"REQUEST","es-es":"REQUEST","es-pa":"REQUEST","sv":"REQUEST","th":"REQUEST"}
)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jasonawant created an issue. See original summary.

jasonawant’s picture

Update

This changes the db table column type to allow null values. What's the impact of allowing null hash values for this update process?

drush php-eval "db_change_field('lingotek_temporary_content_metadata', 'hash', 'hash', ['description' => 'The Lingotek hash.','type' => 'varchar','length' => 255, 'not null' => FALSE,]);"

penyaskito’s picture

Title: \Integrity constraint violation: 1048 Column 'hash' cannot be null » Upgrading to 8.x-2.x fails if hash is NULL in the DB
penyaskito’s picture

The last submitted patch, 5: 2890026-upgrade-hash-null-7.patch, failed testing. View results

The last submitted patch, 5: 2890026-upgrade-hash-null-7.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 5: 2890026-upgrade-hash-null-7.only-tests.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

penyaskito’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev

Oops wrong version.

penyaskito’s picture

Status: Needs review » Needs work

The last submitted patch, 10: 2890026-upgrade-hash-null-7.only-tests.patch, failed testing. View results

penyaskito’s picture

Status: Needs work » Reviewed & tested by the community

Tests passed and failed as expected.

  • penyaskito committed f9ad0b4 on 8.x-2.x
    Issue #2890026 by penyaskito, jasonawant: Upgrading to 8.x-2.x fails if...
penyaskito’s picture

Status: Reviewed & tested by the community » Fixed

Committed f9ad0b4 and pushed to 8.x-2.x. Thanks!

jasonawant’s picture

Status: Fixed » Active

Hi,

I'm still experience this issue for the reasons explained in related issue comment > https://www.drupal.org/node/2889971#comment-12147239

jasonawant’s picture

Status: Active » Fixed

Updating, back to fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.