Cannot communicate with server in private network

Traceback: https://pastebin.com/czArL7Rp Django is trying to talk to the database, but cannot connect and is as such throwing a 500
Pastebin
2024-01-14 13:27:46,265 django.request ERROR Internal Server Err...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
25 Replies
Percy
Percy•8mo ago
Project ID: 6ec4e69f-153c-42b1-8399-d4fbd6db04fb
meaniebeanie22
meaniebeanie22•8mo ago
6ec4e69f-153c-42b1-8399-d4fbd6db04fb
Brody
Brody•8mo ago
can you connect to the database locally?
meaniebeanie22
meaniebeanie22•8mo ago
what do you mean? It's a postgres DB hosted in railway in the same project as the django instance
Brody
Brody•8mo ago
connect to the database from your computer
meaniebeanie22
meaniebeanie22•8mo ago
not sure how to do that what I am going to try though is replacing postgres.railway.internal with the public url and seeing if that works works with that so not sure
Brody
Brody•8mo ago
can you add a 3 second sleep to the beginning of your start command when using the internal domain
meaniebeanie22
meaniebeanie22•8mo ago
how would i do that - somewhere in the dockerfile?
Brody
Brody•8mo ago
ah youre using a dockerfile, send it please
meaniebeanie22
meaniebeanie22•8mo ago
FROM python:3.12.1-slim

ENV PYTHONUNBUFFERED=1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
pkg-config \
libcairo2-dev \
python3-dev

WORKDIR /app

COPY requirements.txt ./

RUN pip install -r requirements.txt

COPY . ./

# Collect static files
RUN python manage.py collectstatic --noinput

CMD gunicorn tkdmanager.wsgi --log-file -
FROM python:3.12.1-slim

ENV PYTHONUNBUFFERED=1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
pkg-config \
libcairo2-dev \
python3-dev

WORKDIR /app

COPY requirements.txt ./

RUN pip install -r requirements.txt

COPY . ./

# Collect static files
RUN python manage.py collectstatic --noinput

CMD gunicorn tkdmanager.wsgi --log-file -
Brody
Brody•8mo ago
looks like something i would write
meaniebeanie22
meaniebeanie22•8mo ago
ya did :}
Brody
Brody•8mo ago
FROM python:3.12.1-slim

ENV PYTHONUNBUFFERED=1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
pkg-config \
libcairo2-dev \
python3-dev

WORKDIR /app

COPY requirements.txt ./

RUN pip install -r requirements.txt

COPY . ./

# Collect static files
RUN python manage.py collectstatic --noinput

CMD sleep 3 && gunicorn tkdmanager.wsgi --log-file -
FROM python:3.12.1-slim

ENV PYTHONUNBUFFERED=1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
pkg-config \
libcairo2-dev \
python3-dev

WORKDIR /app

COPY requirements.txt ./

RUN pip install -r requirements.txt

COPY . ./

# Collect static files
RUN python manage.py collectstatic --noinput

CMD sleep 3 && gunicorn tkdmanager.wsgi --log-file -
that checks out
meaniebeanie22
meaniebeanie22•8mo ago
and then switch the PGHOST env var back to postgres.railway.internal?
Brody
Brody•8mo ago
yep PGPORT needs to be set to 5432 too
Want results from more Discord servers?
Add your server