1

I am building an app with Docker, Django and PostgreSQL. I was trying to parse through rows in an excel file (about 7000 rows) and got this error:

web_1 | [2019-09-26 23:39:34 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:11) web_1 | [2019-09-26 23:39:34 +0000] [11] [INFO] Worker exiting (pid: 11) web_1 | [2019-09-26 23:39:34 +0000] [12] [INFO] Booting worker with pid: 12

I searched for solution and found a suggestion to increase the TIMEOUT but I don't know where to find it.

Here is my yml files.

version: '3.7'
services:
  web:
    build: .
    command: python /code/manage.py runserver 0.0.0.0:8000
    command: gunicorn bookstore_project.wsgi -b 0.0.0.0:8000 # new
    environment:
      - SECRET_KEY=<secret_key>
      - DEBUG=1
      - ENVIRONMENT=development
    volumes:
      - .:/code
    ports:
      - 8000:8000
    depends_on: 
      - db

  db:
    image: postgres:11
    volumes:
      - postgres_data:/var/lib/postgresql/data/

volumes:
  postgres_data:

docker-compose-prod-yml

version: '3.7'

services:
  web:
    build: .
    command: python /code/manage.py runserver 0.0.0.0:8000
    environment:
      - ENVIRONMENT=production
      - SECRET_KEY=<Secret_key>
      - DEBUG=0
    ports:
      - 8000:8000
    depends_on:
      - db
  db:
    image: postgres:11

heroku.yml:

setup:
  addons:
  - plan: heroku-postgresql
build:
  docker:
    web: Dockerfile
release:
  image: web
  command:
    - python manage.py collectstatic --noinput
run:
  web: gunicorn bookstore_project.wsgi

Any help is appreciated!

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
Huy Than
  • 1,538
  • 2
  • 16
  • 31
  • Oh, sorry, I didn't mean it, I just copied from the terminal output. Thank you for your editing. – Huy Than Sep 27 '19 at 04:25
  • 1
    For someone who might have the same problem with me. The answer is to add one more command line: command: gunicorn bookstore_project.wsgi:application -w 2 -b :8000 --timeout 3000 I found the answer here: https://stackoverflow.com/questions/47217880/critical-worker-timeout-error-on-gunicorn-django – Huy Than Sep 27 '19 at 04:26

0 Answers0