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] Database Access Denied when binding to local volumes #161

Closed
1 task done
Zenthae opened this issue Feb 23, 2023 · 5 comments
Closed
1 task done

[BUG] Database Access Denied when binding to local volumes #161

Zenthae opened this issue Feb 23, 2023 · 5 comments
Assignees

Comments

@Zenthae
Copy link

Zenthae commented Feb 23, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The app is stuck on a blank pages and an error is thrown in nginx logs :

#5 /app/www/vendor/laravel/framework/src/Illumina...PHP message: PHP Fatal error:  Uncaught PDOException: SQLSTATE[HY000] [1045] Access denied for user 'forge'@'bookstack-application-1.bookstack' (using password: NO) in /app/www/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70
Stack trace:
#0 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(70): PDO->__construct()
#1 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(46): Illuminate\Database\Connectors\Connector->createPdoConnection()
#2 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection()
#3 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(184): Illuminate\Database\Connectors\MySqlConnector->connect()
#4 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}()
#5 /

Expected Behavior

The app should open and not throw a database connection error

Steps To Reproduce

  1. Run the docker compose example but remove the volumes bindings (everything works fine)
  2. Run the docker compose example with volume bindings (error when accessing database)

what i don't understand is that migrations are applied, it just stop to work when you try to access the web interface

Environment

- OS: Linux
- How docker service was installed: distro's packagemanager

CPU architecture

x86-64

Docker creation

version: "3"

services:
  application:
    image: linuxserver/bookstack:latest
    env_file:
      - bookstack.env
    expose:
      - 80
    volumes:
      - $DOCKER_HOME/bookstack/application:/config
    networks:
      - bookstack
      - traefik
    depends_on:
      - database
    labels:
      # Enable auto update
      com.centurylinklabs.watchtower.enable: true

      # Proxy config
      traefik.enable: true

  database:
    image: linuxserver/mariadb:latest
    env_file:
      - bookstack.env
    volumes:
      - $DOCKER_HOME/bookstack/database:/config
    networks:
      - bookstack

networks:
  traefik:
    name: traefik
    external: true
  bookstack:
    name: bookstack

Container logs

2023-02-23T20:03:15.680706391Z [migrations] started
2023-02-23T20:03:15.686521325Z [migrations] 01-nginx-site-confs-default: skipped
2023-02-23T20:03:15.688619148Z [migrations] 02-default-location: skipped
2023-02-23T20:03:15.688746634Z [migrations] done
2023-02-23T20:03:15.931500911Z 
2023-02-23T20:03:15.931669823Z -------------------------------------
2023-02-23T20:03:15.931701441Z           _         ()
2023-02-23T20:03:15.931731497Z          | |  ___   _    __
2023-02-23T20:03:15.931761660Z          | | / __| | |  /  \
2023-02-23T20:03:15.931786938Z          | | \__ \ | | | () |
2023-02-23T20:03:15.931826175Z          |_| |___/ |_|  \__/
2023-02-23T20:03:15.931852219Z 
2023-02-23T20:03:15.931875890Z 
2023-02-23T20:03:15.931899163Z Brought to you by linuxserver.io
2023-02-23T20:03:15.931937415Z -------------------------------------
2023-02-23T20:03:15.931961685Z 
2023-02-23T20:03:15.931984820Z To support LSIO projects visit:
2023-02-23T20:03:15.932016793Z https://www.linuxserver.io/donate/
2023-02-23T20:03:15.932046248Z -------------------------------------
2023-02-23T20:03:15.932070313Z GID/UID
2023-02-23T20:03:15.932097211Z -------------------------------------
2023-02-23T20:03:15.933807588Z 
2023-02-23T20:03:15.933860795Z User uid:    1027
2023-02-23T20:03:15.933894884Z User gid:    100
2023-02-23T20:03:15.933923127Z -------------------------------------
2023-02-23T20:03:15.933951722Z 
2023-02-23T20:03:15.983718630Z using keys found in /config/keys
2023-02-23T20:03:16.025427320Z App Key found - setting variable for seds
2023-02-23T20:03:16.027225886Z Running config - DB_HOST set
2023-02-23T20:03:16.036508528Z Waiting for DB to be available
2023-02-23T20:03:21.664309692Z Nothing to migrate.
2023-02-23T20:03:21.705196288Z [custom-init] No custom files found, skipping...
2023-02-23T20:03:21.721656296Z [ls.io-init] done.
@github-actions
Copy link

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

@Zenthae
Copy link
Author

Zenthae commented Feb 23, 2023

to fix it i had to replace DB_USER by DB_USERNAME and DB_PASS by DB_PASSWORD and my password is alphanumeric, nothing to escape

@homerr homerr self-assigned this Mar 11, 2023
@homerr homerr added the bug Something isn't working label Mar 11, 2023
@homerr
Copy link
Member

homerr commented Mar 11, 2023

Need to correct the docker cli arguments in readme to avoid confusion in deployment

@github-actions
Copy link

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.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 11, 2023
@github-actions
Copy link

This issue is locked due to inactivity

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants