Can't update module to latest version

I have module with version 8.x-1.4, and trying update to the version 3.0.0-alpha6

I run module update with site version update. And in terminal I got next error:

>  [notice] Update started: openid_connect_update_8198
>  [error]  Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42703]: Undefined column: 7 ERROR:  column "alias" of relation "router" does not exist
> LINE 1: ...T INTO "drupal_11_3_3"."router" ("name", "route", "alias") V...
>                                                              ^: INSERT INTO "drupal_11_3_3"."router" ("name", "route", "alias") 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
> (
> )
>  [error]  SQLSTATE[42703]: Undefined column: 7 ERROR:  column "alias" of relation "router" does not exist
> LINE 1: ...T INTO "drupal_11_3_3"."router" ("name", "route", "alias") V...
>                                                              ^: INSERT INTO "drupal_11_3_3"."router" ("name", "route", "alias") 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
> (
> )
>  
>  [error]  Update failed: openid_connect_update_8198 

I checked the "router" table and saw that there are really have not "alias" column.

The update with 8198 number has next code

>function openid_connect_update_8198() {
>  \Drupal::service('module_installer')->install(['externalauth']);
>}

It install the externalauth module.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

vadim.jin created an issue. See original summary.

vadim.jin’s picture

Issue summary: View changes

nickolaj made their first commit to this issue’s fork.

nickolaj’s picture

Status: Active » Needs review

Patch wraps `openid_connect_update_8198()` in a try-catch so it doesn't abort the entire update process. If `externalauth` installation fails (e.g. due to missing `alias` column in the `router` table), it logs the error and continues. The same installation is retried in `openid_connect_update_8203()`, and none of the updates between them (8199-8202) require externalauth. Also adds an early return if externalauth is already installed.

dpi’s picture

Issue tags: -module update from 8.x-1.4 version to 3.0.0-alpha6

Tag spam.