Error on update from 1.5 to 2.0

Created on 18 November 2022, about 2 years ago
Updated 4 August 2024, 5 months ago

Problem/Motivation

I've had several sites in a multisite environment that have updated without a problem. There is one site that hits error.

 -------- ----------- --------------- ----------------------------------------------------------------------------------- 
  Module   Update ID   Type            Description                                                                        
 -------- ----------- --------------- ----------------------------------------------------------------------------------- 
  group    9201        hook_update_n   9201 - Update class name and handler class names for group_content_type.           
  group    9202        hook_update_n   9202 - Update class name and handler class names for group_content.                
  group    9203        hook_update_n   9203 - Update group_content DB table, fields and indexes.                          
  group    9204        hook_update_n   9204 - Remove the 'bypass group access' permission from all roles.                 
  group    9205        hook_update_n   9205 - Convert group roles with the 'administer group' permission to admin roles.  
  group    9206        hook_update_n   9206 - Convert synchronized group roles to new scope and target_role structure.    
  group    9207        hook_update_n   9207 - Convert default group roles to new scope and target_role structure.         
  group    9208        hook_update_n   9208 - Convert user created group roles to new scope and target_role structure.    
  group    9209        hook_update_n   9209 - Remove label and description from relationship types.                       
  group    9210        hook_update_n   9210 - Introduce the group_config_wrapper entity type.                             
 -------- ----------- --------------- ----------------------------------------------------------------------------------- 

>  [notice] Update started: group_update_9201
>  [notice] Update completed: group_update_9201
>  [notice] Update started: group_update_9202
>  [notice] Update completed: group_update_9202
>  [notice] Update started: group_update_9203
>  [error]  Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'gid' cannot be null: INSERT INTO "tmp_04f474group_relationship_field_data" ("id", "type", "langcode", "gid", "entity_id", "label", "uid", "created", "changed", "default_langcode", "plugin_id", "group_type") 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] => 6306
>     [:db_insert_placeholder_1] => group_content_type_43378fa2be589
>     [:db_insert_placeholder_2] => en
>     [: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] => group_node:page
>     [:db_insert_placeholder_11] => content_management
> )
>  in Drupal\mysql\Driver\Database\mysql\ExceptionHandler->handleExecutionException() (line 50 of /var/www/docroot/core/modules/mysql/src/Driver/Database/mysql/ExceptionHandler.php). 
>  [error]  The entity update process failed while processing the entity type group_content, ID: 6306. 
>  [error]  Update failed: group_update_9203 
 [error]  Update aborted by: group_update_9203 

Steps to reproduce

