2 months ago
After an update, a service started ignoring application variables and instead retrieved them from the appsettings.json file, causing an error when trying to connect to YOUR_DOMAIN_NAME. I couldn't find any documentation that helps resolve this via the dashboard or CLI.
I'll attach images below.
Pinned Solution
2 months ago
Hello , your appsettings.json still has the placeholder values like YOUR_DATABASE and YOUR_POSTGRES_HOST and your railway env vars are not overriding them. for asp.net core to override appsettings.json with env vars, the variable name has to exactly match the config key in appsettings.json using double underscore __ as separator. so check what keys are inside your appsettings.json and rename your railway variables to match them exactly
Hope this help you :)
2 Replies
Status changed to Awaiting Railway Response Railway • 2 months ago
2 months ago
Image with values from "railway variable" x "service log"!
Attachments
Status changed to Open Railway • 2 months ago
2 months ago
Hello , your appsettings.json still has the placeholder values like YOUR_DATABASE and YOUR_POSTGRES_HOST and your railway env vars are not overriding them. for asp.net core to override appsettings.json with env vars, the variable name has to exactly match the config key in appsettings.json using double underscore __ as separator. so check what keys are inside your appsettings.json and rename your railway variables to match them exactly
Hope this help you :)
Status changed to Solved brody • about 2 months ago
