No ipv6 to connect to postgres instance
karthikkolli
PROOP

10 months 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.

Solved$10 Bounty

3 Replies

Railway
BOT

10 months ago


parmstar
EMPLOYEE

10 months ago

I don't see a Postgres service in this project?


Status changed to Awaiting User Response Railway 10 months ago


karthikkolli
PROOP

10 months 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 10 months ago


Status changed to Solved karthikkolli 10 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...