TandoorRecipes / recipes

Application for managing recipes, planning meals, building shopping lists and much much more!
https://docs.tandoor.dev
Other
5.34k stars 563 forks source link

502 bad gateway #803

Closed koch17 closed 3 years ago

koch17 commented 3 years ago

Hello,

I am getting 502 bad gateway since the last update

Setup Info

version is (now) 0.16.8 I use docker to host the app.

Other relevant information regarding your problem (proxies, firewalls, etc.)

.env

Please include your .env config file (make sure to remove/replace all secrets)

DEBUG=0
ALLOWED_HOSTS=*

SECRET_KEY=***
DB_ENGINE=django.db.backends.postgresql_psycopg2
POSTGRES_HOST=db_recipes
POSTGRES_PORT=5432
POSTGRES_USER=djangodb
POSTGRES_PASSWORD=***
POSTGRES_DB=djangodb
GUNICORN_MEDIA=0
REVERSE_PROXY_AUTH=0
COMMENT_PREF_DEFAULT=1

docker-compose.yml

When running with docker compose please provide your docker-compose.yml

version: "3"
services:
  db_recipes:
    restart: always
    image: postgres:11-alpine
    volumes:
      - ./postgresql:/var/lib/postgresql/data
    env_file:
      - ./.env

  web_recipes:
    image: vabene1111/recipes
    restart: always
    env_file:
      - ./.env
    volumes:
      - ./staticfiles:/opt/recipes/staticfiles
      - ./mediafiles:/opt/recipes/mediafiles
    depends_on:
      - db_recipes

  nginx_recipes:
    image: nginx:mainline-alpine
    restart: always
    ports:
      - 8085:80
    env_file:
      - ./.env
    volumes:
      - ./nginx/conf.d:/etc/nginx/conf.d
      - ./staticfiles:/static
      - ./mediafiles:/media

Logs

It doesn't record any logs when I try to access it.

vabene1111 commented 3 years ago

the configuration you provided does not indicate any issues. Can you post the full docker-compose logs output so that i can see what happens at startup and maybe also show what docker-compose ps gives you ?

sorry for the late response

koch17 commented 3 years ago

Hi vabene,

No problem at all. This is what I am getting:

docker-compose ps Name Command State Ports

recipes_db_recipes_1 docker-entrypoint.sh postgres Up 5432/tcp recipes_nginx_recipes_1 /docker-entrypoint.sh ngin ... Up 0.0.0.0:8085->80/tcp recipes_web_recipes_1 /opt/recipes/boot.sh Up 8080/tcp

