Custom service variables saved in UI are missing from process.env at runtime
joshkanik
FREEOP

a month ago

Railway support report — custom variables not reaching runtime env

Identifiers

  • Project: discerning-liberation (c0cc29e0-ec3b-494a-b691-687e3c7e9b9c)
  • Service: healthe-atlas (f1494336-4558-4da5-b683-a1cc3c511f17)
  • Environment: production (9ab6b98e-91be-4f71-8e15-cee197f8023d)
  • Most recent affected deployment: e4b394e6-970b-4146-a78a-e2dc9cbd5924

Issue

Two custom variables saved on this service's Variables page under the

production environment — VISION_PROVIDER=two_stage and

VISION_PROVIDER_MODE=two_stage — are not present in process.env at

runtime, on a deployment confirmed fresh.

Evidence

  • Both variables are visible in the dashboard's Variables tab for this

    exact service/environment (confirmed via UI, including after a hard

    page refresh — they persist as saved, ruling out a client-side/unsaved

    UI state).

  • ANTHROPIC_API_KEY, set on the same Variables page around the same

    time, IS present in process.env and is actively used successfully by

    the running app (real outbound API calls to Anthropic succeed).

  • All Railway-injected system variables (RAILWAY_ENVIRONMENT_NAME,

    RAILWAY_SERVICE_NAME, RAILWAY_SERVICE_ID, RAILWAY_ENVIRONMENT_ID,

    RAILWAY_PROJECT_ID) are present and correctly identify this exact

    service/environment.

  • A temporary diagnostic endpoint (GET /diagnostics/provider) added to

    the app reports a processStartedAt timestamp captured at module load.

    On the deployment above, this returned 2026-08-23T02:33:50.666Z,

    checked ~18 seconds later — proving the responding container is freshly

    booted from the latest deploy, not a stale/lingering one.

  • The container's own RAILWAY_DEPLOYMENT_ID env value

    (e4b394e6-970b-4146-a78a-e2dc9cbd5924 on this check;

    a5c1d8ce-54f7-4c7c-b39f-3b0700e5949d on an earlier check) does not

    match any deployment ID visible in this service's Deploy

    UI — flagging this separately since it was initially misread as

    "stale deployment still serving traffic," which the processStartedAt

    check above then ruled out.

  • Confirmed across five separate fresh deploys (three redeploys, one

    var-triggered auto-redeploy, one delete-and-recreate-from-scratch of

    the variable), all producing the same result: the two cu

    are absent at runtime despite being saved in the dashboard.

Ask

Why would two variables set on a service's Variables page (production

environment) not appear in process.env for that service's own fresh

deployments, while another variable set the same way on th

does?

Solved

2 Replies

Railway
BOT

a month ago

The committed variable set for this service in the production environment contains only ANTHROPIC_API_KEY, and there are no staged (uncommitted) changes pending. VISION_PROVIDER and VISION_PROVIDER_MODE do not appear in the committed config at all, which is why they are absent from process.env. If the variables appear in the dashboard's Variables tab but were never applied via the deploy bar that appears after adding them, they would remain unapplied, though our system also shows zero staged changes, so it is possible they were set on a different service or at the shared-variable level rather than directly on this service in this environment. Worth confirming you are viewing the variables for the correct service and environment combination, and that after adding them you clicked the deploy bar to apply the change.


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


joshkanik
FREEOP

a month ago

Resolved. We discovered that the environment variables had inadvertently been added to a duplicate Railway project rather than the production project we intended to use. After adding VISION_PROVIDER and VISION_PROVIDER_MODE to the correct production service/environment and redeploying, both variables are now present at runtime and the two-stage provider is functioning correctly.


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


Status changed to Solved Railway • about 1 month ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...