Railway environment variables not being injected into Node.js process
oluwa-kemii
FREEOP

11 days ago

We have a Node.js/Express app on Railway. Most environment variables work fine but specific ones are being silently dropped and never appear in process.env inside the running app.

What works:

Variables that were set when the service was first created — all accessible in process.env correctly.

What doesn't work:

Variables added later — all show as undefined in process.env despite being visible in Railway dashboard. Even a simple variable like TEST_VAR=hello added later shows as undefined.

Key observations:

Working variables = added at service creation

Non-working variables = added after service creation

Confirmed via HTTP endpoint returning Object.keys(process.env) — missing variables are simply not in the list

Forced redeployments don't help

Raw editor shows the variables correctly

No special characters involved in the simple test variable

Question:

Is there a known Railway bug where variables added after initial service creation are not injected into the running process? Is the fix to delete and recreate the service entirely?

0 Replies

Welcome!

Sign in to your Railway account to join the conversation.

Loading...