Hi,
I have written a wizard state transition that can take more than one minute to finish because it accesses an external system. This works fine. However, in the desktop client and sao, a “timed out” message is shown after around 55 seconds.
Is it possible to configure the time out?
The timeout comes probably from the WSGI or proxy server.
If you are running the tryton 7.0 series on docker images the timeout is caused by gunicorn and it is fixed by setting the following environment variable on your docker server:
GUNICORN_CMD_ARGS="--timeout=600"
Hello Cédric and Sergi!
I encountered the timeout problem while trying to setup the account plan on a slow laptop with Docker (latest version aka version 7.2).
I followed the official instructions to setup Tryton with a docker compose file and an .env file.
Adding
GUNICORN_CMD_ARGS="--timeout=600"
or
GUNICORN_CMD_ARGS="--timeout 600"
to the .env file didn’t change the Gunicorn default timeout of 30 seconds.
I had to create my own Docker image based on the 7.2 folder by adding this line:
timeout = 900
to the file gunicorn.conf.py
Is there an easier way to modify the gunicorn timeout by adding something to the .env file or Docker compose file while using the official Tryton Docker image?
Thanks a lot!
jérôme
.env
does not set environment variable in the service runtime. It is just to template the content of docker-compose.yml
You must set in the environment
of the service.
Yes with the GUNICORN_CMD_ARGS
environment or by starting the command
of the service with a -
like --timeout 600
.
Thank you Cédric!
I modified my compose.yml file this way:
services:
server:
image: tryton/tryton:7.2-office
environment:
- DB_PASSWORD=${DB_PASSWORD:-password}
- GUNICORN_CMD_ARGS="--timeout=${GUNICORN_TIMEOUT:-30}"
and added the GUNICORN_TIMEOUT in the .env file:
GUNICORN_TIMEOUT=900
I checked the result with this command:
docker exec -t tryton-server-1 gunicorn --print-config trytond.application:app
Works like a charm!