a year ago
Hi
I am unable to connect with my pgvector postgres db.
receiving the following error
getaddrinfo ENOTFOUND pgvector.railway.internal
for my sveltekit app (using dockerfile) I added 3 second sleep.
and for both pgvector and sveltekit added ENABLEALPINEPRIVATE_NETWORKING=true in variables
sveltekit app project id 94b0bba1-afce-4b74-ac49-8aa1fb06163e
pgvector project id 171d055d-0855-415c-8f03-8b52fb322141
23 Replies
a year ago
do you get that error locally?
postgresql://postgres:PASSWORD@pgvector.railway.internal:45850/railway
this is my connection string if its of any help. I have replaced actual password with PASSWORD
the following connection string is working
postgresql://postgres:PASSWORD@autorack.proxy.rlwy.net:45850/railway
a year ago
you are using the private url locally, you need to use the public url
please check this healthcheck endpoint
https://betterfaq-production.up.railway.app/healthz
// src/routes/healthz/+server.js
import { sql } from '$lib/server/db/client';
import { json } from '@sveltejs/kit';
export async function GET() {
try {
await sql`SELECT 1'`;
return json({ status: 'OK' }, { status: 200 });
} catch (error) {
// Check if the error is an instance of Error
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
return json({ status: 'Service Unavailable', error: errorMessage }, { status: 503 });
}
}code for healthcheck endpoint which only checks if db is connected or not
===
just to reiterate, using internal for connecting the application hosted on railway and db is also hosted on railway
a year ago
may i ask why you showed a screenshot of you attempting to connect to the private url locally?
do you get that error locally?
I mentioned that both are hosted on railway, because you asked this.
sorry, english is not my first language
a year ago
your database and app are in different projects right? if so, they need to be in the same project
a year ago
it would be a manual process
a year ago
look what up?
a year ago
you already have, just do it in the correct project this time
a year ago
for the future, please read this docs page -
