Closed reibuehl closed 2 years ago
The date/time of nginx container is indeed weird, but I saw similar weird dates before in working setups.
I'm more concerned about one of the last lines:
chmod: changing permissions of '/var/run/postgresql': Operation not permitted
Does it work, when you remove your manually added user: '1000:1000'
in the docker-compose file?
Nginx should still allow a connection though... is that port maybe not opened in your firewall?
Try wget -nv -t1 --spider <URL_TO_YOUR_SITE>
on the hosting machine. Use the domain you use to access the site from outside (like http(s)://recipes.domain.tld
) and then try it with the local version (probably just http://localhost/
in your case since nginx is the default port 80).
This should narrow down the issue somewhat. Please report back with the result of these two tests.
The two wget commands produce the following result:
failed: Connection refused.
root@bananapi:~# wget -nv -t1 --spider http://localhost
Read error (Connection reset by peer) in headers.
root@bananapi:~#
I then removed the user line from the docker-compose file and restarted. The wget commands return the same afterwards. The db log now shows
db_recipes_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_recipes_1 |
db_recipes_1 | 2022-02-14 10:25:57.505 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
db_recipes_1 | 2022-02-14 10:25:57.506 UTC [1] LOG: listening on IPv6 address "::", port 5432
db_recipes_1 | 2022-02-14 10:25:57.521 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_recipes_1 | 2022-02-14 10:25:57.773 UTC [25] LOG: database system was shut down at 2022-02-14 10:24:54 UTC
db_recipes_1 | 2022-02-14 10:25:57.891 UTC [1] LOG: database system is ready to accept connections
but the directory has changed owner to systemd-coredump (UID 999) which seems random and is not what I wanted the DB files to be.
The other logs look still uneventful except for the strange date in nginx:
web_recipes_1 | Operations to perform:
web_recipes_1 | Apply all migrations: account, admin, auth, authtoken, contenttypes, cookbook, sessions, sites, socialaccount
web_recipes_1 | Running migrations:
web_recipes_1 | No migrations to apply.
web_recipes_1 | js-reverse file written to /opt/recipes/cookbook/static/django_js_reverse
web_recipes_1 |
web_recipes_1 | 1 static file copied to '/opt/recipes/staticfiles', 1024 unmodified, 1936 post-processed.
web_recipes_1 | Done
web_recipes_1 | [2022-02-14 10:28:08 +0000] [1] [INFO] Starting gunicorn 20.1.0
web_recipes_1 | [2022-02-14 10:28:08 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
web_recipes_1 | [2022-02-14 10:28:08 +0000] [1] [INFO] Using worker: sync
web_recipes_1 | [2022-02-14 10:28:08 +0000] [11] [INFO] Booting worker with pid: 11
nginx_recipes_1 | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
nginx_recipes_1 | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
nginx_recipes_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
nginx_recipes_1 | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist
nginx_recipes_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
nginx_recipes_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
nginx_recipes_1 | /docker-entrypoint.sh: Configuration complete; ready for start up
nginx_recipes_1 | 2071/04/20 11:13:28 [notice] 1#1: using the "epoll" event method
nginx_recipes_1 | 2071/04/20 11:13:28 [notice] 1#1: nginx/1.21.6
nginx_recipes_1 | 2071/04/20 11:13:28 [notice] 1#1: built by gcc 10.3.1 20211027 (Alpine 10.3.1_git20211027)
nginx_recipes_1 | 2071/04/20 11:13:28 [notice] 1#1: OS: Linux 5.10.60-sunxi
nginx_recipes_1 | 2071/04/20 11:13:28 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
nginx_recipes_1 | 2071/04/20 11:13:28 [notice] 1#1: start worker processes
nginx_recipes_1 | 2071/04/20 11:13:28 [notice] 1#1: start worker process 21
nginx_recipes_1 | 2071/04/20 11:13:28 [notice] 1#1: start worker process 22
Thank you for testing that.
Since nginx doesn't complain at all and port 80 is configured in the compose yml it's odd that no errors are shown... are there any additional infos in the logs when you set DEBUG=1
in the .env file? Probably need to restart the containers after changing that.
Also, can you please check if the nginx config file in the named volume "recipes_nginx_config" (it's probably at /var/lib/docker/volumes/recipes_nginx_config/_data
) is identical to the one in the repository here on GitHub (nginx/conf.d/Recipes.conf)? Maybe something is odd there.
The nginx config file did not exist in the named volume! I guess I must have forgotten to move it there when I changed to named volumes to keep everything in the same location. After copying the missing file to the expected location, everything is fine now and I can connect! Thanks very much! I switched back the DB to the UID 1000 - the error about the /var/run/postgresql is back but that does not seem to matter.
Great! I might add a check for existence of that file to the web container, so it is obvious from the log for the future :)
Issue
I have installed TandoorRecipes with docker-compose. All three containers are up and running but when I try to access it via http:///, I only get a connection refused from the browser.
The onlything strange I could find in the logs is that the nginx container seems to have a weird timestamp. (see logs below)
Tandoor Version
Can't login, but docker image is vabene1111/recipes:latest from 5 days ago
OS Version
Debian 10.11
Setup
Docker / Docker-Compose
Reverse Proxy
No reverse proxy
Other
No response
Environment file
Docker-Compose file
Relevant logs