Variable set to reference variable value breaks on deploy
Anonymous
HOBBYOP

3 months ago

Unsure how to best describe this but it does seem to be a bug in the Railyway platform and not my application. I have two services, a "frontend" and an "api" service. I need the frontend to point to the api service URL. I inject it using the reference variable from the api service. This works great. However, if I deploy, it breaks, and the URL stops resolving properly. I get 504s from the api call and it looks like DNS is resolving to the wrong IP. When I ask the agent for help, it insists that I need to set the injected variable to... the very same reference variable value that I'm already using!

Screen shot below shows what the UI displays. It appears to have no difference from the current configuration. If I apply this by clicking "Deploy Changes", the frontend redeploys and the 504 issue goes away.

Screenshot 2026-07-05 at 9.09.05 PM.png

Attachments

$10 Bounty

4 Replies

Railway
BOT

3 months ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway • 3 months ago


3 months ago

probably difficult to check now, but did you have any white space with the original var reference, such as a trailing space? If so, when you app tried to reference your api, it will have looked something like this “example.com /users”


hazzo01

probably difficult to check now, but did you have any white space with the original var reference, such as a trailing space? If so, when you app tried to reference your api, it will have looked something like this “example.com /users”

Anonymous
HOBBYOP

3 months ago

I don't think that is the case. I have done this on several different deploys now. The agent suggests this reference var as the value, I apply the change, it fixes the problem. Then I deploy another code change again, I see the 504s again, and when I ask the agent to fix it, it suggests the exact same change, as in the screenshot.


3 months ago

Are you able to ask the agent where the differences are with the "current" value as in the incorrect one after a re-deploy. Do you have any railway.toml or railway.json files that you are using for config? Could they be setting a different value (visually the same, but a different ASCII character maybe)?


hazzo01

Are you able to ask the agent where the differences are with the "current" value as in the incorrect one after a re-deploy. Do you have any railway.toml or railway.json files that you are using for config? Could they be setting a different value (visually the same, but a different ASCII character maybe)?

Anonymous
HOBBYOP

3 months ago

I'm not using a railway.toml/json, I'm just setting values in the UI. I suspect this is a deploy order problem. I notice when I merge a change for deploy, the frontend and api services deploy at the same time. I'm guessing that the reference variable in the frontend needs to be re-evaluated after the api is redeployed so it will target the right instance. The Railway dashboard UI shows that the services are connected properly though. I will attach screen shots of the dashboard and how I'm setting the variables.

Screenshot 2026-07-11 at 9.16.31 AM.png

Screenshot 2026-07-11 at 9.16.42 AM.png

Screenshot 2026-07-11 at 9.16.58 AM.png


Welcome!

Sign in to your Railway account to join the conversation.

Loading...