user_update_9301 fail during update from D8 to D9

Created on 15 May 2023, over 1 year ago

Problem/Motivation

When upgrading from Drupal 8.9 to Drupal 9.5, I get the following error from user_update_9301 :

[error] SQLSTATE[42P16]: Invalid table definition: 7 ERREUR: les clés primaires multiples ne sont pas autorisées pour la table « users »: ALTER TABLE "users" ADD CONSTRAINT users____pkey PRIMARY KEY ("uid"); Array
> (
> )
>
> [error] Update failed: user_update_9301

(Language is french, this reads "Multiple primary keys are not allowed for the table "users" ")

When I look up into my database before the update, it turns out that my user table already have the key "uid". I'm not sure this is normal for Drupal 8.9, but it seems to me that the upgrade is trying to add this key when it's already there.

I'm using PostGreSQL 11.

Steps to reproduce

  • run Drupal 8.9
  • require Drupal ^9 via composer
  • run drush dbupdate

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

9.5

Component
Database update 

Last updated 8 days ago

No maintainer
Created by

Live updates comments and jobs are added and updated live.
  • PostgreSQL

    Particularly affects sites running on the PostgreSQL database.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024