[Bug]: ERROR: [Server] attempt to init server when server already has a root user (Server.js:291) #1868

Closed
opened 2026-04-25 00:00:41 +02:00 by adam · 2 comments
Owner

Originally created by @clifmo on GitHub (Apr 7, 2024).

Describe the issue

I've successfully run audiobookshelf internally for a month now. I finally got around to adding it to my reverse proxy for external access. When setup, I can reach audiobookshelf, but it displays the Initial Server Setup: Create Root User screen. Expected behavior is to present the login form.

Container logs shows ERROR: [Server] attempt to init server when server already has a root user (Server.js:291). This behavior seems triggered by accessing over a new/different hostname. What can be done to have it work on local and public domains simultaneously?

 audiobookshelf:
  image: ghcr.io/advplyr/audiobookshelf
  ports:
   13378:80
  volumes:
    - /var/config:/config
    - /var/metadata:/metadata
    - /mnt/audiobooks:/audiobooks
    - /mnt/podcasts:/podcasts
location / {
    proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
    proxy_set_header  X-Forwarded-Proto $scheme;
    proxy_set_header  Host              $host;
    proxy_set_header Upgrade            $http_upgrade;
    proxy_set_header Connection         "upgrade";
    proxy_http_version                  1.1;
    proxy_redirect                      http:// https://;
    proxy_pass http://<interal-address>:13378;
  }

Steps to reproduce the issue

  1. Run docker container and access on a local domain name.
  2. Add reverse proxy configuration and access on public domain name.
  3. external-domain.com/login displays root account setup instead of login form.

Audiobookshelf version

v2.8.0

How are you running audiobookshelf?

Docker

Originally created by @clifmo on GitHub (Apr 7, 2024). ### Describe the issue I've successfully run audiobookshelf internally for a month now. I finally got around to adding it to my reverse proxy for external access. When setup, I can reach audiobookshelf, but it displays the Initial Server Setup: Create Root User screen. Expected behavior is to present the login form. Container logs shows ERROR: [Server] attempt to init server when server already has a root user (Server.js:291). This behavior seems triggered by accessing over a new/different hostname. What can be done to have it work on local and public domains simultaneously? ```yaml audiobookshelf: image: ghcr.io/advplyr/audiobookshelf ports: 13378:80 volumes: - /var/config:/config - /var/metadata:/metadata - /mnt/audiobooks:/audiobooks - /mnt/podcasts:/podcasts ``` ``` location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_http_version 1.1; proxy_redirect http:// https://; proxy_pass http://<interal-address>:13378; } ``` ### Steps to reproduce the issue 1. Run docker container and access on a local domain name. 2. Add reverse proxy configuration and access on public domain name. 3. external-domain.com/login displays root account setup instead of login form. ### Audiobookshelf version v2.8.0 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-25 00:00:41 +02:00
adam closed this issue 2026-04-25 00:00:42 +02:00
Author
Owner

@advplyr commented on GitHub (Apr 7, 2024):

I have no idea what could be going on. In your web browser navigate to audiobookshelf.your-domain.com/status and you will see a JSON response like..

{
  "app": "audiobookshelf",
  "serverVersion": "2.8.1",
  "isInit": true,
  "language": "en-us",
  "authMethods": [
    "local"
  ],
  "authFormData": {
  "authLoginCustomMessage": null
  }
}

The isInit flag will be true if the users table in the sqlite database has a root user. If you are hitting the same server then both your reverse proxy and local ip address will return the same JSON object.

@advplyr commented on GitHub (Apr 7, 2024): I have no idea what could be going on. In your web browser navigate to `audiobookshelf.your-domain.com/status` and you will see a JSON response like.. ```json { "app": "audiobookshelf", "serverVersion": "2.8.1", "isInit": true, "language": "en-us", "authMethods": [ "local" ], "authFormData": { "authLoginCustomMessage": null } } ``` The `isInit` flag will be true if the `users` table in the sqlite database has a root user. If you are hitting the same server then both your reverse proxy and local ip address will return the same JSON object.
Author
Owner

@clifmo commented on GitHub (Apr 8, 2024):

I had a nginx configuration block for /status that just returned 200 alive to the browser. Removing that resolved my issue. Absolutely no idea how it got there. Thanks for the support.

@clifmo commented on GitHub (Apr 8, 2024): I had a nginx configuration block for /status that just returned 200 alive to the browser. Removing that resolved my issue. Absolutely no idea how it got there. Thanks for the support.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1868