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

Docker-Compuse Up not working, potentiol problem with start of apache2 #134

Closed
PeSalomon opened this issue Dec 10, 2023 · 6 comments
Closed

Comments

@PeSalomon
Copy link

I'm struggling installing and starting webtrees with the given docker-compose.yml file. Installation is on a Raspberri Pi 4 with an fresh installed Raspberry OS revision bookworm.

Docker log contains the following messages:
[NV_INIT] Starting Apache
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.21.0.3. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.21.0.3. Set the 'ServerName' directive globally to suppress this message
[Sun Dec 10 21:11:11.931452 2023] [mpm_prefork:notice] [pid 37] AH00163: Apache/2.4.57 (Debian) PHP/8.1.25 OpenSSL/3.0.11 configured -- resuming normal operations
Sun Dec 10 21:11:11.931579 2023] [core:notice] [pid 37] AH00094: Command line: 'apache2 -D FOREGROUND'
webtrees:80 127.0.0.1 - - [10/Dec/2023:21:11:41 +0000] "GET / HTTP/1.1" 500 4549 "-" "curl/7.88.1"
webtrees:80 127.0.0.1 - - [10/Dec/2023:21:12:11 +0000] "GET / HTTP/1.1" 500 4549 "-" "curl/7.88.1"

My docker-compose.yml is:
version: "3"
services:
app:
depends_on:
- webtrees_db
environment:
PRETTY_URLS: "1"
HTTPS: "0"
HTTPS_REDIRECT: "0"
LANG: "de-DE"
BASE_URL: "http://192.168.168.97:80"
DB_TYPE: "mysql"
DB_HOST: "webtrees_db"
DB_PORT: "3306"
DB_USER: "webtrees"
DB_PASSWORD: "Palomino"
DB_DATABASE: "webtrees"
DB_PREFIX: "wt_"
WT_USER: "Peter"
WT_NAME: "Peter Salomon"
WT_PASS: "Palomino"
WT_EMAIL: "p.salomon@t-online.de"
PUID: "1000"
PGID: "1000"
image: ghcr.io/nathanvaughn/webtrees:latest
ports:
- 80:80
# - 443:443
restart: unless-stopped
volumes:
# - ~/cernathanvaughn/webtreests:/certs/
- app_data:/var/www/webtrees/data/

webtrees_db:
environment:
MARIADB_DATABASE: "webtrees"
MARIADB_USER: "webtrees"
MARIADB_ROOT_PASSWORD: "Palomino"
MARIADB_PASSWORD: "Palomino"
image: docker.io/library/mariadb:latest
ports:
- 3306:3306
volumes:
- db_data:/var/lib/mysql/

volumes:
db_data:
driver: local
app_data:
driver: local

Opening "http;//127.0.0.1/webtrees" in a browser returns:
RuntimeException: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for webttees_db failed: Name or service not known in /var/www/webtrees/app/Http/Middleware/UseDatabase.php:119
Stack trace:
#0 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseDatabase->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#1 /var/www/webtrees/app/Http/Middleware/BadBotBlocker.php(293): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#2 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BadBotBlocker->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#3 /var/www/webtrees/app/Http/Middleware/CompressResponse.php(71): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#4 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\CompressResponse->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#5 /var/www/webtrees/app/Http/Middleware/ContentLength.php(40): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#6 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ContentLength->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#7 /var/www/webtrees/vendor/middlewares/client-ip/src/ClientIp.php(65): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#8 /var/www/webtrees/app/Http/Middleware/ClientIp.php(47): Middlewares\ClientIp->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#9 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ClientIp->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#10 /var/www/webtrees/app/Http/Middleware/HandleExceptions.php(89): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#11 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\HandleExceptions->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#12 /var/www/webtrees/app/Http/Middleware/BaseUrl.php(73): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#13 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BaseUrl->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#14 /var/www/webtrees/app/Http/Middleware/ReadConfigIni.php(68): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#15 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ReadConfigIni->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#16 /var/www/webtrees/app/Http/Middleware/SecurityHeaders.php(48): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#17 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\SecurityHeaders->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#18 /var/www/webtrees/app/Http/Middleware/EmitResponse.php(57): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#19 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\EmitResponse->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#20 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#21 /var/www/webtrees/app/Webtrees.php(275): Middleland\Dispatcher->dispatch(Object(Nyholm\Psr7\ServerRequest))
#22 /var/www/webtrees/app/Webtrees.php(262): Fisharebest\Webtrees\Webtrees::dispatch(Object(Nyholm\Psr7\ServerRequest), Array)
#23 /var/www/webtrees/index.php(51): Fisharebest\Webtrees\Webtrees->httpRequest()
#24 {main}

I saw found some reported issues pointing in the same direction. A suggested workaround was: "run the setup wizard manually".
Can anybody explain to me how to translate "docker-compse up" into a manual setup wizard?
Any help is really appreciated.

Best regards
Peter

@NathanVaughn
Copy link
Owner

NathanVaughn commented Dec 13, 2023

I think you may have a typo in your environment variables.

getaddrinfo for webttees_db failed

You can confirm by looking/editing the contents of /var/www/webtrees/data/config.ini.php

@NathanVaughn
Copy link
Owner

In terms of manually running the setup wizard, remove all of the DB_ and WT_ environment variables and make sure the data directory is empty. When you do that and open a web browser, webtrees will walk you through a setup wizard.

@PeSalomon
Copy link
Author

Hi Nathan,
thank you for your reply. The typo in my environment variables must have been a left over from an earlier version of my docker-compose.yml file. I have made a fresh installation of Raspbian OS on my Pi4 and with this the start of the containers with the docker-compose.yml above worked without any errors.
Unfortunately I'm now getting an error when trying to create the data base: SQLSTATE[HY000] [2002] Connection refused (SQL: CREATE DATABASE IF NOT EXISTS Stelzig COLLATE utf8_unicode_ci)
I've seen that others got this error as well and will follow their solutions.
Thanks for your help.
Best regards
Peter

@NathanVaughn
Copy link
Owner

Sorry I didn't get back earlier. Yeah, there's a lot of things that could cause that. Permissions issues, access control issues, networking issues, database issues, etc. I think the best place to start is to just try attaching a terminal to the database and logging in on the command line. Then try from the webtrees container, etc.

@PeSalomon
Copy link
Author

PeSalomon commented Dec 22, 2023 via email

@NathanVaughn
Copy link
Owner

Interesting, I'm the most proficient at Linux file system permissions. On my own setup, I run everything with bind mounts, and really only test the docker compose file with volume mounts on my Windows desktop.

It also sounds like it was related to #131 then. I have updated the docker-compose file to reflect this, maybe you had an old version.

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

No branches or pull requests

2 participants