[Bug]: ABS does not deploy schema when docker container isn't run as root #1806

Closed
opened 2026-04-24 23:58:45 +02:00 by adam · 2 comments
Owner

Originally created by @hydrian on GitHub (Mar 11, 2024).

Describe the issue

What really happened: (Docker logs)

2024-03-10 05:48:02.064] INFO: === Starting Server ===
[2024-03-10 05:48:02.081] INFO: [Server] Init v2.8.0
[2024-03-10 05:48:02.315] INFO: [Database] absdatabase.sqlite not found at /config/absdatabase.sqlite
[2024-03-10 05:48:02.316] INFO: [Database] Initializing db at "/config/absdatabase.sqlite"
[2024-03-10 05:48:02.317] INFO: [Database] Query logging enabled
[2024-03-10 05:48:02.491] INFO: [Database] Db connection was successful

Expected to happen: (Docker logs)

2024-03-09 21:29:40.231] INFO: === Starting Server ===
[2024-03-09 21:29:40.248] INFO: [Server] Init v2.8.0
[2024-03-09 21:29:40.252] INFO: [Database] Initializing db at "/config/absdatabase.sqlite"
[2024-03-09 21:29:40.303] INFO: [Database] Db connection was successful
[2024-03-09 21:29:40.410] INFO: [Database] Db initialized with models: user, library, libraryFolder, book, podcast, podcastEpisode, libraryItem, mediaProgress, series, bookSeries, author, bookAuthor, collection, collectionBook, playlist, playlistMediaItem, device, playbackSession, feed, feedEpisode, setting, customMetadataProvider
[2024-03-09 21:29:40.432] INFO: [LogManager] Init current daily log filename: 2024-03-09.txt
[2024-03-09 21:29:40.443] INFO: [BackupManager] 0 Backups Found
[2024-03-09 21:29:40.443] INFO: [BackupManager] Auto Backups are disabled
[2024-03-09 21:29:40.452] INFO: [Watcher] Initializing watcher for "/audiobooks".
Warning: connect.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.
[2024-03-09 21:29:40.461] INFO: Listening on port :80
[2024-03-09 21:29:40.465] INFO: [Watcher] "/audiobooks" Ready

Notes

I verifed that the user permissions are correct inside the container's mount points.

Environment

Ubuntu 20.04 host
Docker 25 (Official PPA)

Steps to reproduce the issue

  1. Deploy ABS docker container as non-root user with docker-compose
 version: '3.7'
  services:
    audiobookself:
      environment:
        - "AUDIOBOOKSHELF_UID={{ABS_UID}}"
        - "AUDIOBOOKSHELF_GID={{ABS_GID}}"
        - "PORT={{ABS_BACKEND_PORT}}"
        - "TMPDIR=/tmp"
        - "QUERY_LOGGING=log"
      image: "ghcr.io/advplyr/audiobookshelf:{{ABS_VERSION}}"
      network_mode: host
      #ports:
        #- "{{ABS_BACKEND_PORT}}:{{ABS_BACKEND_PORT}}"
      user: "{{ABS_UID}}:{{ABS_GID}}"
      volumes:
        - "audiobookshelf-audiobooks:/audiobooks"
        - "audiobookshelf-config:/config"
        - "audiobookshelf-metadata:/metadata"
        - "audiobookshelf-podcasts:/podcasts"
        - "audiobookshelf-tmp:/tmp"
        - "audiobookshelf-run:/run"

  volumes:
    audiobookshelf-audiobooks:
      driver: local
      driver_opts:
        type: nfs
        o: "{{storage_mount_opts}}"
        device: ":{{docker_base_volume_dir}}/audiobookshelf/audiobooks"
    audiobookshelf-config:
      driver: local
      driver_opts:
        type: nfs
        o: "{{storage_mount_opts}}"
        device: ":{{docker_base_volume_dir}}/audiobookshelf/config"
    audiobookshelf-metadata:
      driver: local
      driver_opts:
        type: nfs
        o: "{{storage_mount_opts}}"
        device: ":{{docker_base_volume_dir}}/audiobookshelf/metadata"
    audiobookshelf-podcasts:
      driver: local
      driver_opts:
        type: nfs
        o: "{{storage_mount_opts}}"
        device: ":{{docker_base_volume_dir}}/audiobookshelf/podcasts"
    audiobookshelf-tmp:
      driver_opts:
        type: tmpfs
        device: tmpfs
    audiobookshelf-run:
      driver_opts:
        type: tmpfs
        device: tmpfs

ABS_UID: "1571800051"
ABS_GID: "1571800051"
ABS_VERSION: "2.8.0"
ABS_BACKEND_PORT: "13378"

Audiobookshelf version

v2.8.0

How are you running audiobookshelf?

Docker

