Cloned Environment's Services are pointing to previous Environment despite dynamic env variables
alex-bytes
PROOP

a month ago

So I cloned an environment that uses laravel and fastapi services. Both cannot seem to connect to the postgres DB that was created in the new environment despite me using:

DB_DATABASE="railway"
DB_USERNAME="postgres"
DB_PASSWORD="${{Postgres.POSTGRES_PASSWORD}}"```

I've tried redeploying services, tweaking .env variables and hardcoding the PG Variables, to no avail. Laravel trying to migrate upon deploys fails every time: 

```[previous exception] [object] (PDOException(code: 7): SQLSTATE[08006] [7] connection to server at \"postgres.railway.internal\" (fd12:8236:f46e:1:1000:14:3780:92d0), port 5432 failed: FATAL:  password authentication failed for user \"postgres\"```

My FastAPI Service has the same issue trying to access PG.
$20 Bounty

5 Replies

alex-bytes
PROOP

a month ago

I see a bounty was created for this Ticket. But I honestly don't think anyone except for engineers at Railway can solve this.


a month ago

Hello,

Just explaining why this was bountied: railway employees generally do not help with project setup or configuration issues, among other things, so any help with that is provided by the community.


alex-bytes
PROOP

a month ago

Gotcha, that makes sense. But this is not a configuration issue or a project setup issue. It's the clone environment functionality that is somehow bugging out and not handling environment variables properly.


a month ago

With the currently provided information, this is looking more like a setup or configuration issue, but if you have clearly reproducible steps, a community member can use those to verify if it is a platform or product issue, and then a moderator can escalate it to us.


Try regenerating the password from your service settings > database > config. It should update variables referencing ${{Postgres.POSTGRES_PASSWORD}}

automatically.

Attachments


Welcome!

Sign in to your Railway account to join the conversation.

Loading...