Can't install APP Audiobookshelf

Hi,

I tried to find a solution but i’m stuck, since EE update, some app can’t install on my system, I use to have Audiobookshelf working great but since, I have this error when i try to clean instal (I don’t have much in this docker so I tried to remove everything and start again)

Blockquote
2024-11-19 14:27:31.790022+00:00[2024-11-19 15:27:31.789] INFO: === Starting Server ===
2024-11-19 14:27:31.790700+00:00[2024-11-19 15:27:31.790] INFO: [Server] Init v2.17.1
2024-11-19 14:27:31.790805+00:00[2024-11-19 15:27:31.790] INFO: [Server] Node.js Version: v20.18.0
2024-11-19 14:27:31.790983+00:00[2024-11-19 15:27:31.790] INFO: [Server] Platform: linux
2024-11-19 14:27:31.791171+00:00[2024-11-19 15:27:31.791] INFO: [Server] Arch: x64
2024-11-19 14:27:31.794327+00:00[2024-11-19 15:27:31.794] INFO: [Database] Initializing db at “/config/absdatabase.sqlite”
2024-11-19 14:27:31.819676+00:00[2024-11-19 15:27:31.819] INFO: [Database] Loading extension /usr/local/lib/nusqlite3/libnusqlite3.so
2024-11-19 14:27:31.820139+00:00[2024-11-19 15:27:31.819] INFO: [Database] Successfully loaded extension /usr/local/lib/nusqlite3/libnusqlite3.so
2024-11-19 14:27:31.820322+00:00[2024-11-19 15:27:31.820] INFO: [Database] Db supports unaccent and unicode foldings
2024-11-19 14:27:31.820503+00:00[2024-11-19 15:27:31.820] INFO: [Database] Db connection was successful
2024-11-19 14:27:31.830902+00:00[2024-11-19 15:27:31.828] ERROR: [Database] Failed to run migrations Error: Failed to copy migrations to the config directory.
2024-11-19 14:27:31.830937+00:00at MigrationManager.init (/server/managers/MigrationManager.js:54:15)
2024-11-19 14:27:31.830968+00:00at async Database.init (/server/Database.js:183:7)
2024-11-19 14:27:31.830979+00:00at async Server.init (/server/Server.js:127:5)
2024-11-19 14:27:31.830990+00:00at async Server.start (/server/Server.js:193:5) {
2024-11-19 14:27:31.831001+00:00[cause]: [Error: EPERM: operation not permitted, copyfile ‘/server/migrations/v2.15.0-series-column-unique.js’ → ‘/config/migrations/v2.15.0-series-column-unique.js’] {
2024-11-19 14:27:31.831042+00:00errno: -1,
2024-11-19 14:27:31.831053+00:00code: ‘EPERM’,
2024-11-19 14:27:31.831064+00:00syscall: ‘copyfile’,
2024-11-19 14:27:31.831079+00:00path: ‘/server/migrations/v2.15.0-series-column-unique.js’,
2024-11-19 14:27:31.831097+00:00dest: ‘/config/migrations/v2.15.0-series-column-unique.js’
2024-11-19 14:27:31.831109+00:00}
2024-11-19 14:27:31.831120+00:00}
2024-11-19 14:27:31.831688+00:00[2024-11-19 15:27:31.831] FATAL: [Server] Unhandled rejection: Error: Database migration failed
2024-11-19 14:27:31.831752+00:00at Database.init (/server/Database.js:187:13)
2024-11-19 14:27:31.831779+00:00at async Server.init (/server/Server.js:127:5)
2024-11-19 14:27:31.831804+00:00at async Server.start (/server/Server.js:193:5)
2024-11-19 14:27:31.831835+00:00promise: Promise {
2024-11-19 14:27:31.831861+00:00 Error: Database migration failed
2024-11-19 14:27:31.831902+00:00at Database.init (/server/Database.js:187:13)
2024-11-19 14:27:31.831931+00:00at async Server.init (/server/Server.js:127:5)
2024-11-19 14:27:31.831957+00:00at async Server.start (/server/Server.js:193:5)
2024-11-19 14:27:31.831981+00:00}

