a month ago
I am using python:3.11-slim to build a backend server. It is unable to connect to the postgres server using private ip. Public IP works. Both are in same project. Also i tried ssh-ing into the server and then installed psql and tried to connect to postgres instance. Same error.
root@36c97201e3be:/app# psql -h postgres.railway.internal -p 5432 -U postgres -d railway
psql: error: could not translate host name "postgres.railway.internal" to address: Name or service not known
My railway.json file:
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "DOCKERFILE",
"dockerfilePath": "Dockerfile"
},
"deploy": {
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
I dont understand the problem.
3 Replies
a month ago
Hey there! We've found the following might help you get unblocked faster:
🧵 Railway CLI Laravel DB Seed command could not translate host name error
🧵 django.db.utils.OperationalError: could not translate host name "postgres.railway.internal"
🧵 SQLalchemy could not translate host name "postgres.railway.internal"
If you find the answer from one of these, please let us know by solving the thread!
a month ago
I don't see a Postgres service in this project?
Status changed to Awaiting User Response Railway • about 1 month ago
a month ago
I deleted it and created a new one with pgvector. Name is mentordb
This is from ssh from matchme-backend instance
root@1dda1f265d8d:/app# wget pgvector.railway.internal
--2025-08-06 17:05:21-- http://pgvector.railway.internal/
Resolving pgvector.railway.internal (pgvector.railway.internal)... failed: Name or service not known.
wget: unable to resolve host address ‘pgvector.railway.internal’
Status changed to Awaiting Railway Response Railway • about 1 month ago
Status changed to Solved karthikkolli • about 1 month ago