[Bug]: Migration issues with version 2.22 and 2.23 #2782

Open
opened 2026-04-25 00:10:35 +02:00 by adam · 8 comments
Owner

Originally created by @aznkvaj on GitHub (May 19, 2025).

What happened?

After upgrading to 2.22 and/or 2.23 the docker no longer spin up.
The service would crash with the following error log.

What did you expect to happen?

Expect to just start up as normal.

Steps to reproduce the issue

  1. Just changing image version to 2.22.0 or 2.23.0

Audiobookshelf version

2.23.0

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

Running in production mode.
Options: CONFIG_PATH=/config, METADATA_PATH=/metadata, PORT=30067, HOST=undefined, SOURCE=docker, ROUTER_BASE_PATH=/audiobookshelf
[2025-05-19 02:50:15.146] INFO: === Starting Server ===
[2025-05-19 02:50:15.147] INFO: [Server] Init v2.23.0
[2025-05-19 02:50:15.147] INFO: [Server] Node.js Version: v20.19.2
[2025-05-19 02:50:15.147] INFO: [Server] Platform: linux
[2025-05-19 02:50:15.147] INFO: [Server] Arch: x64
[2025-05-19 02:50:15.151] INFO: [Database] Initializing db at "/config/absdatabase.sqlite"
[2025-05-19 02:50:15.180] INFO: [Database] Loading extension /usr/local/lib/nusqlite3/libnusqlite3.so
[2025-05-19 02:50:15.181] INFO: [Database] Successfully loaded extension /usr/local/lib/nusqlite3/libnusqlite3.so
[2025-05-19 02:50:15.181] INFO: [Database] Db supports unaccent and unicode foldings
[2025-05-19 02:50:15.181] INFO: [Database] Db connection was successful
[2025-05-19 02:50:15.193] ERROR: [Database] Failed to run migrations Error: Failed to copy migrations to the config directory.
    at MigrationManager.init (/app/server/managers/MigrationManager.js:54:15)
    at async Database.init (/app/server/Database.js:183:7)
    at async Server.init (/app/server/Server.js:161:5)
    at async Server.start (/app/server/Server.js:227:5) {
  [cause]: [Error: EPERM: operation not permitted, copyfile '/app/server/migrations/v2.15.1-reindex-nocase.js' -> '/config/migrations/v2.15.1-reindex-nocase.js'] {
    errno: -1,
    code: 'EPERM',
    syscall: 'copyfile',
    path: '/app/server/migrations/v2.15.1-reindex-nocase.js',
    dest: '/config/migrations/v2.15.1-reindex-nocase.js'
  }
}
[2025-05-19 02:50:15.195] FATAL: [Server] Unhandled rejection: Error: Database migration failed
    at Database.init (/app/server/Database.js:187:13)
    at async Server.init (/app/server/Server.js:161:5)
    at async Server.start (/app/server/Server.js:227:5)
promise: Promise {
  <rejected> Error: Database migration failed
      at Database.init (/app/server/Database.js:187:13)
      at async Server.init (/app/server/Server.js:161:5)
      at async Server.start (/app/server/Server.js:227:5)
}

Additional Notes

No response

