[Bug]: Database migration failed after update from 2.17.2 #2413

Closed
opened 2026-04-25 00:06:53 +02:00 by adam · 4 comments
Owner

Originally created by @justsomebody42 on GitHub (Dec 12, 2024).

What happened?

After updating from 2.17.2 the database cannot be migrated.
None of the newer versions until 2.17.5 have worked.
I have tried updating to update with the 2.17.2 database in place and starting the newer version, as well as creating a backup, starting the new version without a database and restoring the database from a backup. Both variants resulted in the same error message (See logs below)

What did you expect to happen?

Database migration working during or after update from 2.17.2 to 2.17.5

Steps to reproduce the issue

  1. Running instance with version 2.17.2
  2. Update to 2.17.5

Audiobookshelf version

2.17.2

How are you running audiobookshelf?

Other (list in "Additional Notes" box)

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

Config /config /metadata
[2024-12-12 20:45:11.990] INFO: === Starting Server ===
[2024-12-12 20:45:11.993] INFO: [Server] Init v2.17.5
[2024-12-12 20:45:11.993] INFO: [Server] Node.js Version: v20.18.1
[2024-12-12 20:45:11.993] INFO: [Server] Platform: linux
[2024-12-12 20:45:11.994] INFO: [Server] Arch: x64
[2024-12-12 20:45:11.996] INFO: [Database] Initializing db at "/config/absdatabase.sqlite"
[2024-12-12 20:45:12.012] INFO: [Database] Loading extension /usr/local/lib/nusqlite3/libnusqlite3.so
[2024-12-12 20:45:12.012] INFO: [Database] Successfully loaded extension /usr/local/lib/nusqlite3/libnusqlite3.so
[2024-12-12 20:45:12.012] INFO: [Database] Db supports unaccent and unicode foldings
[2024-12-12 20:45:12.012] INFO: [Database] Db connection was successful
[2024-12-12 20:45:12.018] ERROR: [Database] Failed to run migrations Error: EISDIR: illegal operation on a directory, read
    at Object.readFileSync (node:fs:448:20)
    at resolve (/server/managers/MigrationManager.js:142:31)
    at /server/libs/umzug/umzug.js:330:14
    at Array.map (<anonymous>)
    at Umzug.migrations (/server/libs/umzug/umzug.js:325:20)
    at migrations (/server/managers/MigrationManager.js:166:23)
    at Umzug.paths [as migrations] (/server/libs/umzug/umzug.js:317:32)
    at MigrationManager.runMigrations (/server/managers/MigrationManager.js:82:41)
    at async Database.init (/server/Database.js:184:7)
    at async Server.init (/server/Server.js:126:5) {
  errno: -21,
  code: 'EISDIR',
  syscall: 'read'
}
[2024-12-12 20:45:12.020] FATAL: [Server] Unhandled rejection: Error: Database migration failed
    at Database.init (/server/Database.js:187:13)
    at async Server.init (/server/Server.js:126:5)
    at async Server.start (/server/Server.js:192:5) 
promise: Promise {
  <rejected> Error: Database migration failed
      at Database.init (/server/Database.js:187:13)
      at async Server.init (/server/Server.js:126:5)
      at async Server.start (/server/Server.js:192:5)
}

Additional Notes

Audiobookshelf is running as container in a Kubernetes cluser.
/config folder is mounted from a local folder

