migration file "2.5.1.js" failed #1875

Closed
opened 2026-02-20 16:07:22 -05:00 by deekerman · 3 comments
Owner

Originally created by @iamernie on GitHub (Sep 4, 2020).

Originally assigned to: @NGPixel on GitHub.

Describe the bug
Upgrading from Wiki.js 2.4.105 to 2.5.105 docker The following message is in the log

wiki | Loading configuration from /wiki/config.yml... OK
wiki | 2020-09-04T18:30:24.729Z [MASTER] info: =======================================
wiki | 2020-09-04T18:30:24.730Z [MASTER] info: = Wiki.js 2.5.105 =====================
wiki | 2020-09-04T18:30:24.731Z [MASTER] info: =======================================
wiki | 2020-09-04T18:30:24.731Z [MASTER] info: Initializing...
wiki | 2020-09-04T18:30:25.074Z [MASTER] info: Using database driver pg for postgres [ OK ]
wiki | 2020-09-04T18:30:25.078Z [MASTER] info: Connecting to database...
wiki | 2020-09-04T18:30:25.102Z [MASTER] info: Database Connection Successful [ OK ]
wiki | migration file "2.5.1.js" failed
wiki | migration failed with error: delete from "authentication" where "isEnabled" = $1 - update or delete on table "authentication" violates foreign key constraint "users_providerkey_foreign" on table "users"
wiki | 2020-09-04T18:30:25.134Z [MASTER] error: Database Initialization Error: delete from "authentication" where "isEnabled" = $1 - update or delete on table "authentication" violates foreign key constraint "users_providerkey_foreign" on table "users"

To Reproduce
Steps to reproduce the behavior:

  1. Pull the latest beta image
  2. run docker-compose up -d

Expected behavior
Database upgrades and site launches

Host Info (please complete the following information):

  • OS: Ubuntu 18.04, Docker
  • Wiki.js version: 2.5.105 docker
  • Database engine: postgres 9.7 docker

Additional context

Originally created by @iamernie on GitHub (Sep 4, 2020). Originally assigned to: @NGPixel on GitHub. **Describe the bug** Upgrading from Wiki.js 2.4.105 to 2.5.105 docker The following message is in the log wiki | Loading configuration from /wiki/config.yml... OK wiki | 2020-09-04T18:30:24.729Z [MASTER] info: ======================================= wiki | 2020-09-04T18:30:24.730Z [MASTER] info: = Wiki.js 2.5.105 ===================== wiki | 2020-09-04T18:30:24.731Z [MASTER] info: ======================================= wiki | 2020-09-04T18:30:24.731Z [MASTER] info: Initializing... wiki | 2020-09-04T18:30:25.074Z [MASTER] info: Using database driver pg for postgres [ OK ] wiki | 2020-09-04T18:30:25.078Z [MASTER] info: Connecting to database... wiki | 2020-09-04T18:30:25.102Z [MASTER] info: Database Connection Successful [ OK ] wiki | migration file "2.5.1.js" failed wiki | migration failed with error: delete from "authentication" where "isEnabled" = $1 - update or delete on table "authentication" violates foreign key constraint "users_providerkey_foreign" on table "users" wiki | 2020-09-04T18:30:25.134Z [MASTER] error: Database Initialization Error: delete from "authentication" where "isEnabled" = $1 - update or delete on table "authentication" violates foreign key constraint "users_providerkey_foreign" on table "users" **To Reproduce** Steps to reproduce the behavior: 1. Pull the latest beta image 2. run docker-compose up -d **Expected behavior** Database upgrades and site launches **Host Info (please complete the following information):** - OS: Ubuntu 18.04, Docker - Wiki.js version: 2.5.105 docker - Database engine: postgres 9.7 docker **Additional context**
deekerman 2026-02-20 16:07:22 -05:00
  • closed this issue
  • added the
    bug
    BETA
    labels
Author
Owner

@DecisionIT commented on GitHub (Sep 4, 2020):

Having the same issue on my test machine.

OS: Docker on Windows - using Ubuntu with WSL2 (test machine)
Wiki,Js Version: 2.5.105 (upgrade from 2.4.107) - docker
Database Engine: PostgreSQL 12.4 - docker

@DecisionIT commented on GitHub (Sep 4, 2020): Having the same issue on my test machine. OS: Docker on Windows - using Ubuntu with WSL2 (test machine) Wiki,Js Version: 2.5.105 (upgrade from 2.4.107) - docker Database Engine: PostgreSQL 12.4 - docker
Author
Owner

@NGPixel commented on GitHub (Sep 5, 2020):

You have some users that are using an authentication strategy that is not enabled. Can you try to either enable that strategy OR delete these users, then try the upgrade again?

Disabled authentication strategies are now kept during the migration. (fixed by 8490fc1267)

Can you try again using docker image requarks/wiki:canary-2.5.108?

@NGPixel commented on GitHub (Sep 5, 2020): ~You have some users that are using an authentication strategy that is not enabled. Can you try to either enable that strategy OR delete these users, then try the upgrade again?~ Disabled authentication strategies are now kept during the migration. (fixed by 8490fc1267b036bd7971434374f81324b53536fc) Can you try again using docker image `requarks/wiki:canary-2.5.108`?
Author
Owner

@iamernie commented on GitHub (Sep 5, 2020):

Removed the users. Upgraded successfully. Thanks!

@iamernie commented on GitHub (Sep 5, 2020): Removed the users. Upgraded successfully. Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/wiki#1875
No description provided.