Since my other sites are fine, I don't know what is triggering this problem. I just ran the drush updb.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States shelane

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 States kwiechmann

    Was there any resolution on the original issue when executing db update? I have a similar issue and wonder if someone has a solution to share. The goal is to be on PHP 8.2 and silence overwhelming number of '"static" callables' errors in dblog. I found that group_update_9200, group_update_9201, and group_update_9202 executed cleanly. group_update_9203 continues to throw errors.

    I began with

    • Drupal Core:10.1.4
    • PHP 8.2
    • drupal/group:1.5
    • drupal/webform_group:1.0.0-x-dev@dev
    • no drupal/flexible_permissions

    After the updates,

    • Drupal Core:10.1.4
    • PHP 8.2
    • drupal/group:2.2.0
    • drupal/webform_group:2.0.x-dev@dev
    • drupal/flexible_permissions:1.0.0

    When running the db update, I started getting a string of IDs that started at 50745 and through 50748 which err with a "Column 'gid' cannot be null" message. As this is still in development, I was deleting from group_content. For scale of the project, group_content table is large with 120K+ rows.

     [info] Executing: C:/xampp/htdocs/cia-drupal/vendor/bin/drush updatedb:status --verbose --yes --strict=0 --uri=default --root=C:\xampp\htdocs\cia-drupal\docroot [34.3 sec, 68.87 MB]
     -------- ----------- --------------- -----------------------------------------------------------------------------------
      Module   Update ID   Type            Description
     -------- ----------- --------------- -----------------------------------------------------------------------------------
      group    9203        hook_update_n   9203 - Update group_content DB table, fields and indexes.
      group    9204        hook_update_n   9204 - Remove the 'bypass group access' permission from all roles.
      group    9205        hook_update_n   9205 - Convert group roles with the 'administer group' permission to admin roles.
      group    9206        hook_update_n   9206 - Convert synchronized group roles to new scope and target_role structure.
      group    9207        hook_update_n   9207 - Convert default group roles to new scope and target_role structure.
      group    9208        hook_update_n   9208 - Convert user created group roles to new scope and target_role structure.
      group    9209        hook_update_n   9209 - Remove label and description from relationship types.
      group    9210        hook_update_n   9210 - Introduce the group_config_wrapper entity type.
     -------- ----------- --------------- -----------------------------------------------------------------------------------
    
    
     // Do you wish to run the specified pending updates?: yes.
    
     [info] Executing: C:/xampp/htdocs/cia-drupal/vendor/bin/drush updatedb:batch-process 28980 --uri=default --root=C:\xampp\htdocs\cia-drupal\docroot [59.6 sec, 69.84 MB]
    >  [notice] Update started: group_update_9203
    >  [error]  Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'gid' cannot be null: INSERT INTO "tmp_a49152group_relationship_field_data" ("id",
     "type", "langcode", "gid", "entity_id", "label", "uid", "created", "changed", "default_langcode", "plugin_id", "group_type") 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_inser
    t_placeholder_11); Array
    > (
    >     [:db_insert_placeholder_0] => 50748
    >     [:db_insert_placeholder_1] => default-group_membership
    >     [:db_insert_placeholder_2] => en
    >     [: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] => group_membership
    >     [:db_insert_placeholder_11] => default
    > )
    >  in Drupal\mysql\Driver\Database\mysql\ExceptionHandler->handleExecutionException() (line 43 of C:\xampp\htdocs\cia-drupal\docroot\core\modules\mysql\src\Driver\Database\mysql\ExceptionHandler.php).
    >  [error]  The entity update process failed while processing the entity type group_content, ID: 50748.
    >  [error]  Update failed: group_update_9203
     [error]  Update aborted by: group_update_9203 [128.14 sec, 69.83 MB]
     [error]  Finished performing updates. [128.15 sec, 69.81 MB]
    
    

    AdvThanksance!!!

  • πŸ‡ΊπŸ‡ΈUnited States rbomhof New York, NY

    We are running into this issue trying to get to Drupal 10.2.x and Group 2.x. Was anyone ever able to figure out why that db update in particular was failing?

  • I was able to figure out a similar error on hook_update_n 9203 - Update group_content DB table, fields and indexes.

    There were orphaned database rows (non-existing group content type) on my case, it should be the same for you. Also, if you are willing to upgrade to Drupal 10.2.x make sure you are using the group 2.3.x branch. Here is the link for that dev branch https://www.drupal.org/project/group/releases/2.3.x-dev β†’

  • πŸ‡΅πŸ‡°Pakistan isalmanhaider

    getting this error on Drupal 9.5.11 while upgrading group from v1.5 to v2.2
    any hints/suggestions to debug or resolve?

    [notice] Update started: group_update_9203
    >  [error]  Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'uid' cannot be null: INSERT INTO "tmp_00d0a9group_relationship_field_data" ("id", "type", "langcode", "uid", "gid", "entity_id", "label", "created", "changed", "default_langcode", "plugin_id", "group_type") 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] => 292921
    >     [:db_insert_placeholder_1] => client-group_membership
    >     [:db_insert_placeholder_2] => en
    >     [: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] => group_membership
    >     [:db_insert_placeholder_11] => client
    > )
    >  in Drupal\mysql\Driver\Database\mysql\ExceptionHandler->handleExecutionException() (line 50 of /var/www/html/docroot/core/modules/mysql/src/Driver/Database/mysql/ExceptionHandler.php).
    >  [error]  The entity update process failed while processing the entity type group_content, ID: 292921.
    >  [error]  Update failed: group_update_9203
     [error]  Update aborted by: group_update_9203
     [error]  Finished performing updates. 
Production build 0.71.5 2024