2 months ago
i'm using a tortoise orm with a fastapi app, and it works perfectly with the postgres public url but i get an saying that the db scheme wasn't recognized when i use the internal url
1 Replies
2 months ago
Are you using the internal url in a local environment?
2 months ago
Or on your deployed app
2 months ago
Instead of using the URL to connect, can you define individual values? Like Host, User, Password, Port, DB…
2 months ago
my guess is that tortoise is malformatting the internal URL, but I'm not sure
2 months ago
Another thing that you could try is joining #🚅|priority-boarding and enabling the IPv4 Feature Flag
2 months ago
are you using the right db name? if you say the schema is not recognised, it seems like you can connect to a db, maybe you are just connected to the wrong db?
2 months ago
@shiv any update on this?
py TORTOISE_ORM = { "connections": { "default": { "engine": "tortoise.backends.asyncpg", "credentials": { "host": os.getenv("DB_HOST"), "port": int(os.getenv("DB_PORT", 5432)), "user": os.getenv("DB_USER"), "password": os.getenv("DB_PASSWORD"), "database": os.getenv("DB_NAME"), } } }, "apps": { "models": { "models": ["core.models", "aerich.models"], "default_connection": "default", } }, }
File "/usr/local/lib/python3.12/socket.py", line 978, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -2] Name or service not known
2 months ago
It's been GA'd now so it is automatically enabled on all new environments.
so i'm running this via a dockerfile which runs a run.sh and that has a migration command
```Dockerfile
FROM python:3.12-slim
WORKDIR /app
Install build dependencies for packages with C extensions
RUN apt-get update && apt-get install -y \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*
Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
Copy dependency files
COPY pyproject.toml uv.lock* ./
Install dependencies using system Python
RUN uv sync --frozen --no-dev --python $(which python3)
Copy application code
COPY . .
Make startup script executable
RUN chmod +x run.sh
CMD ["./run.sh"]```
2 months ago
I'll let the community assist with that.
same error
okay this is terribly stupid on my end but i just realised i wasn't on the same project?
also the side panel hiding the add service button makes it really confusing

2 months ago
Priority support would be in regards to platform issues.
2 months ago
Don't worry, it happens lol 😄
2 months ago
Did you managed to make it work?
2 months ago
nice!
2 months ago
anything I can help you with?
2 months ago
amazing
2 months ago
!s
Status changed to Solved medim • about 2 months ago

