Service Variables not injected
albapg1991
FREEOP

a month ago

My service isn't receiving Service Variables at runtime, even though they're correctly configured in the Variables tab (AUTH_SECRET, DATABASE_URL, NEXTAUTH_URL, APP_BASE_URL).

I confirmed this with a diagnostic API route that lists all environment variable keys present in process.env at runtime: only Railway's own platform variables (RAILWAY_, NPM_, PORT, etc.) are present, 74 in total, and none of my custom Service Variables.

This happens after multiple full redeploys (fresh builds from new commits, not just restarts), and I confirmed via RAILWAY_GIT_COMMIT_SHA that the running container matches the latest deployment each time.

Is there a known fix?

Solved

1 Replies

Railway
BOT

a month ago

Your service currently has zero committed variables because the variables you added (AUTH_SECRET, APP_BASE_URL, NEXTAUTH_URL, AUTH_TRUST_HOST, and RAILPACK_INSTALL_CMD) are staged but have not been deployed yet. You should see a pending-changes banner or a Deploy button in the dashboard for this environment - clicking it will apply those variables and trigger a new deployment that includes them. RAILWAY_BETA_ENABLE_RUNTIME_V2 is not the cause here. Also note that DATABASE_URL is not among the staged variables, so you may need to add it separately before deploying.


Status changed to Awaiting User Response Railway • about 1 month ago


Status changed to Solved albapg1991 • about 1 month ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...