Originally created by @aznkvaj on GitHub (May 19, 2025). ### What happened? After upgrading to 2.22 and/or 2.23 the docker no longer spin up. The service would crash with the following error log. ### What did you expect to happen? Expect to just start up as normal. ### Steps to reproduce the issue 1. Just changing image version to 2.22.0 or 2.23.0 ### Audiobookshelf version 2.23.0 ### How are you running audiobookshelf? Docker ### What OS is your Audiobookshelf server hosted from? Linux ### If the issue is being seen in the UI, what browsers are you seeing the problem on? None ### Logs ```shell Running in production mode. Options: CONFIG_PATH=/config, METADATA_PATH=/metadata, PORT=30067, HOST=undefined, SOURCE=docker, ROUTER_BASE_PATH=/audiobookshelf [2025-05-19 02:50:15.146] INFO: === Starting Server === [2025-05-19 02:50:15.147] INFO: [Server] Init v2.23.0 [2025-05-19 02:50:15.147] INFO: [Server] Node.js Version: v20.19.2 [2025-05-19 02:50:15.147] INFO: [Server] Platform: linux [2025-05-19 02:50:15.147] INFO: [Server] Arch: x64 [2025-05-19 02:50:15.151] INFO: [Database] Initializing db at "/config/absdatabase.sqlite" [2025-05-19 02:50:15.180] INFO: [Database] Loading extension /usr/local/lib/nusqlite3/libnusqlite3.so [2025-05-19 02:50:15.181] INFO: [Database] Successfully loaded extension /usr/local/lib/nusqlite3/libnusqlite3.so [2025-05-19 02:50:15.181] INFO: [Database] Db supports unaccent and unicode foldings [2025-05-19 02:50:15.181] INFO: [Database] Db connection was successful [2025-05-19 02:50:15.193] ERROR: [Database] Failed to run migrations Error: Failed to copy migrations to the config directory. at MigrationManager.init (/app/server/managers/MigrationManager.js:54:15) at async Database.init (/app/server/Database.js:183:7) at async Server.init (/app/server/Server.js:161:5) at async Server.start (/app/server/Server.js:227:5) { [cause]: [Error: EPERM: operation not permitted, copyfile '/app/server/migrations/v2.15.1-reindex-nocase.js' -> '/config/migrations/v2.15.1-reindex-nocase.js'] { errno: -1, code: 'EPERM', syscall: 'copyfile', path: '/app/server/migrations/v2.15.1-reindex-nocase.js', dest: '/config/migrations/v2.15.1-reindex-nocase.js' } } [2025-05-19 02:50:15.195] FATAL: [Server] Unhandled rejection: Error: Database migration failed at Database.init (/app/server/Database.js:187:13) at async Server.init (/app/server/Server.js:161:5) at async Server.start (/app/server/Server.js:227:5) promise: Promise { <rejected> Error: Database migration failed at Database.init (/app/server/Database.js:187:13) at async Server.init (/app/server/Server.js:161:5) at async Server.start (/app/server/Server.js:227:5) } ``` ### Additional Notes _No response_
adam added the bug label 2026-04-25 00:10:35 +02:00
Author
Owner

@exonerationem commented on GitHub (May 19, 2025):

After upgrading to 2.22 and/or 2.23 the docker no longer spin up.
The service would crash with the following error log.
Logs
node:internal/modules/cjs/loader:1215

throw err;
^
Error: Cannot find module '/index.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15)
at Module._load (node:internal/modules/cjs/loader:1043:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:164:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v20.19.2

@exonerationem commented on GitHub (May 19, 2025): After upgrading to 2.22 and/or 2.23 the docker no longer spin up. The service would crash with the following error log. Logs node:internal/modules/cjs/loader:1215  throw err; ^ Error: Cannot find module '/index.js' at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15) at Module._load (node:internal/modules/cjs/loader:1043:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:164:12) at node:internal/main/run_main_module:28:49 { code: 'MODULE_NOT_FOUND', requireStack: [] } Node.js v20.19.2
Author
Owner

@progecon commented on GitHub (May 19, 2025):

I am experiencing the exact same issue. Reverting the version to pre-2.22 fixes the issue

@progecon commented on GitHub (May 19, 2025): I am experiencing the exact same issue. Reverting the version to pre-2.22 fixes the issue
Author
Owner

@nichwall commented on GitHub (May 19, 2025):

@exonerationem and @progecon you are likely encountering https://github.com/advplyr/audiobookshelf/issues/4292. Please read through the discussion there to attempt to resolve.

@nichwall commented on GitHub (May 19, 2025): @exonerationem and @progecon you are likely encountering https://github.com/advplyr/audiobookshelf/issues/4292. Please read through the discussion there to attempt to resolve.
Author
Owner

@exonerationem commented on GitHub (May 19, 2025):

