linuxserver / docker-bookstack

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

[BUG] docker compose db not working #157

Closed andreapx closed 1 year ago

andreapx commented 1 year ago

Is there an existing issue for this?

Current Behavior

The containers start, but the app doesn't connect to the db. Trying to debug the problem, I've noticed that the 2 containers don't talk with each other. I've tried with netcat and there is no communication between the 2.

Expected Behavior

The containers starts and everything works

Steps To Reproduce

Just run docker-compose up

Environment

- OS: Ubuntu 22.04
- How docker service was installed: directly in the Ubuntu installation

CPU architecture

x86-64

Docker creation

sudo docker-compose up

Container logs

Starting bookstack_db ... done
Starting bookstack    ... done
Attaching to bookstack_db, bookstack
bookstack_db    | [migrations] started
bookstack_db    | [migrations] no migrations found
bookstack_db    | usermod: no changes
bookstack_db    |
bookstack_db    | -------------------------------------
bookstack_db    |           _         ()
bookstack_db    |          | |  ___   _    __
bookstack_db    |          | | / __| | |  /  \
bookstack_db    |          | | \__ \ | | | () |
bookstack_db    |          |_| |___/ |_|  \__/
bookstack_db    |
bookstack_db    |
bookstack_db    | Brought to you by linuxserver.io
bookstack_db    | -------------------------------------
bookstack_db    |
bookstack_db    | To support LSIO projects visit:
bookstack_db    | https://www.linuxserver.io/donate/
bookstack_db    | -------------------------------------
bookstack_db    | GID/UID
bookstack_db    | -------------------------------------
bookstack_db    |
bookstack_db    | User uid:    1000
bookstack_db    | User gid:    1000
bookstack_db    | -------------------------------------
bookstack_db    |
bookstack_db    | [custom-init] No custom files found, skipping...
bookstack_db    | 230119 11:38:09 mysqld_safe Logging to '/config/databases/ae082b0e2a90.err'.
bookstack_db    | 230119 11:38:09 mysqld_safe Starting mariadbd daemon with databases from /config/databases
bookstack       | [custom-init] No custom services found, skipping...
bookstack       | s6-rc: info: service s6rc-oneshot-runner: starting
bookstack       | s6-rc: info: service s6rc-oneshot-runner successfully started
bookstack       | s6-rc: info: service fix-attrs: starting
bookstack       | s6-rc: info: service 00-legacy: starting
bookstack       | s6-rc: info: service 00-legacy successfully started
bookstack       | s6-rc: info: service fix-attrs successfully started
bookstack       | s6-rc: info: service legacy-cont-init: starting
bookstack       | cont-init: info: running /etc/cont-init.d/01-envfile
bookstack       | cont-init: info: /etc/cont-init.d/01-envfile exited 0
bookstack       | cont-init: info: running /etc/cont-init.d/01-migrations
bookstack       | [migrations] started
bookstack       | [migrations] 01-nginx-site-confs-default: skipped
bookstack       | [migrations] 02-default-location: skipped
bookstack       | [migrations] done
bookstack       | cont-init: info: /etc/cont-init.d/01-migrations exited 0
bookstack       | cont-init: info: running /etc/cont-init.d/10-adduser
bookstack       | usermod: no changes
bookstack       |
bookstack       | -------------------------------------
bookstack       |           _         ()
bookstack       |          | |  ___   _    __
bookstack       |          | | / __| | |  /  \
bookstack       |          | | \__ \ | | | () |
bookstack       |          |_| |___/ |_|  \__/
bookstack       |
bookstack       |
bookstack       | Brought to you by linuxserver.io
bookstack       | -------------------------------------
bookstack       |
bookstack       | To support LSIO projects visit:
bookstack       | https://www.linuxserver.io/donate/
bookstack       | -------------------------------------
bookstack       | GID/UID
bookstack       | -------------------------------------
bookstack       |
bookstack       | User uid:    1000
bookstack       | User gid:    1000
bookstack       | -------------------------------------
bookstack       |
bookstack       | cont-init: info: /etc/cont-init.d/10-adduser exited 0
bookstack       | cont-init: info: running /etc/cont-init.d/11-folders
bookstack       | cont-init: info: /etc/cont-init.d/11-folders exited 0
bookstack       | cont-init: info: running /etc/cont-init.d/12-samples
bookstack       | cont-init: info: /etc/cont-init.d/12-samples exited 0
bookstack       | cont-init: info: running /etc/cont-init.d/13-nginx
bookstack       | cont-init: info: /etc/cont-init.d/13-nginx exited 0
bookstack       | cont-init: info: running /etc/cont-init.d/14-php
bookstack       | cont-init: info: /etc/cont-init.d/14-php exited 0
bookstack       | cont-init: info: running /etc/cont-init.d/15-keygen
bookstack       | using keys found in /config/keys
bookstack       | cont-init: info: /etc/cont-init.d/15-keygen exited 0
bookstack       | cont-init: info: running /etc/cont-init.d/20-permissions
bookstack       | cont-init: info: /etc/cont-init.d/20-permissions exited 0
bookstack       | cont-init: info: running /etc/cont-init.d/50-config
bookstack       | App Key found - setting variable for seds
bookstack       | Running config - DB_HOST set
bookstack_db    | [ls.io-init] done.
bookstack       | **** Docker env var APP_URL is not set, setting it to http://:6875 ****
bookstack       | **** APP_URL in /config/www/.env is being updated from https://example.com to http://:6875 ****
bookstack       | **** If this is an existing install, you should run the following line from your host terminal to update the database URL       entries: ****
bookstack       | ************************************************************************
bookstack       | docker exec -it bookstack php /app/www/artisan bookstack:update-url https://example.com http://:6875
bookstack       | ************************************************************************
bookstack       | Waiting for DB to be available
bookstack       |
bookstack       |    Illuminate\Database\QueryException
bookstack       |
bookstack       |   SQLSTATE[HY000] [2002] Operation timed out (SQL: select * from information_schema.tables where table_schema = bookstack      app and table_name = migrations and table_type = 'BASE TABLE')
bookstack       |
bookstack       |   at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
bookstack       |     708▕         // If an exception occurs when attempting to run a query, we'll format the error
bookstack       |     709▕         // message to include the bindings with SQL, which will make this exception a
bookstack       |     710▕         // lot more helpful to the developer instead of just the database's errors.
bookstack       |     711▕         catch (Exception $e) {
bookstack       |   ➜ 712▕             throw new QueryException(
bookstack       |     713▕                 $query, $this->prepareBindings($bindings), $e
bookstack       |     714▕             );
bookstack       |     715▕         }
bookstack       |     716▕     }
bookstack       |
bookstack       |       +33 vendor frames
bookstack       |   34  /app/www/artisan:37
bookstack       |       Illuminate\Foundation\Console\Kernel::handle()
bookstack       | cont-init: info: /etc/cont-init.d/50-config exited 0
bookstack       | cont-init: info: running /etc/cont-init.d/85-version-checks
bookstack       | cont-init: info: /etc/cont-init.d/85-version-checks exited 0
bookstack       | cont-init: info: running /etc/cont-init.d/99-custom-files
bookstack       | [custom-init] No custom files found, skipping...
bookstack       | cont-init: info: /etc/cont-init.d/99-custom-files exited 0
bookstack       | s6-rc: info: service legacy-cont-init successfully started
bookstack       | s6-rc: info: service init-mods: starting
bookstack       | s6-rc: info: service init-mods successfully started
bookstack       | s6-rc: info: service init-mods-package-install: starting
bookstack       | s6-rc: info: service init-mods-package-install successfully started
bookstack       | s6-rc: info: service init-mods-end: starting
bookstack       | s6-rc: info: service init-mods-end successfully started
bookstack       | s6-rc: info: service init-services: starting
bookstack       | s6-rc: info: service init-services successfully started
bookstack       | s6-rc: info: service legacy-services: starting
bookstack       | services-up: info: copying legacy longrun cron (no readiness notification)
bookstack       | services-up: info: copying legacy longrun memcached (no readiness notification)
bookstack       | services-up: info: copying legacy longrun nginx (no readiness notification)
bookstack       | services-up: info: copying legacy longrun php-fpm (no readiness notification)
bookstack       | s6-rc: info: service legacy-services successfully started
bookstack       | s6-rc: info: service 99-ci-service-check: starting
bookstack       | [ls.io-init] done.
bookstack       | s6-rc: info: service 99-ci-service-check successfully started
github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

j0nnymoe commented 1 year ago

You need to provide your compose, not just telling us you ran a compose command..

andreapx commented 1 year ago

I'm using the original, I've changed only the volumes:


version: "2" services: bookstack: image: lscr.io/linuxserver/bookstack container_name: bookstack environment:

j0nnymoe commented 1 year ago

We recommend not using the docker option when installing an OS but to install directly from their repo's or using the get.docker.com helper script.

andreapx commented 1 year ago

We recommend not using the docker option when installing an OS but to install directly from their repo's or using the get.docker.com helper script.

I've reinstalled Ubuntu and installed Docker from their repository and the problem got solved. Thanks!!!

duberlyguarnizofuentesrivera commented 1 year ago

I've found that removing the variables: