[BUG] variable DB_HOST not working (for connecting to remote database)
hugofant opened this issue · 5 comments
Is there an existing issue for this?
- I have searched the existing issues
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:latestContainer 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.Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.
This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.
-e DB_USER=mydbusr
-e DB_PASS=mydbpassword \
is wrong, correct is
-e DB_USERNAME=mydbusr
-e DB_PASSWORD=mydbpassword \
This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.
closing as burgsth informed the OP of their issue.