R
Railway•2mo ago
cerwind

Staging / Production Confusion

Hi, I've tried creating a new staging environment but it doesn't seem to have worked correctly. I have a pretty simple set up with a Server connected to a Redis database but it seems after creating the environment my Production Server is now looking at my Staging Redis which is causing serious problems. How do I delete my staging environment because it's got a bit complicated what's pointing to what and while the UI is awesome in terms of observability usually, I can't understand what's going on in this scenario. Project ID: c61c1785-a8d8-43d0-9d8b-6bd1f69aa3bf
7 Replies
Percy
Percy•2mo ago
Project ID: c61c1785-a8d8-43d0-9d8b-6bd1f69aa3bf
cerwind
cerwind•2mo ago
Ok I think I've fixed this, a couple of things: - I think when creating a staging environment the redis service was duplicated exactly causing the confusion, I would've expected the redis database to have created a "staging" version. I've resolve this by just creating a brand new redis database in my production environment and redefining the connection variables - There was no way to delete the Redis Database (it was disabled for no clear reason - a handy info icon would help with this) - I now have a zombie Redis Database not in use in my project that I can't delete - There's no clear way to remove an environment to start over
Brody
Brody•2mo ago
Please note that even if you have "can edit" permissions you can not do destructive actions, that is something the project owner would need to do, if you both need to do destructive actions that would be a use case for a team workspace.
the environment my Production Server is now looking at my Staging Redis which is causing serious problems.
are you able to share how you came to this conclusion? as im not seeing any evideance of this from the UI alone.
cerwind
cerwind•2mo ago
Sure, I created a Production environment with a Server + Redis + Postgres, I had it all connected and running smoothly although I would note in the UI I had arrows pointing to between the Postgres and Server but not between the Redis and Server (it was just connected through custom environment variables - I used REDIS_URL instead of the default REDISURL so wondering if that's a clue 🤷). I came to this conclusion because when creating a staging environment the postgres service replicated fine and created a new database connected with the servers but the redis didn't and I'm wondering if it doesn't have the UI arrows connecting between the services then it doesn't know they should be connected despite the environment variables being set. I could be wrong but that was my gut feeling!
Brody
Brody•2mo ago
perhaps you did not use a reference variable? arrows are not drawn unless you do so, it's also very bad practice to not use reference variables, you never want to be hardcoding anything if possible. https://docs.railway.app/guides/variables#referencing-another-services-variable
cerwind
cerwind•2mo ago
Yes I think this was likely the case, to clarify when I set it up a while ago I remember hard-coding the variables because I wanted REDIS_URL instead of the default REDISURL and wasn't super clear I could change the variable name. Appreciate you sharing the post and in future will avoid any hard-coding of variables pointing to different Railway services!
Brody
Brody•2mo ago
sounds good!
Want results from more Discord servers?
Add your server