[Bug]: AUDIOBOOKSHELF_UID & AUDIOBOOKSHELF_GID values not being honored #351

Closed
opened 2026-04-24 23:05:41 +02:00 by adam · 5 comments
Owner

Originally created by @wshyang on GitHub (May 11, 2022).

Describe the issue

I started a container following the sample docker command provided on the main page

docker run -d \ -e AUDIOBOOKSHELF_UID=65500 \ -e AUDIOBOOKSHELF_GID=65500 \ -p 13378:80 \ -v $PWD/audiobooks:/audiobooks \ -v $PWD/config:/config \ -v $PWD/metadata:/metadata \ --name audiobookshelf \ --rm ghcr.io/advplyr/audiobookshelf

However subsequently when checking the contents of the files created in the volumes, I found that they are all created under root:root. It appears that within the container itself, the process is running as root too.

Steps to reproduce the issue

  1. docker run -d \ -e AUDIOBOOKSHELF_UID=65500 \ -e AUDIOBOOKSHELF_GID=65500 \ -p 13378:80 \ -v $PWD/audiobooks:/audiobooks \ -v $PWD/config:/config \ -v $PWD/metadata:/metadata \ --name audiobookshelf \ --rm ghcr.io/advplyr/audiobookshelf
  2. Check permissions of created files

Audiobookshelf version

2.0.12

How are you running audiobookshelf?

Docker

Originally created by @wshyang on GitHub (May 11, 2022). ### Describe the issue I started a container following the sample docker command provided on the main page `docker run -d \ -e AUDIOBOOKSHELF_UID=65500 \ -e AUDIOBOOKSHELF_GID=65500 \ -p 13378:80 \ -v $PWD/audiobooks:/audiobooks \ -v $PWD/config:/config \ -v $PWD/metadata:/metadata \ --name audiobookshelf \ --rm ghcr.io/advplyr/audiobookshelf` However subsequently when checking the contents of the files created in the volumes, I found that they are all created under root:root. It appears that within the container itself, the process is running as root too. ### Steps to reproduce the issue 1. `docker run -d \ -e AUDIOBOOKSHELF_UID=65500 \ -e AUDIOBOOKSHELF_GID=65500 \ -p 13378:80 \ -v $PWD/audiobooks:/audiobooks \ -v $PWD/config:/config \ -v $PWD/metadata:/metadata \ --name audiobookshelf \ --rm ghcr.io/advplyr/audiobookshelf` 2. Check permissions of created files ### Audiobookshelf version 2.0.12 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:05:41 +02:00
adam closed this issue 2026-04-24 23:05:41 +02:00
Author
Owner

@TheOneValen commented on GitHub (May 24, 2022):

I can confirm this bug exists in 2.0.15

@TheOneValen commented on GitHub (May 24, 2022): I can confirm this bug exists in 2.0.15
Author
Owner

@advplyr commented on GitHub (Jun 19, 2022):

A lot of updates were made to setting ownership of files/folders created by abs. If this is still an issue we can re-open this but please provide specific folders/files that are not set correctly.

@advplyr commented on GitHub (Jun 19, 2022): A lot of updates were made to setting ownership of files/folders created by abs. If this is still an issue we can re-open this but please provide specific folders/files that are not set correctly.
Author
Owner

@raviolispy commented on GitHub (Dec 5, 2022):

@advplyr I'm still having this issue - two example files are /config/playlists/njodb.properties and the logs in /metadata/logs/daily. Both are created with root UID/GID. This cropped up for me when I tried to use an sshfs volume.

xxx@xxx /tmp
base ❯ docker run -d -e AUDIOBOOKSHELF_UID=1002 -e AUDIOBOOKSHELF_GID=1003 -v $PWD/metadata:/metadata -v $PWD/config:/config --rm ghcr.io/advplyr/audiobookshelf
25248d96d01fdce921e7fbf2377a79a7f31d9bd36249f957c6970fab1e1cacee

xxx@xxx /tmp
base ❯ ls -al config/playlists
total 20
drwxr-xr-x  4 root root 4096 Dec  5 01:14 .
drwxr-xr-x 12 root root 4096 Dec  5 01:14 ..
drwxr-xr-x  2 root root 4096 Dec  5 01:14 data
-rw-r--r--  1 root root  351 Dec  5 01:14 njodb.properties
drwxr-xr-x  2 root root 4096 Dec  5 01:14 tmp

xxx@xxx /tmp
base ❯ ls -al metadata/logs/daily
total 12
drwxr-xr-x 2 root root 4096 Dec  5 01:14 .
drwxr-xr-x 3 root root 4096 Dec  5 01:14 ..
-rw-r--r-- 1 root root 1377 Dec  5 01:14 2022-12-05.txt
@raviolispy commented on GitHub (Dec 5, 2022): @advplyr I'm still having this issue - two example files are /config/playlists/njodb.properties and the logs in /metadata/logs/daily. Both are created with root UID/GID. This cropped up for me when I tried to use an sshfs volume. ``` xxx@xxx /tmp base ❯ docker run -d -e AUDIOBOOKSHELF_UID=1002 -e AUDIOBOOKSHELF_GID=1003 -v $PWD/metadata:/metadata -v $PWD/config:/config --rm ghcr.io/advplyr/audiobookshelf 25248d96d01fdce921e7fbf2377a79a7f31d9bd36249f957c6970fab1e1cacee xxx@xxx /tmp base ❯ ls -al config/playlists total 20 drwxr-xr-x 4 root root 4096 Dec 5 01:14 . drwxr-xr-x 12 root root 4096 Dec 5 01:14 .. drwxr-xr-x 2 root root 4096 Dec 5 01:14 data -rw-r--r-- 1 root root 351 Dec 5 01:14 njodb.properties drwxr-xr-x 2 root root 4096 Dec 5 01:14 tmp xxx@xxx /tmp base ❯ ls -al metadata/logs/daily total 12 drwxr-xr-x 2 root root 4096 Dec 5 01:14 . drwxr-xr-x 3 root root 4096 Dec 5 01:14 .. -rw-r--r-- 1 root root 1377 Dec 5 01:14 2022-12-05.txt ```
Author
Owner

@advplyr commented on GitHub (Dec 6, 2022):

@raviolispy Thanks. I can confirm the database files being created in /config and the logs in /metadata/logs are not getting the ownership set correctly.

@advplyr commented on GitHub (Dec 6, 2022): @raviolispy Thanks. I can confirm the database files being created in /config and the logs in /metadata/logs are not getting the ownership set correctly.
Author
Owner

@advplyr commented on GitHub (Dec 18, 2022):

Fixed in v2.2.9

@advplyr commented on GitHub (Dec 18, 2022): Fixed in [v2.2.9](https://github.com/advplyr/audiobookshelf/releases/tag/v2.2.9)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#351