docker-compose logs Attaching to recipes_web_recipes_1, recipes_db_recipes_1, recipes_nginx_recipes_1 db_recipes_1 | db_recipes_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization db_recipes_1 | db_recipes_1 | 2021-08-13 16:23:43.439 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 db_recipes_1 | 2021-08-13 16:23:43.439 UTC [1] LOG: listening on IPv6 address "::", port 5432 db_recipes_1 | 2021-08-13 16:23:43.789 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" db_recipes_1 | 2021-08-13 16:23:44.605 UTC [21] LOG: database system was interrupted; last known up at 2021-08-13 16:22:32 UTC db_recipes_1 | 2021-08-13 16:23:44.909 UTC [21] LOG: database system was not properly shut down; automatic recovery in progress db_recipes_1 | 2021-08-13 16:23:45.126 UTC [21] LOG: invalid record length at 0/1D9E230: wanted 24, got 0 db_recipes_1 | 2021-08-13 16:23:45.126 UTC [21] LOG: redo is not required db_recipes_1 | 2021-08-13 16:23:46.491 UTC [1] LOG: database system is ready to accept connections 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 | 2021/08/07 17:39:56 [notice] 1#1: using the "epoll" event method nginx_recipes_1 | 2021/08/07 17:39:56 [notice] 1#1: nginx/1.21.1 nginx_recipes_1 | 2021/08/07 17:39:56 [notice] 1#1: built by gcc 10.3.1 20210424 (Alpine 10.3.1_git20210424) nginx_recipes_1 | 2021/08/07 17:39:56 [notice] 1#1: OS: Linux 4.4.59+ nginx_recipes_1 | 2021/08/07 17:39:56 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 524288:1048576 nginx_recipes_1 | 2021/08/07 17:39:56 [notice] 1#1: start worker processes nginx_recipes_1 | 2021/08/07 17:39:56 [notice] 1#1: start worker process 23 nginx_recipes_1 | 2021/08/07 17:39:56 [notice] 1#1: start worker process 24 nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:32:19 +0000] "GET / HTTP/1.1" 302 0 "-" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:32:19 +0000] "GET /search/ HTTP/1.1" 302 0 "-" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:32:21 +0000] "GET /accounts/login/?next=/search/ HTTP/1.1" 200 9517 "-" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:32:21 +0000] "GET /static/themes/tandoor.min.f815ca63cc20.css HTTP/1.1" 200 27639 "http://10.0.4.53:8085/accounts/login/?next=/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:32:21 +0000] "GET /static/css/app.min.a8212bb0f81c.css HTTP/1.1" 200 205 "http://10.0.4.53:8085/accounts/login/?next=/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:32:21 +0000] "GET /static/css/select2.min.9f54e6414f87.css HTTP/1.1" 200 1978 "http://10.0.4.53:8085/accounts/login/?next=/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:32:21 +0000] "GET /static/fontawesome/fontawesome_all.min.2acd020d0b21.css HTTP/1.1" 200 12346 "http://10.0.4.53:8085/accounts/login/?next=/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:32:21 +0000] "GET /static/css/select2-bootstrap.dcec0cc93fba.css HTTP/1.1" 200 3676 "http://10.0.4.53:8085/accounts/login/?next=/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:32:21 +0000] "GET /static/themes/select2-bootstrap-theme.d007f71f4d38.css HTTP/1.1" 200 3679 "http://10.0.4.53:8085/accounts/login/?next=/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:32:21 +0000] "GET /static/js/jquery-3.5.1.min.dc5e7f18c8d3.js HTTP/1.1" 200 30879 "http://10.0.4.53:8085/accounts/login/?next=/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:32:22 +0000] "GET /static/js/popper.min.84415b7368fd.js HTTP/1.1" 200 7503 "http://10.0.4.53:8085/accounts/login/?next=/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:32:22 +0000] "GET /static/js/bootstrap.min.61f338f870fc.js HTTP/1.1" 200 15853 "http://10.0.4.53:8085/accounts/login/?next=/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:32:22 +0000] "GET /static/js/select2.min.0f64f3a3a0c6.js HTTP/1.1" 200 19867 "http://10.0.4.53:8085/accounts/login/?next=/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:32:22 +0000] "GET /static/assets/brand_logo.6ebe02bf6707.png HTTP/1.1" 200 35616 "http://10.0.4.53:8085/accounts/login/?next=/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:32:22 +0000] "GET /static/webfonts/poppins_latin_500.84780596e268.woff2 HTTP/1.1" 200 7776 "http://10.0.4.53:8085/static/themes/tandoor.min.f815ca63cc20.css" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:32:22 +0000] "GET /static/webfonts/poppins_latin_400.9ed361bba848.woff2 HTTP/1.1" 200 7900 "http://10.0.4.53:8085/static/themes/tandoor.min.f815ca63cc20.css" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:32:22 +0000] "GET /static/assets/favicon-32x32.b7d9707eac91.png HTTP/1.1" 200 2232 "http://10.0.4.53:8085/accounts/login/?next=/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:32:22 +0000] "GET /static/assets/apple-touch-icon.0fcae5e85a72.png HTTP/1.1" 200 9768 "http://10.0.4.53:8085/accounts/login/?next=/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:33:33 +0000] "GET / HTTP/1.1" 302 0 "-" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:33:33 +0000] "GET /search/ HTTP/1.1" 302 0 "-" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:33:33 +0000] "GET /accounts/login/?next=/search/ HTTP/1.1" 200 9517 "-" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:33:50 +0000] "POST /accounts/login/ HTTP/1.1" 302 0 "http://10.0.4.53:8085/accounts/login/?next=/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:33:51 +0000] "GET /search/ HTTP/1.1" 200 70702 "http://10.0.4.53:8085/accounts/login/?next=/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:33:51 +0000] "GET /static/themes/flatly.min.f99bb7c874e0.css HTTP/1.1" 200 25408 "http://10.0.4.53:8085/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:33:51 +0000] "GET /static/custom/js/form_multiselect.8dc17c88ebd1.js HTTP/1.1" 200 74 "http://10.0.4.53:8085/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:33:51 +0000] "GET /static/assets/recipe_no_image.fa01171d3eb4.svg HTTP/1.1" 200 1261 "http://10.0.4.53:8085/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:33:51 +0000] "GET /media/recipes/79b6b75b-b432-4ae6-9745-ec7be5e085aa_1.png HTTP/1.1" 200 579562 "http://10.0.4.53:8085/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:33:52 +0000] "GET /static/webfonts/fa-solid-900.44d537ab79f9.woff2 HTTP/1.1" 200 75728 "http://10.0.4.53:8085/static/fontawesome/fontawesome_all.min.2acd020d0b21.css" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:33:52 +0000] "GET /static/webfonts/fa-regular-400.f5f2566b93e8.woff2 HTTP/1.1" 200 13584 "http://10.0.4.53:8085/static/fontawesome/fontawesome_all.min.2acd020d0b21.css" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:34:04 +0000] "GET /view/recipe/5 HTTP/1.1" 200 11248 "http://10.0.4.53:8085/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:34:04 +0000] "GET /static/django_js_reverse/reverse.85c2a2811d11.js HTTP/1.1" 200 4530 "http://10.0.4.53:8085/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:34:04 +0000] "GET /static/vue/css/chunk-vendors.9ca00e317b25.css HTTP/1.1" 200 10848 "http://10.0.4.53:8085/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 2021/08/08 04:34:05 [warn] 24#24: *41 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/1/00/0000000001 while reading upstream, client: 172.18.0.1, server: localhost, request: "GET /static/vue/js/chunk-vendors.ffb324a43460.js HTTP/1.1", upstream: "http://172.18.0.3:8080/static/vue/js/chunk-vendors.ffb324a43460.js", host: "10.0.4.53:8085", referrer: "http://10.0.4.53:8085/view/recipe/5" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:34:05 +0000] "GET /static/vue/js/chunk-vendors.ffb324a43460.js HTTP/1.1" 200 324888 "http://10.0.4.53:8085/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:34:05 +0000] "GET /static/vue/js/recipe_view.430be248f507.js HTTP/1.1" 200 11799 "http://10.0.4.53:8085/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:34:05 +0000] "GET /static/assets/spinner.8299ad41bba0.svg HTTP/1.1" 200 8598 "http://10.0.4.53:8085/static/css/app.min.a8212bb0f81c.css" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:34:05 +0000] "GET /api/recipe-book/?query= HTTP/1.1" 200 170 "http://10.0.4.53:8085/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:34:06 +0000] "GET /api/recipe/5/?share=None HTTP/1.1" 200 3379 "http://10.0.4.53:8085/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:04:34:06 +0000] "GET /api/recipe-book/?query= HTTP/1.1" 200 170 "http://10.0.4.53:8085/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:36:59 +0000] "GET /view/recipe/5 HTTP/1.1" 302 0 "http://10.0.4.53:8085/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:36:59 +0000] "GET /accounts/login/?next=/view/recipe/5 HTTP/1.1" 200 10100 "http://10.0.4.53:8085/search/" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:36:59 +0000] "GET /static/themes/tandoor.min.f815ca63cc20.css HTTP/1.1" 200 27639 "http://10.0.4.53:8085/accounts/login/?next=/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:36:59 +0000] "GET /static/css/select2.min.9f54e6414f87.css HTTP/1.1" 200 1978 "http://10.0.4.53:8085/accounts/login/?next=/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:36:59 +0000] "GET /static/css/app.min.a8212bb0f81c.css HTTP/1.1" 200 205 "http://10.0.4.53:8085/accounts/login/?next=/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:36:59 +0000] "GET /static/css/select2-bootstrap.dcec0cc93fba.css HTTP/1.1" 200 3676 "http://10.0.4.53:8085/accounts/login/?next=/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:36:59 +0000] "GET /static/themes/select2-bootstrap-theme.d007f71f4d38.css HTTP/1.1" 200 3679 "http://10.0.4.53:8085/accounts/login/?next=/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:36:59 +0000] "GET /static/js/jquery-3.5.1.min.dc5e7f18c8d3.js HTTP/1.1" 200 30879 "http://10.0.4.53:8085/accounts/login/?next=/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:36:59 +0000] "GET /static/fontawesome/fontawesome_all.min.2acd020d0b21.css HTTP/1.1" 200 12346 "http://10.0.4.53:8085/accounts/login/?next=/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:36:59 +0000] "GET /static/js/popper.min.84415b7368fd.js HTTP/1.1" 200 7503 "http://10.0.4.53:8085/accounts/login/?next=/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:36:59 +0000] "GET /static/js/bootstrap.min.61f338f870fc.js HTTP/1.1" 200 15853 "http://10.0.4.53:8085/accounts/login/?next=/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:36:59 +0000] "GET /static/js/select2.min.0f64f3a3a0c6.js HTTP/1.1" 200 19867 "http://10.0.4.53:8085/accounts/login/?next=/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:36:59 +0000] "GET /static/assets/brand_logo.6ebe02bf6707.png HTTP/1.1" 200 35616 "http://10.0.4.53:8085/accounts/login/?next=/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:36:59 +0000] "GET /static/webfonts/poppins_latin_400.9ed361bba848.woff2 HTTP/1.1" 200 7900 "http://10.0.4.53:8085/static/themes/tandoor.min.f815ca63cc20.css" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:36:59 +0000] "GET /static/webfonts/poppins_latin_500.84780596e268.woff2 HTTP/1.1" 200 7776 "http://10.0.4.53:8085/static/themes/tandoor.min.f815ca63cc20.css" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:36:59 +0000] "GET /static/webfonts/poppins_latin_700.f4f17fd53c7d.woff2 HTTP/1.1" 200 7832 "http://10.0.4.53:8085/static/themes/tandoor.min.f815ca63cc20.css" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:37:18 +0000] "POST /accounts/login/ HTTP/1.1" 302 0 "http://10.0.4.53:8085/accounts/login/?next=/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:37:18 +0000] "GET /view/recipe/5 HTTP/1.1" 200 11800 "http://10.0.4.53:8085/accounts/login/?next=/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:37:18 +0000] "GET /api/recipe-book/?query= HTTP/1.1" 200 170 "http://10.0.4.53:8085/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:37:19 +0000] "GET /api/recipe/5/?share=None HTTP/1.1" 200 3379 "http://10.0.4.53:8085/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 172.18.0.1 - - [08/Aug/2021:07:37:19 +0000] "GET /api/recipe-book/?query= HTTP/1.1" 200 170 "http://10.0.4.53:8085/view/recipe/5" "Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36" "-" nginx_recipes_1 | 2021/08/12 11:17:41 [notice] 1#1: signal 3 (SIGQUIT) received, shutting down nginx_recipes_1 | 2021/08/12 11:17:42 [notice] 23#23: gracefully shutting down nginx_recipes_1 | 2021/08/12 11:17:42 [notice] 23#23: exiting nginx_recipes_1 | 2021/08/12 11:17:42 [notice] 23#23: exit nginx_recipes_1 | 2021/08/12 11:17:42 [notice] 24#24: gracefully shutting down nginx_recipes_1 | 2021/08/12 11:17:42 [notice] 24#24: exiting nginx_recipes_1 | 2021/08/12 11:17:42 [notice] 24#24: exit nginx_recipes_1 | 2021/08/12 11:17:43 [notice] 1#1: signal 17 (SIGCHLD) received from 23 nginx_recipes_1 | 2021/08/12 11:17:43 [notice] 1#1: worker process 23 exited with code 0 nginx_recipes_1 | 2021/08/12 11:17:43 [notice] 1#1: signal 29 (SIGIO) received nginx_recipes_1 | 2021/08/12 11:17:43 [notice] 1#1: signal 17 (SIGCHLD) received from 24 nginx_recipes_1 | 2021/08/12 11:17:43 [notice] 1#1: worker process 24 exited with code 0 nginx_recipes_1 | 2021/08/12 11:17:43 [notice] 1#1: exit 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 | 2021/08/12 16:10:07 [notice] 1#1: using the "epoll" event method nginx_recipes_1 | 2021/08/12 16:10:07 [notice] 1#1: nginx/1.21.1 nginx_recipes_1 | 2021/08/12 16:10:07 [notice] 1#1: built by gcc 10.3.1 20210424 (Alpine 10.3.1_git20210424) nginx_recipes_1 | 2021/08/12 16:10:07 [notice] 1#1: OS: Linux 4.4.59+ nginx_recipes_1 | 2021/08/12 16:10:07 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 524288:1048576 nginx_recipes_1 | 2021/08/12 16:10:07 [notice] 1#1: start worker processes nginx_recipes_1 | 2021/08/12 16:10:07 [notice] 1#1: start worker process 21 nginx_recipes_1 | 2021/08/12 16:10:07 [notice] 1#1: start worker process 22 nginx_recipes_1 | 2021/08/13 16:45:18 [error] 22#22: 1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://172.18.0.2:8080/", host: "10.0.4.53:8085" nginx_recipes_1 | 172.18.0.1 - - [13/Aug/2021:16:45:18 +0000] "GET / HTTP/1.1" 502 157 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" "-" nginx_recipes_1 | 2021/08/13 16:45:19 [error] 22#22: 1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "http://172.18.0.2:8080/favicon.ico", host: "10.0.4.53:8085", referrer: "http://10.0.4.53:8085/" nginx_recipes_1 | 172.18.0.1 - - [13/Aug/2021:16:45:19 +0000] "GET /favicon.ico HTTP/1.1" 502 157 "http://10.0.4.53:8085/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" "-" nginx_recipes_1 | 2021/08/13 16:45:21 [error] 22#22: 1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://172.18.0.2:8080/", host: "10.0.4.53:8085" nginx_recipes_1 | 172.18.0.1 - - [13/Aug/2021:16:45:21 +0000] "GET / HTTP/1.1" 502 157 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" "-" nginx_recipes_1 | 2021/08/13 16:45:23 [error] 22#22: 1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://172.18.0.2:8080/", host: "10.0.4.53:8085" nginx_recipes_1 | 172.18.0.1 - - [13/Aug/2021:16:45:23 +0000] "GET / HTTP/1.1" 502 157 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" "-" nginx_recipes_1 | 2021/08/13 16:45:25 [error] 22#22: 1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://172.18.0.2:8080/", host: "10.0.4.53:8085" nginx_recipes_1 | 172.18.0.1 - - [13/Aug/2021:16:45:25 +0000] "GET / HTTP/1.1" 502 157 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" "-" nginx_recipes_1 | 2021/08/13 16:45:29 [error] 22#22: 1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://172.18.0.2:8080/", host: "10.0.4.53:8085" nginx_recipes_1 | 172.18.0.1 - - [13/Aug/2021:16:45:29 +0000] "GET / HTTP/1.1" 502 157 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" "-" nginx_recipes_1 | 2021/08/13 16:45:43 [error] 22#22: 1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://172.18.0.2:8080/", host: "10.0.4.53:8085" nginx_recipes_1 | 172.18.0.1 - - [13/Aug/2021:16:45:43 +0000] "GET / HTTP/1.1" 502 157 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" "-" nginx_recipes_1 | 2021/08/13 16:53:17 [error] 21#21: 9 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://172.18.0.2:8080/", host: "10.0.4.53:8085" nginx_recipes_1 | 172.18.0.1 - - [13/Aug/2021:16:53:17 +0000] "GET / HTTP/1.1" 502 157 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" "-" web_recipes_1 | Updating database 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 | Applying cookbook.0139_space_created_at... OK web_recipes_1 | Applying cookbook.0140_userpreference_created_at... OK web_recipes_1 | Applying cookbook.0141_auto_20210713_1042... OK web_recipes_1 | Applying cookbook.0142_alter_userpreference_search_style... OK web_recipes_1 | js-reverse file written to /opt/recipes/cookbook/static/django_js_reverse web_recipes_1 | web_recipes_1 | 992 static files copied to '/opt/recipes/staticfiles', 1930 post-processed. web_recipes_1 | Done web_recipes_1 | [2021-08-13 16:25:28 +0000] [1] [INFO] Starting gunicorn 20.1.0 web_recipes_1 | [2021-08-13 16:25:28 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1) web_recipes_1 | [2021-08-13 16:25:28 +0000] [1] [INFO] Using worker: sync web_recipes_1 | [2021-08-13 16:25:28 +0000] [13] [INFO] Booting worker with pid: 13 nginx_recipes_1 | 172.18.0.1 - - [13/Aug/2021:17:03:32 +0000] "GET / HTTP/1.1" 502 157 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" "-" nginx_recipes_1 | 2021/08/13 17:03:32 [error] 21#21: 11 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://172.18.0.2:8080/", host: "10.0.4.53:8085" nginx_recipes_1 | 172.18.0.1 - - [13/Aug/2021:17:03:32 +0000] "GET /favicon.ico HTTP/1.1" 502 157 "http://10.0.4.53:8085/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" "-" nginx_recipes_1 | 2021/08/13 17:03:32 [error] 21#21: 11 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "http://172.18.0.2:8080/favicon.ico", host: "10.0.4.53:8085", referrer: "http://10.0.4.53:8085/" nginx_recipes_1 | 2021/08/13 17:04:51 [error] 22#22: 14 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://172.18.0.2:8080/", host: "10.147.19.108:8085" nginx_recipes_1 | 172.18.0.1 - - [13/Aug/2021:17:04:51 +0000] "GET / HTTP/1.1" 502 157 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" "-" nginx_recipes_1 | 2021/08/13 17:04:51 [error] 22#22: 14 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "http://172.18.0.2:8080/favicon.ico", host: "10.147.19.108:8085", referrer: "http://10.147.19.108:8085/" nginx_recipes_1 | 172.18.0.1 - - [13/Aug/2021:17:04:51 +0000] "GET /favicon.ico HTTP/1.1" 502 157 "http://10.147.19.108:8085/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" "-" nginx_recipes_1 | 172.18.0.1 - - [13/Aug/2021:17:17:43 +0000] "GET / HTTP/1.1" 502 157 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" "-" nginx_recipes_1 | 2021/08/13 17:17:43 [error] 21#21: 17 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://172.18.0.2:8080/", host: "10.0.4.53:8085" nginx_recipes_1 | 2021/08/13 17:17:44 [error] 21#21: 17 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "http://172.18.0.2:8080/favicon.ico", host: "10.0.4.53:8085", referrer: "http://10.0.4.53:8085/" nginx_recipes_1 | 172.18.0.1 - - [13/Aug/2021:17:17:44 +0000] "GET /favicon.ico HTTP/1.1" 502 157 "http://10.0.4.53:8085/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" "-" nginx_recipes_1 | 2021/08/14 04:49:08 [error] 22#22: 20 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://172.18.0.2:8080/", host: "10.0.4.53:8085" nginx_recipes_1 | 172.18.0.1 - - [14/Aug/2021:04:49:08 +0000] "GET / HTTP/1.1" 502 157 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0" "-" nginx_recipes_1 | 2021/08/14 04:49:08 [error] 22#22: 20 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "http://172.18.0.2:8080/favicon.ico", host: "10.0.4.53:8085", referrer: "http://10.0.4.53:8085/" nginx_recipes_1 | 172.18.0.1 - - [14/Aug/2021:04:49:08 +0000] "GET /favicon.ico HTTP/1.1" 502 157 "http://10.0.4.53:8085/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0" "-" nginx_recipes_1 | 2021/08/16 13:24:34 [error] 21#21: 23 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://172.18.0.2:8080/", host: "10.0.4.53:8085" nginx_recipes_1 | 172.18.0.1 - - [16/Aug/2021:13:24:34 +0000] "GET / HTTP/1.1" 502 157 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0" "-" nginx_recipes_1 | 172.18.0.1 - - [16/Aug/2021:13:24:34 +0000] "GET /favicon.ico HTTP/1.1" 502 157 "http://10.0.4.53:8085/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0" "-" nginx_recipes_1 | 2021/08/16 13:24:34 [error] 21#21: 23 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "http://172.18.0.2:8080/favicon.ico", host: "10.0.4.53:8085", referrer: "http://10.0.4.53:8085/"

