Django + Poetry Dockerfile | Timeout on deployment

Issues information

  • OS: python:3.10-alpine / Linux Alpine
  • databases: PostgreSQL 13
  • Programming language and version: Python
  • Link to your project on Github/Gitlab: Can’t but if needed can do a public copy

Your issue
Hey guys! This is probably me being ignorant on how Docker and Dockerfile works. But currently im trying to deploy my Django app which is a monorepo like setup using Poetry. Locally my docker builds and runs (currently just fails due to not finding the PSQL db host, some networking issue with it)
Dockerfile content (if any)

FROM python:3.10
RUN set -xe
RUN curl -sSL https://install.python-poetry.org | python3 - --git https://github.com/python-poetry/poetry.git@master
ENV PATH="/root/.local/bin:$PATH"
RUN poetry --version

WORKDIR /usr/app
COPY . /usr/app
RUN ["chmod", "+x", "/usr/app/scripts/run-server.sh"]

WORKDIR /usr/app/core
RUN poetry install


EXPOSE 8000
ENTRYPOINT ["/usr/app/scripts/run-server.sh"]

run-server.sh

#!/usr/bin/env bash
set -euo pipefail

echo Starting Server thru Gunicorn

poetry run python manage.py migrate

exec gunicorn --bind 0.0.0.0:8000 --reload backend.wsgi

Error after timeout

deployment error application zb7c04f71 : error => EngineError { tag: HelmChartUninstallError, event_details: EventDetails { provider_kind: None, organisation_id: QoveryIdentifier { raw_long_id: "za084f3f6", short: "za084f3f" }, cluster_id: QoveryIdentifier { raw_long_id: "e3590276-62ba-4fe0-8f12-957678ad4201", short: "e3590276" }, execution_id: QoveryIdentifier { raw_long_id: "0872859d-1890-4b07-ba6f-7b92bbe7c8e1-14-1653601472", short: "0872859d" }, region: None, stage: Environment(Deploy), transmitter: Application("zb7c04f71", "zb7c04f71", "bba260b26bf871146e246d0989b7e32d488c50ff") }, qovery_log_message: "Helm timed out for release `application-zb7c04f71-zb7c04f71` during helm UPGRADE: Error: release application-zb7c04f71-zb7c04f71 failed, and has been uninstalled due to atomic being set: timed out waiting for the condition: Error while executing Helm command. / Full details: ExitStatusError(ExitStatus(unix_wait_status(256)))", user_log_message: "Helm timed out for release `application-zb7c04f71-zb7c04f71` during helm UPGRADE: Error: release application-zb7c04f71-zb7c04f71 failed, and has been uninstalled due to atomic being set: timed out waiting for the condition: Error while executing Helm command. / Full details: ExitStatusError(ExitStatus(unix_wait_status(256)))", underlying_error: None, link: None, hint_message: None }

Error Log

	
Execution ID: 0bde8236-6511-42b1-9764-988d55ae5d25-3-1653602713
deployment error application z39edacf4 : error => EngineError { tag: HelmChartUninstallError, event_details: EventDetails { provider_kind: None, organisation_id: QoveryIdentifier { raw_long_id: "za084f3f6", short: "za084f3f" }, cluster_id: QoveryIdentifier { raw_long_id: "e3590276-62ba-4fe0-8f12-957678ad4201", short: "e3590276" }, execution_id: QoveryIdentifier { raw_long_id: "0bde8236-6511-42b1-9764-988d55ae5d25-3-1653602713", short: "0bde8236" }, region: None, stage: Environment(Deploy), transmitter: Application("z39edacf4", "z39edacf4", "2ff16b4ae330359444e03daa02413c7125e44356") }, qovery_log_message: "Helm timed out for release `application-z39edacf4-z39edacf4` during helm UPGRADE: Error: release application-z39edacf4-z39edacf4 failed, and has been uninstalled due to atomic being set: timed out waiting for the condition: Error while executing Helm command. / Full details: ExitStatusError(ExitStatus(unix_wait_status(256)))", user_log_message: "Helm timed out for release `application-z39edacf4-z39edacf4` during helm UPGRADE: Error: release application-z39edacf4-z39edacf4 failed, and has been uninstalled due to atomic being set: timed out waiting for the condition: Error while executing Helm command. / Full details: ExitStatusError(ExitStatus(unix_wait_status(256)))", underlying_error: None, link: None, hint_message: None }

27 May, 00:15:51.150
django
DEPLOYMENT_ERROR
Execution ID: 0bde8236-6511-42b1-9764-988d55ae5d25-3-1653602713
unable to retrieve container logs for docker://efe05b598a3b0847373c5d336dab0a5269442ccf6916d2f765decbdc2dc90094
Condition not met to start the container: Ready -> Unknown(Some("ContainersNotReady")): containers with unready status: [app-z39edacf4]
Condition not met to start the container: ContainersReady -> Unknown(Some("ContainersNotReady")): containers with unready status: [app-z39edacf4]
terminated state exit code: 1
2022-05-26T22:15:45Z Warning BackOff: Back-off restarting failed container
2022-05-26T22:02:09Z Warning BackOff: Back-off restarting failed container
2022-05-26T22:02:09Z Warning NoControllers: found no controllers for pod "app-z39edacf4-6dbbd5f469-tg8ml"
2022-05-26T22:02:09Z Warning CalculateExpectedPodCountFailed: Failed to calculate the number of expected pods: found no controllers for pod "app-z39edacf4-6dbbd5f469-tg8ml"

PD: Tried deploying the Django + Dockerfile example and seems like the samething is happening, my deployment is just timing out and failing. Deploy Django with PostgreSQL | Qovery

Hi @ditorojuan ,

Can you show your application logs?

Refer to this guide on how to debug your app logs.

1 Like

Found the mistake, now my app is deployed. It was all on my side, but the log where definitely not helpful.

Background on the problem
The run-server.sh file was not exactly working correctly. The gunicorn command was not working due to the dependency missing on the Dockerfile environment. The debugging was done entirely on my machine with logs of local docker and abstracting/ignoring the database problem(basically just connecting to sqlite instead of Postgres)

Hope this is of help to anyone that might be having a similar issue.

Note: I have not debugged why the Deploy Django with PostgreSQL | Qovery example is not working tho, have not debugged that one so unfortunately cant give more detaoils about it right now

Well done :+1: I agree, the logs are not helpful and to be 100% transparent we are working on a new version to give better feedback. It’s a 6 months work that we plan to soft launch next month. I can put you in the loop. Do you? Cc @a_carrano @Florian_Lepont

1 Like

Sure thing! Would love to be on the loop, thanks!

1 Like