linuxserver / docker-bookstack

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

Environment variables for DB username, password are not correct #69

Closed jacroe closed 3 years ago

jacroe commented 3 years ago

linuxserver.io


Expected Behavior

The example docker-compose.yml should provide a working configuration that can successfully run BookStack.

Current Behavior

The bookstack container launches with database connection errors.

Steps to Reproduce

  1. Copy the example docker-compose.yml file to a directory of your choice.
  2. Replace the <yourdbpass> sample with some value.
  3. Run docker-compose up.
  4. Startup fails and ports aren't bound.

Environment

OS: Raspbian 10 buster CPU architecture: arm32 How docker service was installed: curl -fsSL https://get.docker.com -o get-docker.sh

Command used to create docker container (run/create/compose/screenshot)

docker-compose up

Docker logs

bookstack       |    Illuminate\Database\QueryException  : SQLSTATE[HY000] [1045] Access denied for user 'bookstack'@'bookstack.bookstack_default' (using password: YES) (SQL: select * from information_schema.tables where table_schema = bookstackapp and table_name = migrations and table_type = 'BASE TABLE')
bookstack       | 
bookstack       |   at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669
bookstack       |     665|         // If an exception occurs when attempting to run a query, we'll format the error
bookstack       |     666|         // message to include the bindings with SQL, which will make this exception a
bookstack       |     667|         // lot more helpful to the developer instead of just the database's errors.
bookstack       |     668|         catch (Exception $e) {
bookstack       |   > 669|             throw new QueryException(
bookstack       |     670|                 $query, $this->prepareBindings($bindings), $e
bookstack       |     671|             );
bookstack       |     672|         }
bookstack       |     673|
bookstack       | 
bookstack       |   Exception trace:
bookstack       | 
bookstack       |   1   Doctrine\DBAL\Driver\PDOException::("SQLSTATE[HY000] [1045] Access denied for user 'bookstack'@'bookstack.bookstack_default' (using password: YES)")
bookstack       |       /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:31
bookstack       | 
bookstack       |   2   PDOException::("SQLSTATE[HY000] [1045] Access denied for user 'bookstack'@'bookstack.bookstack_default' (using password: YES)")
bookstack       |       /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27
jacroe commented 3 years ago

I was able to run the container successfully by replacing the variables with DB_USERNAME and DB_PASSWORD.

github-actions[bot] commented 3 years ago

Thanks for opening your first issue here! Be sure to follow the issue template!

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jacroe commented 3 years ago

Still an issue.

aptalca commented 3 years ago

Variables are correct and it works just fine here for me and tons of other users. Since you never posted all the info requested in the template, we'll never know why it didn't work for you.

jacroe commented 3 years ago

Annoyingly, I can't seem to replicate it now; a clean install in a new directory brings everything up fine. I'm away from the Pi that I'm hosting my instance on and will try to replicate it there when I'm able. In the unlikely event I encounter it then, I'll come back to this. Still not sure why DB_USERNAME/DB_PASSWORD ended up working for me when I ran into this last month, but meh.

Also, it was not clear that the template was not filled out; I had placed information in all the sections. While the "Commands used" part was sparse, I didn't think I needed to place my full YAML file since my reproduction steps said that the only change from the provided example was replacing the sample password. Had I known that more information was requested, I would have happily supplied it. And then been scratching my head about why I couldn't replicate my "issue" quite a bit sooner.

Thanks and best wishes.