Blockquote

Thanks a lot for your help.

I’m thinking this should be as simple as refreshing your apps catalog and trying again to install. The current version in the TrueNAS catalog should be 2.17.1.

Thanks for your help, i tried to refresh catalog and install, same problem, with your idea i tried to use costum app with :latest tag but same error.

2024-11-19 15:10:49.578118+00:00Config /config /metadata

2024-11-19 15:10:49.588850+00:00[2024-11-19 16:10:49.588] INFO: === Starting Server ===

2024-11-19 15:10:49.589553+00:00[2024-11-19 16:10:49.589] INFO: [Server] Init v2.17.1

2024-11-19 15:10:49.589734+00:00[2024-11-19 16:10:49.589] INFO: [Server] Node.js Version: v20.18.0

2024-11-19 15:10:49.589985+00:00[2024-11-19 16:10:49.589] INFO: [Server] Platform: linux

2024-11-19 15:10:49.590131+00:00[2024-11-19 16:10:49.590] INFO: [Server] Arch: x64

2024-11-19 15:10:49.592873+00:00[2024-11-19 16:10:49.592] INFO: [Database] absdatabase.sqlite not found at /config/absdatabase.sqlite

2024-11-19 15:10:49.593276+00:00[2024-11-19 16:10:49.593] INFO: [Database] Initializing db at “/config/absdatabase.sqlite”

2024-11-19 15:10:49.623732+00:00[2024-11-19 16:10:49.623] INFO: [Database] Loading extension /usr/local/lib/nusqlite3/libnusqlite3.so

2024-11-19 15:10:49.624214+00:00[2024-11-19 16:10:49.624] INFO: [Database] Successfully loaded extension /usr/local/lib/nusqlite3/libnusqlite3.so

2024-11-19 15:10:49.624542+00:00[2024-11-19 16:10:49.624] INFO: [Database] Db supports unaccent and unicode foldings

2024-11-19 15:10:49.624722+00:00[2024-11-19 16:10:49.624] INFO: [Database] Db connection was successful

2024-11-19 15:10:49.659601+00:00[2024-11-19 16:10:49.656] ERROR: [Database] Failed to run migrations Error: Failed to copy migrations to the config directory.

2024-11-19 15:10:49.659706+00:00at MigrationManager.init (/server/managers/MigrationManager.js:54:15)

2024-11-19 15:10:49.659759+00:00at async Database.init (/server/Database.js:183:7)

2024-11-19 15:10:49.659788+00:00at async Server.init (/server/Server.js:127:5)

2024-11-19 15:10:49.659814+00:00at async Server.start (/server/Server.js:193:5) {

2024-11-19 15:10:49.659839+00:00[cause]: [Error: EPERM: operation not permitted, copyfile ‘/server/migrations/v2.15.0-series-column-unique.js’ → ‘/config/migrations/v2.15.0-series-column-unique.js’] {

2024-11-19 15:10:49.659880+00:00errno: -1,

2024-11-19 15:10:49.659905+00:00code: ‘EPERM’,

2024-11-19 15:10:49.659930+00:00syscall: ‘copyfile’,

2024-11-19 15:10:49.659956+00:00path: ‘/server/migrations/v2.15.0-series-column-unique.js’,

2024-11-19 15:10:49.659995+00:00dest: ‘/config/migrations/v2.15.0-series-column-unique.js’

2024-11-19 15:10:49.660021+00:00}

2024-11-19 15:10:49.660046+00:00}

2024-11-19 15:10:49.660392+00:00[2024-11-19 16:10:49.660] FATAL: [Server] Unhandled rejection: Error: Database migration failed

2024-11-19 15:10:49.660438+00:00at Database.init (/server/Database.js:187:13)

2024-11-19 15:10:49.660485+00:00at async Server.init (/server/Server.js:127:5)

2024-11-19 15:10:49.660513+00:00at async Server.start (/server/Server.js:193:5)

2024-11-19 15:10:49.660539+00:00promise: Promise {

2024-11-19 15:10:49.660564+00:00 Error: Database migration failed

2024-11-19 15:10:49.660613+00:00at Database.init (/server/Database.js:187:13)

2024-11-19 15:10:49.660641+00:00at async Server.init (/server/Server.js:127:5)

2024-11-19 15:10:49.660664+00:00at async Server.start (/server/Server.js:193:5)

2024-11-19 15:10:49.660687+00:00}

Thanks again.

Ah I see now that it says [Server] Init v2.17.1, not sure about the different version in the migrations entries.

How are you mounting the storage options? It may be as simple as a permissions issue if 568 doesn’t have access to your host paths to perform the migrations?

This is what i’m doing, i checked multiple times, 568 has access to both pool, it works for other app like plex.

Thanks you so much for helping.

My datasets have the following permissions and it works:

Permissions
Owner: apps
Group:apps

person: owner@ - apps -> Allow | Full Control
people: group@ - apps -> Allow | Full Control
person: User - duplicati -> Allow | Full Control

I don’t see anything there that looks wrong. You might try forcing the permissions by using the Enable ACL checkbox and then adding an entry for a User ID 568, Full_Control, and then ticking the force flag checkbox, but I’d expect if apps is already the dataset owner that wouldn’t be necessary.

Otherwise I’d try reaching out to audiobookshelf directly since I think that migration process that is erroring is something it does in the container, not a TrueNAS process.

I also had this issue, I spent days trying to fix it.
I finally managed to fix it today!
The error:

[Error: EPERM: operation not permitted, copyfile ‘/server/migrations/v2.15.0-series-column-unique.js’ → ‘/config/migrations/v2.15.0-series-column-unique.js’] {

I think it’s something to do with the directory permissions (even though I specified RunAs user, it ran as 568, I also specified ACL permissions on the /config and /metadata folders)

My solution:

  1. Deleting the image and re-installing it, but keeping everything as default (including the storage settings - letting it create it’s own storage (ixVolume not Host Path))
  2. Copy the /config and /metadata folders from where the container mounted it’s volumes (in my case: /mnt/.ix-apps/app_mounts/audiobookshelf) to my raid storage.
  3. Delete the container.
  4. Re-install audiobookshelf using Host Path (I didn’t select ACL) for both /config and /metadata.

Now audiobookshelf is running smoothly and not crashing.
I did need to add another mount point for the books, and I did select ACL.

I hope this will help you

Here is what I have configured:

  • Audiobookshelf Config Storage: /mnt/pool/app-config/audiobookshelf
  • Audiobookshelf Metadata Storage: /mnt/pool/app-config/audiobookshelf
  • Additional Storage: /audiobooks/mnt/pool/plex (Plex is my media library)
  • Additional Storage: /metadata/backups/mnt/pool/backup/Audio BookShelf (Backup directory)

All are using Host Path without ACLs. The “metadata” is simply the authors and items directory, and peacefully co-exist with the configuration. I just created a directory called /mnt/pool/app-config to hold my configs.

Using an iXvolume automatically sets ownership and acl options that need to be manually set for a host path datasets. It might be worth trying to compare the configuration of this cloned volume to the host path setups you were attempting to use to try to determine what the difference(s) is/are.

I havent been able to get any of the updates to work for audiobookshelf. i have to always roll back to version 1.0.14 which works perfectly as far as I can tell. i see no issues with it. not sure what I need to do to make the new ones work. I’m using Version: Dragonfish-24.04.2.2. will update server and see if that breaks any of my other apps. crossing fingers. maybe that will fix audiobookshelf for me and allow me the latest updates.

so if i try to update my audiobookshelf i get pretty much the same error you do. like i mentioned on my previous reply. had to roll back to 1.0.14 any help on this would be great. why would permissions be great for several updates but now the last 5 or 6 updates will not work.