@nichwall thanks
Under Volumes, keep only these binds:
/podcasts → host_path/Podcasts
/audiobooks → host_path/audiobooks
/config → host_path/audiobookshelf/config
/metadata → host_path/Metadata
Pull and Redeploy the new image can fix it

@exonerationem commented on GitHub (May 19, 2025): @nichwall thanks Under Volumes, keep only these binds: /podcasts → host_path/Podcasts /audiobooks → host_path/audiobooks /config → host_path/audiobookshelf/config /metadata → host_path/Metadata Pull and Redeploy the new image can fix it
Author
Owner

@mondychan commented on GitHub (May 21, 2025):

@exonerationem can confirm, had a bind of my external folder mounted into container, which caused the issue,
I removed the bind, redeployed, container started fine and web ui was acessible,
after that i put the bind back in, redeployed again, and all is working fine now on 2.23, thx

@mondychan commented on GitHub (May 21, 2025): @exonerationem can confirm, had a bind of my external folder mounted into container, which caused the issue, I removed the bind, redeployed, container started fine and web ui was acessible, after that i put the bind back in, redeployed again, and all is working fine now on 2.23, thx
Author
Owner

@aznkvaj commented on GitHub (May 21, 2025):

I only have 3 binding points. It looks like a write permission issue. If I go into the docker terminal and copy the files over manually it works just fine. So I am not sure what's causing the issue. This only started on 2.22.0 and 2.23.0. Not fully sure what changed to have caused this issue.

volumes:
  - bind:
      create_host_path: False
      propagation: rprivate
    read_only: False
    source: /mnt/zstorage/apps/audiobookshelf/audiobooks
    target: /audiobooks
    type: bind
  - bind:
      create_host_path: False
      propagation: rprivate
    read_only: False
    source: /mnt/zstorage/apps/audiobookshelf/config
    target: /config
    type: bind
  - bind:
      create_host_path: False
      propagation: rprivate
    read_only: False
    source: /mnt/zstorage/apps/audiobookshelf/metadata
    target: /metadata
    type: bind
@aznkvaj commented on GitHub (May 21, 2025): I only have 3 binding points. It looks like a write permission issue. If I go into the docker terminal and copy the files over manually it works just fine. So I am not sure what's causing the issue. This only started on 2.22.0 and 2.23.0. Not fully sure what changed to have caused this issue. volumes: - bind: create_host_path: False propagation: rprivate read_only: False source: /mnt/zstorage/apps/audiobookshelf/audiobooks target: /audiobooks type: bind - bind: create_host_path: False propagation: rprivate read_only: False source: /mnt/zstorage/apps/audiobookshelf/config target: /config type: bind - bind: create_host_path: False propagation: rprivate read_only: False source: /mnt/zstorage/apps/audiobookshelf/metadata target: /metadata type: bind
Author
Owner

@aznkvaj commented on GitHub (May 21, 2025):

I more or less just gave up on trying to fix the issue.
I just downloaded the backup from the webui of 2.21.0.
Then did a clean install of 2.23.0 with new mounting locations for config and metadata with the correct permissions.
Then did a restore using the backup.

@aznkvaj commented on GitHub (May 21, 2025): I more or less just gave up on trying to fix the issue. I just downloaded the backup from the webui of 2.21.0. Then did a clean install of 2.23.0 with new mounting locations for config and metadata with the correct permissions. Then did a restore using the backup.
Author
Owner

@The-Flix commented on GitHub (May 29, 2025):

I more or less just gave up on trying to fix the issue. I just downloaded the backup from the webui of 2.21.0. Then did a clean install of 2.23.0 with new mounting locations for config and metadata with the correct permissions. Then did a restore using the backup.

Did the same today, a clean install and restore from backup did the job. Thanks! :-)

@The-Flix commented on GitHub (May 29, 2025): > I more or less just gave up on trying to fix the issue. I just downloaded the backup from the webui of 2.21.0. Then did a clean install of 2.23.0 with new mounting locations for config and metadata with the correct permissions. Then did a restore using the backup. Did the same today, a clean install and restore from backup did the job. Thanks! :-)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2782