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
Percy
Percy2y ago
Project ID: 341c4d50-dd4f-41f9-b214-52935e8a0eaa
DmitriyR
DmitriyROP2y ago
341c4d50-dd4f-41f9-b214-52935e8a0eaa
Brody
Brody2y ago
I've never seen this before, are you sure you aren't hard coding the value?
DmitriyR
DmitriyROP2y ago
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 😄
Brody
Brody2y ago
so 3 services all with a different variable value, but what is the problematic variable
DmitriyR
DmitriyROP2y ago
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
Brody
Brody2y ago
and then you are grabbing that with whatever function gets variables from the environment?
DmitriyR
DmitriyROP2y ago
yes, I've got a standard Spring Kotlin App
Brody
Brody2y ago
as a sanity check, are you logging the variable on each service?
DmitriyR
DmitriyROP2y ago
yes, that'show I see that it's wrong, the one printed in new service is not the one from Variables
angelo
angelo2y ago
Is this in Shared Variables?
DmitriyR
DmitriyROP2y ago
I only use postresql connection vars from shared
Brody
Brody2y ago
do you mean from reference variables?
DmitriyR
DmitriyROP2y ago
Oh, maybe, the ones provided by PostgreSQL Service I don't have any shared vars configured in projects
Brody
Brody2y ago
mind showing me a screenshot of the service variables of the 4th service
DmitriyR
DmitriyROP2y ago
It's from service panel, part of URL
Brody
Brody2y ago
full screenshot please, but definitely keep all the values hidden
DmitriyR
DmitriyROP2y ago
It's from log, part of the URL that should have been the same
DmitriyR
DmitriyROP2y ago
With a service name?
Brody
Brody2y ago
just the contents of the variables tab
DmitriyR
DmitriyROP2y ago
Brody
Brody2y ago
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
DmitriyR
DmitriyROP2y ago
Ok, thank you.
Brody
Brody2y ago
it's like he read my mind, he came in right when I was about to tag him but yeah, sorry for the inconvenience
angelo
angelo2y ago
Can you link me to the service?
DmitriyR
DmitriyROP2y ago
Well, things happen. What do you mean by that? 😄
angelo
angelo2y ago
just drop the link of the service within the project like the url
angelo
angelo2y ago
yes, perf looking whats the other project? can you link to that as well?
DmitriyR
DmitriyROP2y ago
Railway
Railway
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
DmitriyR
DmitriyROP2y ago
This value I see in logs of previously linked service
angelo
angelo2y ago
Did you run Railway Up where the service link was changed from the CLI?
DmitriyR
DmitriyROP2y ago
yes, I did railway link switched the service and did up switched the project
angelo
angelo2y ago
I think we found our bug Can you do me a favor
DmitriyR
DmitriyROP2y ago
Sure
angelo
angelo2y ago
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 for
DmitriyR
DmitriyROP2y ago
I actually did that as a last resort 😄 Removed that service and did link and up again.
angelo
angelo2y ago
(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
DmitriyR
DmitriyROP2y ago
Yes, went for ticket after that
angelo
angelo2y ago
gotcha this is a head scrachter CLI version, OS? railway --version
DmitriyR
DmitriyROP2y ago
railwayapp 3.3.1
angelo
angelo2y ago
I can pick this up when I wake up, its 3 am my time atm
DmitriyR
DmitriyROP2y ago
Windows 11
angelo
angelo2y ago
cool classic... WSL?
DmitriyR
DmitriyROP2y ago
I see correct project highlighted when i do railway list No
angelo
angelo2y ago
😐 well- I will try to repro
DmitriyR
DmitriyROP2y ago
Doing all from terminal in IDEA while working with a project
angelo
angelo2y ago
okok How critical is this?
DmitriyR
DmitriyROP2y ago
Not really, it can wait a couple of days easy
angelo
angelo2y ago
It wont be that, but wanna know if I can head to bed for now I will tackle this first thing
DmitriyR
DmitriyROP2y ago
Sure, ping me if you'll need anything Strange thing is that it's not all environment vars that it read wrong.
Brody
Brody2y ago
I will also try to repro this, so this is 4 services in the same project, that are in the same environment?
DmitriyR
DmitriyROP2y ago
It's 4 projects, 2 services in each (DB + App) Only prod environment in each project
Brody
Brody2y ago
show me a screenshot of your dashboard
DmitriyR
DmitriyROP2y ago
Brody
Brody2y ago
gotcha
DmitriyR
DmitriyROP2y ago
Yeah, and because DB is created and bot is answering - at least 2 variables were read correctly
Brody
Brody2y ago
super odd, but Angelo is on the case
angelo
angelo2y ago
working on blog announcements
Brody
Brody2y ago
fly bought railway for 6 million joke
DmitriyR
DmitriyROP2y ago
Does that mean I should move to fly? 😄
Brody
Brody2y ago
I'm joking
angelo
angelo2y ago
lol in meetings, will get to this after that... sorry about that just extremely busy day
DmitriyR
DmitriyROP2y ago
Any news on my case? Should I try something?
angelo
angelo2y ago
I forgot to add to my queue
Percy
Percy2y ago
Flagging this thread. A team member will be with you shortly.
DmitriyR
DmitriyROP2y ago
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.
Want results from more Discord servers?
Add your server