Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
hugofant opened this issue Oct 7, 2024 · 3 comments
Open
1 task done

Comments

@hugofant
Copy link

hugofant commented Oct 7, 2024

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: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.
Copy link

github-actions bot commented Oct 7, 2024

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

@hugofant hugofant changed the title [BUG] <title>variable DB_HOST not working (for connecting to remote database) [BUG] variable DB_HOST not working (for connecting to remote database) Oct 7, 2024
@LinuxServer-CI
Copy link
Collaborator

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.

@burgsth
Copy link

burgsth commented Nov 8, 2024

-e DB_USER=mydbusr
-e DB_PASS=mydbpassword \

is wrong, correct is

-e DB_USERNAME=mydbusr
-e DB_PASSWORD=mydbpassword \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Issues
Development

No branches or pull requests

3 participants