linuxserver / docker-bookstack

A Docker container for the BookStack documentation wiki
GNU General Public License v3.0
783 stars 108 forks source link

[BUG] variable DB_HOST not working (for connecting to remote database) #228

Open hugofant opened 1 day ago

hugofant commented 1 day ago

Is there an existing issue for this?

Current Behavior

container is running well but when connecting with HTTP results in an "500 Internal Server Error". Dockerlogs show, that container tries to connect to IP of APP_URL and not to DB_HOST

Expected Behavior

container should connect to IP of DB_HOST

Steps To Reproduce

installing with the docker command below. Applicationhost is running on a subdomain of the DB-Host and redirected to a different IP adress.

Environment

- OS: Raspberry 4
- How docker service was installed: with docker run (details below)

CPU architecture

arm64

Docker creation

docker run -d \
  --name=my_bookstack \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Europe/Vienna \
  -e APP_URL=bookstack.mydomain \
  -e DB_HOST=mydomain \
  -e DB_PORT=3306 \
  -e DB_USER=mydbusr \
  -e DB_PASS=mydbpassword \
  -e DB_DATABASE=mydb \
  -p 6875:80 \
  -v /mydatavolume/config:/config \
  --restart unless-stopped \
  linuxserver/bookstack:latest

Container logs

[migrations] started

[migrations] 01-nginx-site-confs-default: skipped

[migrations] 02-default-location: skipped

[migrations] done

───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗

      ██║     ██╔════╝██║██╔═══██╗

      ██║     ███████╗██║██║   ██║

      ██║     ╚════██║██║██║   ██║

      ███████╗███████║██║╚██████╔╝

      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io

───────────────────────────────────────

To support LSIO projects visit:

https://www.linuxserver.io/donate/

───────────────────────────────────────

GID/UID

───────────────────────────────────────

User UID:    1000

User GID:    1000

───────────────────────────────────────

Linuxserver.io version: v24.05.4-ls166

Build-date: 2024-09-30T18:33:36+00:00

───────────────────────────────────────

using keys found in /config/keys

App Key found - setting variable for seds

Running config - DB_HOST set

Waiting for DB to be available

   Illuminate\Database\QueryException 

  SQLSTATE[HY000] [1045] Access denied for user 'mydbusr'@'IP of APP_URL' (using password: YES) (Connection: mysql, SQL: select table_name as `name`, (data_length + index_length) as `size`, table_comment as `comment`, engine as `engine`, table_collation as `collation` from information_schema.tables where table_schema = 'mydb' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name)

  at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:829

    825▕                     $this->getName(), $query, $this->prepareBindings($bindings), $e

    826▕                 );

    827▕             }

    828▕ 

  ➜ 829▕             throw new QueryException(

    830▕                 $this->getName(), $query, $this->prepareBindings($bindings), $e

    831▕             );

    832▕         }

    833▕     }

      +36 vendor frames 

  37  /app/www/artisan:35

      Illuminate\Foundation\Console\Kernel::handle()

[custom-init] No custom files found, skipping...

[ls.io-init] done.
github-actions[bot] commented 1 day ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.