Originally created by @justsomebody42 on GitHub (Dec 12, 2024). ### What happened? After updating from 2.17.2 the database cannot be migrated. None of the newer versions until 2.17.5 have worked. I have tried updating to update with the 2.17.2 database in place and starting the newer version, as well as creating a backup, starting the new version without a database and restoring the database from a backup. Both variants resulted in the same error message (See logs below) ### What did you expect to happen? Database migration working during or after update from 2.17.2 to 2.17.5 ### Steps to reproduce the issue 1. Running instance with version 2.17.2 2. Update to 2.17.5 ### Audiobookshelf version 2.17.2 ### How are you running audiobookshelf? Other (list in "Additional Notes" box) ### 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 Config /config /metadata [2024-12-12 20:45:11.990] INFO: === Starting Server === [2024-12-12 20:45:11.993] INFO: [Server] Init v2.17.5 [2024-12-12 20:45:11.993] INFO: [Server] Node.js Version: v20.18.1 [2024-12-12 20:45:11.993] INFO: [Server] Platform: linux [2024-12-12 20:45:11.994] INFO: [Server] Arch: x64 [2024-12-12 20:45:11.996] INFO: [Database] Initializing db at "/config/absdatabase.sqlite" [2024-12-12 20:45:12.012] INFO: [Database] Loading extension /usr/local/lib/nusqlite3/libnusqlite3.so [2024-12-12 20:45:12.012] INFO: [Database] Successfully loaded extension /usr/local/lib/nusqlite3/libnusqlite3.so [2024-12-12 20:45:12.012] INFO: [Database] Db supports unaccent and unicode foldings [2024-12-12 20:45:12.012] INFO: [Database] Db connection was successful [2024-12-12 20:45:12.018] ERROR: [Database] Failed to run migrations Error: EISDIR: illegal operation on a directory, read at Object.readFileSync (node:fs:448:20) at resolve (/server/managers/MigrationManager.js:142:31) at /server/libs/umzug/umzug.js:330:14 at Array.map (<anonymous>) at Umzug.migrations (/server/libs/umzug/umzug.js:325:20) at migrations (/server/managers/MigrationManager.js:166:23) at Umzug.paths [as migrations] (/server/libs/umzug/umzug.js:317:32) at MigrationManager.runMigrations (/server/managers/MigrationManager.js:82:41) at async Database.init (/server/Database.js:184:7) at async Server.init (/server/Server.js:126:5) { errno: -21, code: 'EISDIR', syscall: 'read' } [2024-12-12 20:45:12.020] FATAL: [Server] Unhandled rejection: Error: Database migration failed at Database.init (/server/Database.js:187:13) at async Server.init (/server/Server.js:126:5) at async Server.start (/server/Server.js:192:5) promise: Promise { <rejected> Error: Database migration failed at Database.init (/server/Database.js:187:13) at async Server.init (/server/Server.js:126:5) at async Server.start (/server/Server.js:192:5) } ``` ### Additional Notes Audiobookshelf is running as container in a Kubernetes cluser. /config folder is mounted from a local folder
adam added the bug label 2026-04-25 00:06:53 +02:00
adam closed this issue 2026-04-25 00:06:53 +02:00
Author
Owner

@advplyr commented on GitHub (Dec 13, 2024):

Can you check the contents of the migrations folder inside the /config folder

@advplyr commented on GitHub (Dec 13, 2024): Can you check the contents of the `migrations` folder inside the `/config` folder
Author
Owner

@justsomebody42 commented on GitHub (Dec 13, 2024):

Thanks for the hint!
I found a folder named "@eaDir" in it.
The migrations folder was mounted from a Synology NAS during my test run and I migrated the existing folders over into the produciton installation.
The Synology drive keeps some metadata in the @eaDir folder, equally anoying as the .DS_Store non-sense of Apple machines...
Cleaning the migrations folder helped and the update went fine.
Thanks again for the hint!

It might be a good idea to only read files with names matching a pattern, as this folder will always be added again, if the folder is hosted on a Synology NAS. As well, Apple users might run into similar issues.

@justsomebody42 commented on GitHub (Dec 13, 2024): Thanks for the hint! I found a folder named "@eaDir" in it. The migrations folder was mounted from a Synology NAS during my test run and I migrated the existing folders over into the produciton installation. The Synology drive keeps some metadata in the @eaDir folder, equally anoying as the .DS_Store non-sense of Apple machines... Cleaning the migrations folder helped and the update went fine. Thanks again for the hint! It might be a good idea to only read files with names matching a pattern, as this folder will always be added again, if the folder is hosted on a Synology NAS. As well, Apple users might run into similar issues.
Author
Owner

@nichwall commented on GitHub (Dec 13, 2024):

As a note, the SQLite database should be on the same device (not a network drive) as the server or else something will get corrupted eventually.

Edit: I missed that you said it is now a local folder in the original post.

@nichwall commented on GitHub (Dec 13, 2024): As a note, the SQLite database should be on the same device (not a network drive) as the server or else something will get corrupted eventually. Edit: I missed that you said it is now a local folder in the original post.
Author
Owner

@justsomebody42 commented on GitHub (Dec 13, 2024):

It was a local folder in the test installation as well.
A docker container ran on a synology NAS and mounted a local folder to /config.
Synology stores "extended attributes" in the @eaDir folders in every local folder...

@justsomebody42 commented on GitHub (Dec 13, 2024): It was a local folder in the test installation as well. A docker container ran on a synology NAS and mounted a local folder to /config. Synology stores "extended attributes" in the @eaDir folders in every local folder...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2413