Service URL ENV variable is empty
The variable for a static URL of one of the services is empty (despite having a domain associated with it) - other services (and env variables) who are dependent on it are failing.
can you send a browser screenshot of your project
what kind of screenshot?
full screenshot of your browser window with the railway project in question open
and what service is trying to access RAILWAY_SERVICE_MPC_API_URL
docs mention the static url env vars to be
while the env variable is actually
while the env variable is actually
i know, i dont understand that either
RAILWAY_SERVICE_MPC_API_URLwould be correct
mpcservice is trying to get the
it is correct -it's just an empty string
do note that it worked - but since yesterday it's reporting as empty string
okay now what exactly is the mpc service?
mpc service is a web client service (nextjs app)
can you show me how you are accessing the variable in code
note that I do have the
RAILWAY_SERVICE_MPC_API_URLvariable provided - it's just that it's empty string
is that an .env file?
that's from the app
it's a dump of the env vars
while running on railway?
the project doesn't have .env vars in the git repo
while running on railway?yes
ssr next app?
dont variables have to be prefixed with something?
mpc-apiis just an express app
it also has these variables
also empty strings
NEXT_PUBLIC_if you want them on public
any env variables that are not prefixed are available on the server
im sorry i cant reproduce this
you must be overriding them or something
Overriding them? nope...
they're just empty string vars
i think it's a bud on railway's side...
im sorry i cant reproduce thisYes, because it should work - but since yesterday it just doesn't
deploy an absolute bare minimun nodejs service, no framework, nothing, just index.js and package.json and inside that index.js file simply put
how do I see the console log after deploying?
vars are empty but that's because the PR env domains are empty - so it makes sense
added domains for the services
and rebuilding the test
now with domains set, RAILWAY env vars are still empty:
remind me, is this the first time you mentioned this being a pr environment?
it happens on non-pr envs
now after rebuilding with domains set the vars aren't empty
show me the code behind these printouts please?
scripts.start/build are both set to
can you share the repo for that?
it's a simple nodejs with package.json and index.js as requested
you mean to make a public repo with that code?
id like to see the exact code that made this output
this helps? xD
the vars arent empty?
after rebuilding - no, aren't empty
but on production env's they are empty
despite having domains set
okay will flag team
sorry it took so long to get to this point, i just had to be sure it was on railway's end
all good! looking forward for their reply
Message Not Public
Sign In & Join Server To View
Hey! Sorry for the delay here. Can you try re-deploying the env-vars test service? I wanna see what happens under the hood
deployment id: a7a2cd62-8cbe-4707-a5a9-acda79551715
interesting, could you try re-creating a new service for this? I'm wondering if the env vars we're picking up is stuck in a previous state prior to service creation
e.g. remove the service and add it from scratch?
you can see that for the production env all the
RAILWAY_SERVICE_MPC_*_URLare empty strings
staging as well
if it's of any help - it seems that the auto-generated domains are correctly populated
in the env vars, that is
then what isn't being populated
all the other services
redeployed - env vars for service urls are empty 😦
you can see the services (on the left) do have URLs, but the env vars echoed in app are empty...
I can confirm. Going to raise this up, thanks!