vabene1111 commented 3 years ago

ok the issue seems to be that your nginx cannot connect to your django application container. Please make sure the nginx configuration file is correct and maybe set DEBUG=1 so that the log output is more verbose.

You can also try exposing a port on the application container directly to verify that the application is indeed working properly to narrow down your problem to the nginx proxy.

koch17 commented 3 years ago

This is my nginx config

server {
  listen 80;
  server_name localhost;

  client_max_body_size 16M;

 # # serve media files
  location /media/ {
    alias /media/;
  }
 # # pass requests for dynamic content to gunicorn
  location / {
    proxy_set_header Host $host;
    proxy_pass http://web_recipes:8080;
  }
}

Seems correct.

I am still quite new, so not sure what you mean by directly exposing a port, can you please elaborate on how?

eric-pierce commented 3 years ago

I had this issue as well. I had to manually create the Recipes.conf file, and modify it based on my container names. Here's the relevant piece of my docker-compose (traefik2):

tandoor_backend:
    container_name: tandoor_backend
    image: vabene1111/recipes:latest
    restart: always
    networks:
      - internal
    security_opt:
      - no-new-privileges:true
    depends_on:
      - postgres
    volumes:
      - $DOCKERDIR/tandoor/staticfiles:/opt/recipes/staticfiles
      - $DOCKERDIR/tandoor/nginx_config:/opt/recipes/nginx/conf.d
      - $DOCKERDIR/tandoor/mediafiles:/opt/recipes/mediafiles
    environment:
      - TZ=$TZ
      - PUID=$PUID
      - PGID=$PGID
      - DEBUG=0
      - ALLOWED_HOSTS=tandoor.$DOMAINNAME
      - TIMEZONE=$TZ
      - SECRET_KEY=$TANDOOR_SECRET_KEY
      - DB_ENGINE=django.db.backends.postgresql
      - POSTGRES_HOST=postgres
      - POSTGRES_PORT=5432
      - POSTGRES_USER=tandoor
      - POSTGRES_PASSWORD=$POSTGRES_TANDOOR_PASSWORD
      - POSTGRES_DB=tandoor
      - FRACTION_PREF_DEFAULT=0
      - COMMENT_PREF_DEFAULT=1
      - SHOPPING_MIN_AUTOSYNC_INTERVAL=5
      - GUNICORN_MEDIA=0
      - ENABLE_SIGNUP=0

  tandoor:
    container_name: tandoor
    image: nginx:mainline-alpine
    restart: always
    networks:
      - traefik
      - internal
    depends_on:
      - traefik
      - tandoor_backend
    ports:
      - 8087:80
    volumes:
      - $DOCKERDIR/tandoor/staticfiles:/static
      - $DOCKERDIR/tandoor/nginx_config:/etc/nginx/conf.d:ro
      - $DOCKERDIR/tandoor/mediafiles:/media
    security_opt:
      - no-new-privileges:true
    environment:
      - TZ=$TZ
      - PUID=$PUID
      - PGID=$PGID
    labels:
      - "traefik.enable=true"
      ## HTTP Routers
      - "traefik.http.routers.tandoor-rtr.entrypoints=https"
      - "traefik.http.routers.tandoor-rtr.rule=Host(`tandoor.$DOMAINNAME`)"
      - "traefik.http.routers.tandoor-rtr.tls=true"
      ## Middlewares
      - "traefik.http.routers.tandoor-rtr.middlewares=chain-no-auth@file"
      ## HTTP Services
      - "traefik.http.routers.tandoor-rtr.service=tandoor-svc"
      - "traefik.http.services.tandoor-svc.loadbalancer.server.port=80"`

And here's my modified Recipes.conf:

server {
  listen 80;
  server_name localhost;

  client_max_body_size 128M;

  # serve media files
  location /media/ {
    alias /media/;
  }
  # pass requests for dynamic content to gunicorn
  location / {
    proxy_set_header Host $http_host;
    proxy_pass http://tandoor_backend:8080;
  }
}
vabene1111 commented 3 years ago

yes @eric-pierce you renamed the containers thus making it necessary to update the config. OP did not rename them so should be fine.

@koch17 change your compose to this and see if you can access the aplication on the sever under port 8080 (set DEBUG=1) before testing

version: "3"
services:
  db_recipes:
    restart: always
    image: postgres:11-alpine
    volumes:
      - ./postgresql:/var/lib/postgresql/data
    env_file:
      - ./.env

  web_recipes:
    image: vabene1111/recipes
    restart: always
    ports:
      - 8080:8080
    env_file:
      - ./.env
    volumes:
      - ./staticfiles:/opt/recipes/staticfiles
      - ./mediafiles:/opt/recipes/mediafiles
    depends_on:
      - db_recipes
koch17 commented 3 years ago

Nope, it's "unable to connect" now. I don't mind reinstalling, but I (stupidly kept postponing) didn't backup, so is there a way now to recover my recipes?

vabene1111 commented 3 years ago

your database should not be affected by any changes made to the web_recipes or nginx container as all data is contained in there (withth the exception of the mediafiles directory which you should backup before reinstalling the container).

But where exactly does it say unable to connect now ? in the logs ? what does the browser say with the above config ?

koch17 commented 3 years ago

Sorry, my bad, it is the browser that says "Unable to connect".

vabene1111 commented 3 years ago

could you please also post the logs at startup and when you try to connect ?

please also trey setting the env variable DEBUG=1 and ALLOWED_HOSTS=*

In general i highly recommend starting with as much of a standard setup as possible as the provided installation instructions are know to work and then start adapting them.

koch17 commented 3 years ago

here are my logs:

Attaching to recipes_web_recipes_1, recipes_db_recipes_1 db_recipes_1 | db_recipes_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization db_recipes_1 | db_recipes_1 | 2021-08-13 16:23:43.439 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 db_recipes_1 | 2021-08-13 16:23:43.439 UTC [1] LOG: listening on IPv6 address "::", port 5432 db_recipes_1 | 2021-08-13 16:23:43.789 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" db_recipes_1 | 2021-08-13 16:23:44.605 UTC [21] LOG: database system was interrupted; last known up at 2021-08-13 16:22:32 UTC db_recipes_1 | 2021-08-13 16:23:44.909 UTC [21] LOG: database system was not properly shut down; automatic recovery in progress db_recipes_1 | 2021-08-13 16:23:45.126 UTC [21] LOG: invalid record length at 0/1D9E230: wanted 24, got 0 db_recipes_1 | 2021-08-13 16:23:45.126 UTC [21] LOG: redo is not required db_recipes_1 | 2021-08-13 16:23:46.491 UTC [1] LOG: database system is ready to accept connections web_recipes_1 | Updating database 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 | Applying cookbook.0139_space_created_at... OK web_recipes_1 | Applying cookbook.0140_userpreference_created_at... OK web_recipes_1 | Applying cookbook.0141_auto_20210713_1042... OK web_recipes_1 | Applying cookbook.0142_alter_userpreference_search_style... OK web_recipes_1 | js-reverse file written to /opt/recipes/cookbook/static/django_js_reverse web_recipes_1 | web_recipes_1 | 992 static files copied to '/opt/recipes/staticfiles', 1930 post-processed. web_recipes_1 | Done web_recipes_1 | [2021-08-13 16:25:28 +0000] [1] [INFO] Starting gunicorn 20.1.0 web_recipes_1 | [2021-08-13 16:25:28 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1) web_recipes_1 | [2021-08-13 16:25:28 +0000] [1] [INFO] Using worker: sync web_recipes_1 | [2021-08-13 16:25:28 +0000] [13] [INFO] Booting worker with pid: 13 web_recipes_1 | [2021-08-24 10:35:12 +0000] [1] [INFO] Handling signal: term web_recipes_1 | [2021-08-24 12:35:12 +0200] [13] [INFO] Worker exiting (pid: 13) web_recipes_1 | [2021-08-24 10:35:14 +0000] [1] [INFO] Shutting down: Master web_recipes_1 | Updating database 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', 991 unmodified, 1922 post-processed. web_recipes_1 | Done web_recipes_1 | [2021-08-24 10:36:07 +0000] [1] [INFO] Starting gunicorn 20.1.0 web_recipes_1 | [2021-08-24 10:36:07 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1) web_recipes_1 | [2021-08-24 10:36:07 +0000] [1] [INFO] Using worker: sync web_recipes_1 | [2021-08-24 10:36:07 +0000] [11] [INFO] Booting worker with pid: 11

vabene1111 commented 3 years ago

this does look ok, what does the log say in the moment you connect ?

Have you tried just spinning up a completly default setup and see if that works (maybe on a clean VM)

Sloshy1 commented 3 years ago

I'm getting this issue too, but this is on a brand new setup. I've never used Tandoor before, so I followed the instructions to run on Docker using docker-compose.yml, I changed the port to 8088:80 and set a password for Postgres. The error I get is:

502 Bad Gateway
nginx/1.21.1

I'm using the latest for vabene1111/recipes, but I've left the other images as the defaults from the example docker-compose.yml file you mentioned (postgres:11-alpine and nginx:mainline-alpine).

Looking through my logs, this pops up a bit:

psycopg2.OperationalError: could not translate host name "db_recipes" to address: Name does not resolve

I've killed, removed and recreated the containers and I don't seem to get that error anymore.

My nginx:mainline-alpine container is the only one that seems to stay up, the other two keep restarting every 10 seconds or so.

Sloshy1 commented 3 years ago

Did a bit more digging into the logs. I had the same log entries from the db_recipes container every time I checked:

PostgreSQL Database directory appears to contain a database; Skipping initialization

2021-08-29 07:44:23.046 GMT [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2021-08-29 07:44:23.047 GMT [1] LOG:  listening on IPv6 address "::", port 5432
2021-08-29 07:44:23.062 GMT [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-08-29 07:44:29.050 GMT [23] FATAL:  the database system is starting up
2021-08-29 07:44:32.831 GMT [1] LOG:  startup process (PID 22) was terminated by signal 11: Segmentation fault
2021-08-29 07:44:32.831 GMT [1] LOG:  aborting startup due to startup process failure
2021-08-29 07:44:33.075 GMT [1] LOG:  database system is shut down

Did some digging into the segmentation fault and found this. I'm running a current version of docker, so I updated the libseccomp version to 2_2.5.1-1 as recommended by Aaron Dominguez Diez; this didn't work. I also looked at this referenced in a comment on the previous link, but I don't want to change the Postgres version. In the end I ended up adding the below config to the db_recipes container as recommended in this:

security_opt:
      - seccomp:unconfined 

I now don't get the segmentation faults, but I figured based on what I've read that I don't want to be using the above config long term?

I still get the 502 Bad Gateway error, and looking at the logs for web_recipes, I see this:

django.db.utils.OperationalError: could not connect to server: Connection refused
        Is the server running on host "db_recipes" (172.19.0.2) and accepting
        TCP/IP connections on port 5432?

I've checked and I can ping db_recipes which resolves to 172.19.0.2. It doesn't look like the db_recipes container is listening on port 5432:

admin@docker:/docker/tandoor$ docker exec -it tandoor_web_recipes_1 netstat -tulpn | grep LISTEN
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      1/python
tcp        0      0 127.0.0.11:38837        0.0.0.0:*               LISTEN      -

Not really sure if this is the same issue as OP...

vabene1111 commented 3 years ago

that is a very interesting issue, i can, just to make sure, spin up an addtional instance with the defautl settings to verify those are working but i cant imagine why the default setup might have broken.

In any case, i always need the following information at the same time because if i get them in several messages each after some kind of change i cannot understand the problem

also please set DEBUG=1 before testing because that increases log verbosity

koch17 commented 3 years ago

I have no idea what is going on. I have the docker-compose version you recommended, but I see the db and nginx were updated yesterday and all of a sudden, now I can access the app using the old port. Shouldn't it stop working considering another port is now specified in the docker-compose? The new port still doesn't work. I see in the docs that there is an export future now, but I can't find how exactly to use it, could you please guide me? Also, what is the best way to back up the data?

vabene1111 commented 3 years ago

ok so several questions

  1. the port thing is hard for me to comment as there have been so many changes to your config that i dont know the current state but it can work directly and trough nginx at the same time
  2. the export can be reached from any recipe clicking the three dots "export", there you can also export all recipes. This however contains just an export of recipes meant for import in other applications as it looses some of the more complex data structures (like component recipes). (this will be improved in the future)
  3. Currently the best and also only way of backing up is to dump the database. There are quite a few nice tools that backup postgresql servers in docker. Also you need to backup the mediafiles folder as it contains all your images and files.
Sloshy1 commented 3 years ago

@vabene1111 My config files are below. I've not edited the nginx.conf file.

docker-compose.yml

version: "3"

services:
  db_recipes:
    restart: always
    image: postgres:11-alpine
    volumes:
      - ./postgresql:/var/lib/postgresql/data
    env_file:
      - ./.env
    security_opt:
      - seccomp:unconfined

  web_recipes:
    image: vabene1111/recipes:latest
    restart: always
    env_file:
      - ./.env
    volumes:
      - staticfiles:/opt/recipes/staticfiles
      - nginx_config:/opt/recipes/nginx/conf.d
      - ./mediafiles:/opt/recipes/mediafiles
    depends_on:
      - db_recipes

  nginx_recipes:
    image: nginx:mainline-alpine
    restart: always
    ports:
      - 8088:80
    env_file:
      - ./.env
    depends_on:
      - web_recipes
    volumes:
      - nginx_config:/etc/nginx/conf.d:ro
      - staticfiles:/static
      - ./mediafiles:/media

volumes:
  nginx_config:
  staticfiles:

.env

# only set this to true when testing/debugging
# when unset: 1 (true) - dont unset this, just for development
DEBUG=0

# hosts the application can run under e.g. recipes.mydomain.com,cooking.mydomain.com,...
ALLOWED_HOSTS=*

# random secret key, use for example `base64 /dev/urandom | head -c50` to generate one
SECRET_KEY=

# your default timezone See https://timezonedb.com/time-zones for a list of timezones
TIMEZONE=Europe/London

# add only a database password if you want to run with the default postgres, otherwise change settings accordingly
DB_ENGINE=django.db.backends.postgresql
# DB_OPTIONS= {} # e.g. {"sslmode":"require"} to enable ssl
POSTGRES_HOST=db_recipes
POSTGRES_PORT=5432
POSTGRES_USER=djangouser
POSTGRES_PASSWORD=mmJ84$dFbbfY
POSTGRES_DB=djangodb

# database connection string, when used overrides other database settings.
# format might vary depending on backend
# DATABASE_URL = engine://username:password@host:port/dbname

# the default value for the user preference 'fractions' (enable/disable fraction support)
# default: disabled=0
FRACTION_PREF_DEFAULT=0

# the default value for the user preference 'comments' (enable/disable commenting system)
# default comments enabled=1
COMMENT_PREF_DEFAULT=1

# Users can set a amount of time after which the shopping list is refreshed when they are in viewing mode
# This is the minimum interval users can set. Setting this to low will allow users to refresh very frequently which
# might cause high load on the server. (Technically they can obviously refresh as often as they want with their own scripts)
SHOPPING_MIN_AUTOSYNC_INTERVAL=5

# Default for user setting sticky navbar
# STICKY_NAV_PREF_DEFAULT=1

# If staticfiles are stored at a different location uncomment and change accordingly
# STATIC_URL=/static/

# If mediafiles are stored at a different location uncomment and change accordingly
# MEDIA_URL=/media/

# Serve mediafiles directly using gunicorn. Basically everyone recommends not doing this. Please use any of the examples
# provided that include an additional nxginx container to handle media file serving.
# If you know what you are doing turn this back on (1) to serve media files using djangos serve() method.
# when unset: 1 (true) - this is temporary until an appropriate amount of time has passed for everyone to migrate
GUNICORN_MEDIA=0

# S3 Media settings: store mediafiles in s3 or any compatible storage backend (e.g. minio)
# as long as S3_ACCESS_KEY is not set S3 features are disabled
# S3_ACCESS_KEY=
# S3_SECRET_ACCESS_KEY=
# S3_BUCKET_NAME=
# S3_REGION_NAME= # default none, set your region might be required
# S3_QUERYSTRING_AUTH=1 # default true, set to 0 to serve media from a public bucket without signed urls
# S3_QUERYSTRING_EXPIRE=3600 # number of seconds querystring are valid for
# S3_ENDPOINT_URL= # when using a custom endpoint like minio

# Email Settings, see https://docs.djangoproject.com/en/3.2/ref/settings/#email-host
# Required for email confirmation and password reset (automatically activates if host is set)
# EMAIL_HOST=
# EMAIL_PORT=
# EMAIL_HOST_USER=
# EMAIL_HOST_PASSWORD=
# EMAIL_USE_TLS=0
# EMAIL_USE_SSL=0
# DEFAULT_FROM_EMAIL= # email sender address (default 'webmaster@localhost')
# ACCOUNT_EMAIL_SUBJECT_PREFIX= # prefix used for account related emails (default "[Tandoor Recipes] ")

# allow authentication via reverse proxy (e.g. authelia), leave off if you dont know what you are doing
# see docs for more information https://vabene1111.github.io/recipes/features/authentication/
# when unset: 0 (false)
REVERSE_PROXY_AUTH=0

# If base URL is something other than just /  (you are serving a subfolder in your proxy for instance http://recipe_app/recipes/)
# SCRIPT_NAME=/recipes
# Default settings for spaces, apply per space and can be changed in the admin view
# SPACE_DEFAULT_MAX_RECIPES=0 # 0=unlimited recipes
# SPACE_DEFAULT_MAX_USERS=0 # 0=unlimited users per space
# SPACE_DEFAULT_MAX_FILES=0 # Maximum file storage for space in MB. 0 for unlimited, -1 to disable file upload.
# SPACE_DEFAULT_ALLOW_SHARING=1 # Allow users to share recipes with public links

# allow people to create accounts on your application instance (without an invite link)
# when unset: 0 (false)
# ENABLE_SIGNUP=0

# If signup is enabled you might want to add a captcha to it to prevent spam
# HCAPTCHA_SITEKEY=
# HCAPTCHA_SECRET=

# if signup is enabled you might want to provide urls to data protection policies or terms and conditions
# TERMS_URL=
# PRIVACY_URL=
# IMPRINT_URL=

# enable serving of prometheus metrics under the /metrics path
# ATTENTION: view is not secured (as per the prometheus default way) so make sure to secure it
# trough your web server (or leave it open of you dont care if the stats are exposed)
# ENABLE_METRICS=0
# allows you to setup OAuth providers
# see docs for more information https://vabene1111.github.io/recipes/features/authentication/
# SOCIAL_PROVIDERS = allauth.socialaccount.providers.github, allauth.socialaccount.providers.nextcloud,

# Should a newly created user from a social provider get assigned to the default space and given permission by default ?
# ATTENTION: This feature might be deprecated in favor of a space join and public viewing system in the future
# default 0 (false), when 1 (true) users will be assigned space and group
# SOCIAL_DEFAULT_ACCESS = 1

# if SOCIAL_DEFAULT_ACCESS is used, which group should be added
# SOCIAL_DEFAULT_GROUP=guest

# Django session cookie settings. Can be changed to allow a single django application to authenticate several applications
# when running under the same database
# SESSION_COOKIE_DOMAIN=.example.com
# SESSION_COOKIE_NAME=sessionid # use this only to not interfere with non unified django applications under the same top level domain

Logs from startup and logs from failed request are below.

nginx_recipes

/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2021/08/30 12:13:04 [notice] 1#1: using the "epoll" event method
2021/08/30 12:13:04 [notice] 1#1: nginx/1.21.1
2021/08/30 12:13:04 [notice] 1#1: built by gcc 10.3.1 20210424 (Alpine 10.3.1_git20210424) 
2021/08/30 12:13:04 [notice] 1#1: OS: Linux 5.10.52-v7+
2021/08/30 12:13:04 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2021/08/30 12:13:04 [notice] 1#1: start worker processes
2021/08/30 12:13:04 [notice] 1#1: start worker process 22
2021/08/30 12:13:04 [notice] 1#1: start worker process 23
2021/08/30 12:13:04 [notice] 1#1: start worker process 24
2021/08/30 12:13:04 [notice] 1#1: start worker process 25

web_recipes

Updating database
Operations to perform:
  Apply all migrations: account, admin, auth, authtoken, contenttypes, cookbook, sessions, sites, socialaccount
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying account.0001_initial... OK
  Applying account.0002_email_max_length... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying admin.0003_logentry_add_action_flag_choices... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  Applying auth.0009_alter_user_last_name_max_length... OK
  Applying auth.0010_alter_group_name_max_length... OK
  Applying auth.0011_update_proxy_permissions... OK
  Applying auth.0012_alter_user_first_name_max_length... OK
  Applying authtoken.0001_initial... OK
  Applying authtoken.0002_auto_20160226_1747... OK
  Applying authtoken.0003_tokenproxy... OK
  Applying cookbook.0001_initial... OK
  Applying cookbook.0002_auto_20191119_2035... OK
  Applying cookbook.0003_enable_pgtrm... OK
  Applying cookbook.0004_storage_created_by... OK
  Applying cookbook.0005_recipebook_recipebookentry... OK
  Applying cookbook.0006_recipe_image... OK
  Applying cookbook.0007_auto_20191226_0852... OK
  Applying cookbook.0008_mealplan... OK
  Applying cookbook.0009_auto_20200130_1056... OK
  Applying cookbook.0010_auto_20200130_1059... OK
  Applying cookbook.0011_remove_recipeingredients_unit... OK
  Applying cookbook.0012_auto_20200130_1116... OK
  Applying cookbook.0013_userpreference... OK
  Applying cookbook.0014_auto_20200213_2332... OK
  Applying cookbook.0015_auto_20200213_2334... OK
  Applying cookbook.0016_auto_20200213_2335... OK
  Applying cookbook.0017_auto_20200216_2257... OK
  Applying cookbook.0018_auto_20200216_2303... OK
  Applying cookbook.0019_ingredient... OK
  Applying cookbook.0020_recipeingredient_ingredient... OK
  Applying cookbook.0021_auto_20200216_2309... OK
  Applying cookbook.0022_remove_recipeingredient_name... OK
  Applying cookbook.0023_auto_20200216_2311... OK
  Applying cookbook.0024_auto_20200216_2313... OK
  Applying cookbook.0025_userpreference_nav_color... OK
  Applying cookbook.0026_auto_20200219_1605... OK
  Applying cookbook.0027_ingredient_recipe... OK
  Applying cookbook.0028_auto_20200317_1901... OK
  Applying cookbook.0029_auto_20200317_1901... OK
  Applying cookbook.0030_recipeingredient_note... OK
  Applying cookbook.0031_auto_20200407_1841... OK
  Applying cookbook.0032_userpreference_default_unit... OK
  Applying cookbook.0033_userpreference_default_page... OK
  Applying cookbook.0034_auto_20200426_1614... OK
  Applying cookbook.0035_auto_20200427_1637... OK
  Applying cookbook.0036_auto_20200427_1800... OK
  Applying cookbook.0037_userpreference_search_style... OK
  Applying cookbook.0038_auto_20200502_1259... OK
  Applying cookbook.0039_recipebook_shared... OK
  Applying cookbook.0040_auto_20200502_1433... OK
  Applying cookbook.0041_auto_20200502_1446... OK
  Applying cookbook.0042_cooklog... OK
  Applying cookbook.0043_auto_20200507_2302... OK
  Applying cookbook.0044_viewlog... OK
  Applying cookbook.0045_userpreference_show_recent... OK
  Applying cookbook.0046_auto_20200602_1133... OK
  Applying cookbook.0047_auto_20200602_1133... OK
  Applying cookbook.0048_auto_20200602_1140... OK
  Applying cookbook.0049_mealtype_created_by... OK
  Applying cookbook.0050_auto_20200611_1509... OK
  Applying cookbook.0051_auto_20200611_1518... OK
  Applying cookbook.0052_userpreference_ingredient_decimals... OK
  Applying cookbook.0053_auto_20200611_2217... OK

db_recipes

PostgreSQL Database directory appears to contain a database; Skipping initialization

2021-08-30 12:12:58.023 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2021-08-30 12:12:58.023 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2021-08-30 12:12:58.042 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-08-30 12:12:58.138 UTC [22] LOG:  database system was interrupted; last known up at 2021-08-30 12:08:36 UTC
2021-08-30 12:12:58.424 UTC [22] LOG:  database system was not properly shut down; automatic recovery in progress
2021-08-30 12:12:58.443 UTC [22] LOG:  redo starts at 0/165F318
2021-08-30 12:12:58.443 UTC [22] LOG:  invalid record length at 0/165F350: wanted 24, got 0
2021-08-30 12:12:58.443 UTC [22] LOG:  redo done at 0/165F318
2021-08-30 12:12:58.533 UTC [1] LOG:  database system is ready to accept connections

Logs for failed connection nginx_recipes

2021/08/30 12:14:52 [error] 22#22: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.30.182, server: localhost, request: "GET / HTTP/1.1", upstream: "http://172.25.0.3:8080/", host: "dockerhole.home.lan:8088"
172.31.30.182 - - [30/Aug/2021:12:14:52 +0000] "GET / HTTP/1.1" 502 157 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0" "-"
2021/08/30 12:14:53 [error] 22#22: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.30.182, server: localhost, request: "GET / HTTP/1.1", upstream: "http://172.25.0.3:8080/", host: "dockerhole.home.lan:8088"
172.31.30.182 - - [30/Aug/2021:12:14:53 +0000] "GET / HTTP/1.1" 502 157 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0" "-"

There are no extra logs for any of the other containers. I've also never seent the Applying cookbook.* entries before, despite not changing anything except the debug log setting since running it prior to generating those logs.

EDIT: Just after posting this, I tried to refresh the page and it started working... It seems as though web_recipes needed to do some copying, as I've never seen the below before either.

992 static files copied to '/opt/recipes/staticfiles', 2798 post-processed.
Done
[2021-08-30 12:16:37 +0000] [1] [INFO] Starting gunicorn 20.1.0
[2021-08-30 12:16:37 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
[2021-08-30 12:16:37 +0000] [1] [INFO] Using worker: sync
[2021-08-30 12:16:37 +0000] [11] [INFO] Booting worker with pid: 11
koch17 commented 3 years ago
  1. right now my docker-compose is what you suggested here: (https://github.com/vabene1111/recipes/issues/803#issuecomment-901779246), with port 8070. My original port was 8085 as shown at the very top. Well, for some reason, 8085 works now, 8070 doesn't.
  2. Found it. I know you said it is not a priority, but I think issue #79 will have a lot of value for many.
  3. I will maybe try this. Thanks, I guess my problem is resolved now.
vabene1111 commented 3 years ago

so i guess this would be resolved now right ?

a 502 bad gateway is totally normal for say 10-20 seconds after starting the container, depending on the server maybe even a little longer.

Sloshy1 commented 3 years ago

@vabene1111 This was an issue for me for much longer than 10-20 seconds, but I don't know why it is now fixed; like I said I haven't changed anything.

vabene1111 commented 3 years ago

Very interesting, maybe something caused the static file collection to be much slower or even fail 🤔 will keep this in mind in case it comes up again