Service in one project somehow accesses a variable from other project
I have multiple projects running the same application with different configurations. Adding a new project with a new service resulted in an error because it gets variable value from other project (not the one configured in it's
Variables
). Tried removing service and creating it from scratch but it still reads value from other project. I don't know how these containers are isolated for one account but it doesn't sound like a thing that should ever happen.67 Replies
Project ID:
341c4d50-dd4f-41f9-b214-52935e8a0eaa
341c4d50-dd4f-41f9-b214-52935e8a0eaa
I've never seen this before, are you sure you aren't hard coding the value?
I've just deployed 3 apps one after another. And having a problem only with the last one. Tried searching in project the value in case I did failed and wrote it somуwhere but no.
I understand that it's a very strange thing and i'm almost sure it's not possible with containers to share that but I can't see where he gets that otherwise.
What can I provide for you to check it or how could i misconfigure that badly 😄
so 3 services all with a different variable value, but what is the problematic variable
IMAGE_CLOUD_PREFIX
it's used in all 4 projects
3 works fine, last project uses the value from the one that I deplyed second
and then you are grabbing that with whatever function gets variables from the environment?
yes, I've got a standard Spring Kotlin App
as a sanity check, are you logging the variable on each service?
yes, that'show I see that it's wrong, the one printed in new service is not the one from
Variables
Is this in Shared Variables?
I only use postresql connection vars from shared
do you mean from reference variables?
Oh, maybe, the ones provided by PostgreSQL Service
I don't have any shared vars configured in projects
mind showing me a screenshot of the service variables of the 4th service
It's from service panel, part of URL
full screenshot please, but definitely keep all the values hidden
It's from log, part of the URL that should have been the same
With a service name?
just the contents of the variables tab
I'm sure Angelo has gone off to look into this under the hood, or at least he will when he has the time
with that said, I'm pretty sure this isn't your fault, so let's wait to hear back from Angelo
Ok, thank you.
it's like he read my mind, he came in right when I was about to tag him
but yeah, sorry for the inconvenience
Can you link me to the service?
Well, things happen.
What do you mean by that? 😄
just drop the link of the service within the project
like the url
yes, perf
looking
whats the other project?
can you link to that as well?
Railway
Railway
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
This value I see in logs of previously linked service
Did you run
Railway Up
where the service link was changed from the CLI?yes, I did
railway link
switched the service and did up
switched the projectI think we found our bug
Can you do me a favor
Sure
can you add and remove the var in the service you want to have the correct val and
up
for me?
my guess here is that the CLI read the wrong service to bin pack vars forI actually did that as a last resort 😄 Removed that service and did link and up again.
(also you should be using environments, not multiple projects if its the same bot)
same issue?
you could also be upping on the wrong service
Yes, went for ticket after that
gotcha
this is a head scrachter
CLI version, OS?
railway --version
railwayapp 3.3.1
I can pick this up when I wake up, its 3 am my time atm
Windows 11
cool
classic...
WSL?
I see correct project highlighted when i do
railway list
No😐
well- I will try to repro
Doing all from terminal in IDEA while working with a project
okok
How critical is this?
Not really, it can wait a couple of days easy
It wont be that, but wanna know if I can head to bed for now
I will tackle this first thing
Sure, ping me if you'll need anything
Strange thing is that it's not all environment vars that it read wrong.
I will also try to repro this, so this is 4 services in the same project, that are in the same environment?
It's 4 projects, 2 services in each (DB + App)
Only prod environment in each project
show me a screenshot of your dashboard
gotcha
Yeah, and because DB is created and bot is answering - at least 2 variables were read correctly
super odd, but Angelo is on the case
working on blog announcements
Does that mean I should move to fly? 😄
I'm joking
lol
in meetings, will get to this after that...
sorry about that
just extremely busy day
Any news on my case? Should I try something?
I forgot to add to my queue
Flagging this thread. A team member will be with you shortly.
Morning folks. I did some local testing and ended up trying to deploy from Gitlab. And the result is the same.
Recreating service and project didn't help.
I think I found it
Ok. Case solved. As all of us hoped the problem was in an environment variable but not the one I thought and in an unexpected place. I was provided with cloud link that consists of multiple parts and one of them was misconfigured (the link was manually crafted while I thought it was copy/pasted from admin panel). I went through the code and env variables and only splitting them part by part revealed the problem. I thought that code was getting to a place where the var that I blamed at first was used but I was wrong and we never got to it.