Environment Variables Not Loading in Railway Deployment

chris544460
TRIAL

9 months ago

Hi Railway Team,

I'm experiencing an issue with my deployed Python app where custom environment variables (like USERNAME) are not being loaded into my app during deployment. 

I’ve already:

1. Checked that the variables are correctly added in the Railway dashboard.

2. Verified that they match exactly with the names used in my code.

3. Tried to print them using os.getenv() but they return null values.

The Railway-provided variables (like RAILWAY_SERVICE_NAME) seem to be working fine, but my custom variables are not being injected.

Could you please help me resolve this issue?

Thanks in advance!

4 Replies

9 months ago

You don't have a USERNAME variable on that service?


9 months ago

You linked the wrong service, you meant to link another service in another project.

1. You have not deployed the changes.


chris544460
TRIAL

9 months ago

Hi, I meant to refer to the other service in this post.

I tried to run that service and that service does not recognize the USERNAME environment variable.


9 months ago

You have not deployed the changes, click the Deploy button.


Environment Variables Not Loading in Railway Deployment - Railway Help Station