Postgres rejecting auth on its own injected DATABASE_URL — production down
joaovcaldeira
PROOP

15 days ago

Hi, my Postgres service is rejecting authentication on the DATABASE_URL that Railway itself injects into my dependent services. Project: profound-hope (ID: 1676637b-4928-40e7-a50b-c9a0ae06d609) Service: Postgres What I observed: - I rotated POSTGRES_PASSWORD via the Variables tab - Now neither external clients (psql via DATABASE_PUBLIC_URL) nor internal clients (my galtria service via DATABASE_URL) can connect - Both fail with: FATAL: password authentication failed for user "postgres" Looks like Postgres password rotation only updated the env var but not the actual user password inside the database. Could you please reset the database credentials on the Postgres service so it's back in sync? My production app (galtria) is currently down. Thanks!

Solved$20 Bounty

Pinned Solution

Regenerate the password from your service settings > database > config

This should update all variables that reference the database url/password automatically. Make sure to redeploy the services that connect to your database after.

Attachments

2 Replies

Railway
BOT

15 days ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open Railway 15 days ago


Regenerate the password from your service settings > database > config

This should update all variables that reference the database url/password automatically. Make sure to redeploy the services that connect to your database after.

Attachments


darseen

Regenerate the password from your **service settings > database > config** ![](https://station-server.railway.com/attachments/att_01kr1td75jfeya131y12ccvdtm) This should update all variables that reference the database url/password automatically. Make sure to redeploy the services that connect to your database after.

joaovcaldeira
PROOP

15 days ago

Hey darseen, thanks a lot for pointing this out! I didn't know about this Database > Config > Regenerate option. For future reference of anyone hitting this thread:

I ended up resolving it before seeing your reply via SSH:

1. railway ssh --service Postgres

2. psql -h /run/postgresql -U postgres -d railway (Unix socket, no password pg_hba.conf has local trust)

3. ALTER USER postgres WITH PASSWORD 'new_password';

4. Updated POSTGRES_PASSWORD in Variables

5. Manual redeploy of dependent services

Worked but your method is way cleaner. Wish I'd seen the Regenerate button under Database > Config - much less hassle than the SSH route.

Thanks again!


Status changed to Solved Railway 15 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...