Subject: Custom environment variables not injected into runtime container (confirmed across multiple fresh services)
justinkoehler28-svg
HOBBYOP

a day ago

Hi Railway team,

I'm experiencing a persistent issue where custom environment variables set in a service's Variables tab are never injected into the running container, despite appearing correctly in the UI with values set.

WHAT I'VE CONFIRMED:

  • Added 4 custom variables (KALSHI_API_KEY_ID, KALSHI_PEM_KEY, RISK_POOL_DOLLARS, NTFY_TOPIC_15MIN) in the Variables tab — all show correctly with values in the UI.
  • Added a debug logging block to my Python app that prints every variable via os.environ.get() at startup, plus the total count of os.environ entries.
  • The debug output consistently shows ALL custom variables as "NOT SET", and only ~39-40 total environment variables visible to the process (matching only Railway's own internal RAILWAY_* system variables — none of mine).
  • Added a brand-new test variable (TEST_VAR=hello123) that had never been used anywhere before — it also shows as NOT SET in the running process.

STEPS I'VE ALREADY TAKEN TO RULE OUT COMMON CAUSES:

  1. Verified variable names match exactly (no typos, no trailing whitespace) by viewing the Raw Editor.
  2. Deleted and re-added all variables individually via the "+ New Variable" button (not raw editor).
  3. Triggered multiple manual Redeploys after variable changes.
  4. Made small code changes and pushed to GitHub to force genuinely fresh builds (confirmed via Railway's own build logs showing fresh pip install steps).
  5. Logged out of Railway completely and back in.
  6. Deleted the service entirely and created a brand-new service connected to the same GitHub repo from scratch.
  7. Confirmed the Custom Start Command (python kalshi_15min_bot.py) matches the Procfile and is not interfering.
  8. Confirmed there is no .env file or load_dotenv() conflict overriding things — the app uses os.environ.get() directly, and there is no .env file present in the deployed repo (it's gitignored).

None of the above resolved the issue. This persists across multiple fresh services and a fresh login, which suggests an account or workspace-level issue rather than something specific to one service configuration.

Project ID: 470209cf-e64e-479e-b51b-ba5de253e9bc

Service ID: 1689b18f-c00f-474e-ab29-c7f7a4fb5cc0

GitHub repo: justinkoehler28-svg/kalshi-15min-bot

Could someone please investigate whether variable injection is failing on the platform side for this project/workspace? Happy to provide any additional logs or run any diagnostic steps you'd like.

Thank you,

Justin

Solved$10 Bounty

2 Replies

Railway
BOT

a day ago

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

Status changed to Open Railway 1 day ago


Can you go to your service's console tab and type echo $KALSHI_API_KEY_ID for example. If it returns the value of the env key. Then it's a problem in your code. This should help you in finding the root cause of this issue in your app.


justinkoehler28-svg
HOBBYOP

16 hours ago

ugh hitting depoly from inside the variables page did the trick.


Status changed to Solved justinkoehler28-svg about 16 hours ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...