Originally created by @hydrian on GitHub (Mar 11, 2024). ### Describe the issue What really happened: (Docker logs) ``` 2024-03-10 05:48:02.064] INFO: === Starting Server === [2024-03-10 05:48:02.081] INFO: [Server] Init v2.8.0 [2024-03-10 05:48:02.315] INFO: [Database] absdatabase.sqlite not found at /config/absdatabase.sqlite [2024-03-10 05:48:02.316] INFO: [Database] Initializing db at "/config/absdatabase.sqlite" [2024-03-10 05:48:02.317] INFO: [Database] Query logging enabled [2024-03-10 05:48:02.491] INFO: [Database] Db connection was successful ``` Expected to happen: (Docker logs) ``` 2024-03-09 21:29:40.231] INFO: === Starting Server === [2024-03-09 21:29:40.248] INFO: [Server] Init v2.8.0 [2024-03-09 21:29:40.252] INFO: [Database] Initializing db at "/config/absdatabase.sqlite" [2024-03-09 21:29:40.303] INFO: [Database] Db connection was successful [2024-03-09 21:29:40.410] INFO: [Database] Db initialized with models: user, library, libraryFolder, book, podcast, podcastEpisode, libraryItem, mediaProgress, series, bookSeries, author, bookAuthor, collection, collectionBook, playlist, playlistMediaItem, device, playbackSession, feed, feedEpisode, setting, customMetadataProvider [2024-03-09 21:29:40.432] INFO: [LogManager] Init current daily log filename: 2024-03-09.txt [2024-03-09 21:29:40.443] INFO: [BackupManager] 0 Backups Found [2024-03-09 21:29:40.443] INFO: [BackupManager] Auto Backups are disabled [2024-03-09 21:29:40.452] INFO: [Watcher] Initializing watcher for "/audiobooks". Warning: connect.session() MemoryStore is not designed for a production environment, as it will leak memory, and will not scale past a single process. [2024-03-09 21:29:40.461] INFO: Listening on port :80 [2024-03-09 21:29:40.465] INFO: [Watcher] "/audiobooks" Ready ``` ### Notes I verifed that the user permissions are correct inside the container's mount points. ### Environment Ubuntu 20.04 host Docker 25 (Official PPA) ### Steps to reproduce the issue 1. Deploy ABS docker container as non-root user with docker-compose ``` version: '3.7' services: audiobookself: environment: - "AUDIOBOOKSHELF_UID={{ABS_UID}}" - "AUDIOBOOKSHELF_GID={{ABS_GID}}" - "PORT={{ABS_BACKEND_PORT}}" - "TMPDIR=/tmp" - "QUERY_LOGGING=log" image: "ghcr.io/advplyr/audiobookshelf:{{ABS_VERSION}}" network_mode: host #ports: #- "{{ABS_BACKEND_PORT}}:{{ABS_BACKEND_PORT}}" user: "{{ABS_UID}}:{{ABS_GID}}" volumes: - "audiobookshelf-audiobooks:/audiobooks" - "audiobookshelf-config:/config" - "audiobookshelf-metadata:/metadata" - "audiobookshelf-podcasts:/podcasts" - "audiobookshelf-tmp:/tmp" - "audiobookshelf-run:/run" volumes: audiobookshelf-audiobooks: driver: local driver_opts: type: nfs o: "{{storage_mount_opts}}" device: ":{{docker_base_volume_dir}}/audiobookshelf/audiobooks" audiobookshelf-config: driver: local driver_opts: type: nfs o: "{{storage_mount_opts}}" device: ":{{docker_base_volume_dir}}/audiobookshelf/config" audiobookshelf-metadata: driver: local driver_opts: type: nfs o: "{{storage_mount_opts}}" device: ":{{docker_base_volume_dir}}/audiobookshelf/metadata" audiobookshelf-podcasts: driver: local driver_opts: type: nfs o: "{{storage_mount_opts}}" device: ":{{docker_base_volume_dir}}/audiobookshelf/podcasts" audiobookshelf-tmp: driver_opts: type: tmpfs device: tmpfs audiobookshelf-run: driver_opts: type: tmpfs device: tmpfs ``` ABS_UID: "1571800051" ABS_GID: "1571800051" ABS_VERSION: "2.8.0" ABS_BACKEND_PORT: "13378" ### Audiobookshelf version v2.8.0 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:58:45 +02:00
adam closed this issue 2026-04-24 23:58:45 +02:00
Author
Owner

@hydrian commented on GitHub (Mar 11, 2024):

I have a feeling that there is a filesystem permission issue with the sqlite DB for the work/temp files. When the container is run by root, the process can run just about anywhere. As a non-root user, this isn't the case.

@hydrian commented on GitHub (Mar 11, 2024): I have a feeling that there is a filesystem permission issue with the sqlite DB for the work/temp files. When the container is run by root, the process can run just about anywhere. As a non-root user, this isn't the case.
Author
Owner

@hydrian commented on GitHub (Mar 13, 2024):

The issue was because the backing /config volume was being mounted as NFS3. NFS3 does not have proper file locking that is needed by sqlite. Switching to NFS4 fixed the issue. Closing the issue.

@hydrian commented on GitHub (Mar 13, 2024): The issue was because the backing /config volume was being mounted as NFS3. NFS3 does not have proper file locking that is needed by sqlite. Switching to NFS4 fixed the issue. Closing the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1806