• OS: Windows
  • databases: postgresql 12.6.0
  • Programming language and version: Python and Django
  • Your issue
    Hello, i’m having issue connecting to the postgresql db for project “brasserie-76-flo”. I have a connection refused when i run qovery run.
    Screenshot 2021-06-07 132535 1053×267 37.2 KB

    I pinged the ip adresse and it returns the packets, so i guess a port issue ? Or maybe i a have a confusion with ENV given by Qovery.

    My settings seems ok :

    Am i missing something ?

    Dockerfile content (if any)

    FROM python:3.8.0-alpine

    WORKDIR /usr/src/app

    ENV PYTHONDONTWRITEBYTECODE 1

    ENV PYTHONUNBUFFERED 1

    COPY . .

    RUN apk update && apk add postgresql-dev gcc python3-dev musl-dev

    RUN pip install --upgrade pip

    RUN pip install -r requirements.txt

    RUN python3 -V

    RUN python3 ./bakpak_project/manage.py collectstatic --noinput

    RUN python3 ./bakpak_project/manage.py makemigrations

    RUN python3 ./bakpak_project/manage.py migrate

    EXPOSE 8000

    CMD [“python3”, “./bakpak_project/manage.py”, “runserver”, “0.0.0.0:8000”]

    Yml content :

    application:
    name: brasserie-76-flo
    project: brasserie-76-flo
    port: 8000
    publicly_accessible: true
    databases:

  • type: postgresql
    name: bakpakerdb
    version: “12.6.0”
    routers:
  • name: main
    routes:
  • application_name: brasserie-76-flo
    paths:

    You’re trying to use db before it deployment

    2021-06-08T09:37:15Z	ERROR	APPLICATION	ERROR	The command '/bin/sh -c python3 ./bakpak_project/manage.py makemigrations' returned a non-zero code: 1
    

    You must find a way to let app deploy then migrate. At the moment the crash makes all things stuck.

  • first in order to initialize the container and the db
  • second time to set up the db (aplply migration and create a superuser)
  • Thank you Enzo

  •