R
Railwayā€¢9mo ago
alexbalandi

Forking environment with PostgressSQL template on hobby plan leading to all sorts of issues

At first the container just didn't deploy, but then when i tried manually removing/creating it, my "production" environment got messed up and container there got disabled. Steps to replicate would be creating env with postgress template, deployin it and then forking it
74 Replies
Percy
Percyā€¢9mo ago
Project ID: N/A
alexbalandi
alexbalandiā€¢9mo ago
N/A
Duchess
Duchessā€¢9mo ago
Thread has been flagged to Railway team by @Brody.
Brody
Brodyā€¢9mo ago
project id is applicable, please provide it
jr
jrā€¢9mo ago
Thank you for this flag. We are actively working on it
alexbalandi
alexbalandiā€¢9mo ago
f96e9e13-9c55-4a12-ba6e-9962cbb6d4cb Ye, really messed things up for me. Just after I told a reddit user a certain community-driven db is up again šŸ˜… right now trying to spin again from template and it for some reason creates a plugin (??) instance on deploy and throws error. Sorry for erratic report, i'm kinda trying to patch it up asap
alexbalandi
alexbalandiā€¢9mo ago
this is how it looks after me deleting stuff and trying to spin up again
No description
alexbalandi
alexbalandiā€¢9mo ago
But the weirdest thing were "Postgress" plugin-like windows appearing in original env when I tried to deploy them on forked. And yes, I guess one of my mistakes was that after I deleted postgress in forked env (because it refused to deploy), I tried to spin up a postgress plugin rather than template in forked env
alexbalandi
alexbalandiā€¢9mo ago
yup, no deploy (no secrets exposed here, so whatevs)
No description
jr
jrā€¢9mo ago
This is not your fault at all. It is on us and will be fixed soon. There are no plugins involved, just a bit of a confusing situation I'll report back when everything is fixed šŸ™‚
alexbalandi
alexbalandiā€¢9mo ago
Okay, I'll stop trying to panic recreate databases in different ways and wait for feedback from you šŸ˜…
jr
jrā€¢9mo ago
This should be all fixed now
alexbalandi
alexbalandiā€¢9mo ago
Ty, I'll try thiings out. Is forking also safe now?
jr
jrā€¢9mo ago
yes all safe. Still some rough edges in terms of UX that we are going to work on. But your databases will get created
alexbalandi
alexbalandiā€¢9mo ago
That's great, thank you! oh, postgress template got removed?
alexbalandi
alexbalandiā€¢9mo ago
can't see it in New -> Templates, but k
Brody
Brodyā€¢9mo ago
refresh?
No description
alexbalandi
alexbalandiā€¢9mo ago
hmm, will try to clear cache i guess CeciliaHmm
alexbalandi
alexbalandiā€¢9mo ago
No description
Brody
Brodyā€¢9mo ago
odd @jr seems all is not done šŸ¤£
jr
jrā€¢9mo ago
That is intended. Postgres was basically deployable through 2 menus. New service -> database and New service -> templates. To keep backwards compatbility with plugins you can just use the database . Basically just add it to your project in the same way that you would before Or just press "New" and search "Postgres"
jr
jrā€¢9mo ago
No description
Brody
Brodyā€¢9mo ago
why can i see it listed in the templates section? old cache?
alexbalandi
alexbalandiā€¢9mo ago
No description
alexbalandi
alexbalandiā€¢9mo ago
The template also had a bit different setup, with persistent storage included I understand that it was essentially setup with dockerfile and mounted dir, etc, etc, but still was convenient
jr
jrā€¢9mo ago
They are both the same
alexbalandi
alexbalandiā€¢9mo ago
Anyway, right now the deployment of plugin fails.
jr
jrā€¢9mo ago
yup taking a look are you creating the DB in the forked environment?
alexbalandi
alexbalandiā€¢9mo ago
nope, in the original rn it has a weird set of vars tbh
alexbalandi
alexbalandiā€¢9mo ago
No description
jr
jrā€¢9mo ago
project link?
alexbalandi
alexbalandiā€¢9mo ago
f96e9e13-9c55-4a12-ba6e-9962cbb6d4cb the id, right? like I HAD redis set up, but its no longer there
jr
jrā€¢9mo ago
Yup that is separate
alexbalandi
alexbalandiā€¢9mo ago
Tried to add another one with same result
jr
jrā€¢9mo ago
Yup your project is in a weird state. Looking
alexbalandi
alexbalandiā€¢9mo ago
I do still have redis in forked env, actually. Originally I created redis as plugin and Postgres from template
jr
jrā€¢9mo ago
yup it is all good. Are you part of priority boarding?
alexbalandi
alexbalandiā€¢9mo ago
Yup, I am
jr
jrā€¢9mo ago
Sorry about the delay. Fixing a few issues here. Will report back when it is all good you should be good to go if you start from a single environment
alexbalandi
alexbalandiā€¢9mo ago
Okay, thank you! It's night for me, so no worries - I'll get back to this in the morning šŸ¤— Starting from single environment - you mean just no forking, right? Or no multiple envs?
jr
jrā€¢9mo ago
just no forking
alexbalandi
alexbalandiā€¢9mo ago
No problem, will keep it in mind, ty. so, main env works again now, thank you very much!
alexbalandi
alexbalandiā€¢9mo ago
When I created a new "dev" env though, I got super weird result:
No description
alexbalandi
alexbalandiā€¢9mo ago
the redis to the left is something long ago deleted, the rest is what is in production env. So i deleted "dev" again, tried to create "development" (all without forking) and it failed with error šŸ˜… Setting -> Enironments -> New Environment -> Create is what I used.
alexbalandi
alexbalandiā€¢9mo ago
this is newly created env
No description
alexbalandi
alexbalandiā€¢9mo ago
No description
alexbalandi
alexbalandiā€¢9mo ago
this is production one not urgent for me, just giving you more info ty again for fixing it for the main env! i'm leaving the test_creating_new_env be , just in case it helps you with anything, now sleep time šŸ˜…
jr
jrā€¢9mo ago
thanks for all the info!
alexbalandi
alexbalandiā€¢9mo ago
deleting things in that new env deleted them in production env too šŸ™ƒ oh, maybe that's actually intended šŸ˜…
Brody
Brodyā€¢9mo ago
what flow did you use to delete the service?
alexbalandi
alexbalandiā€¢9mo ago
Im dum in the morning right click -> delete service -> type name to confirm But now that I think about it, it kinda makes sense, to a degree, since the point of env should be same services but different env vars. But im not sure
Brody
Brodyā€¢9mo ago
right click -> delete service does the same thing as open service -> settings -> danger -> Delete Service from All Environments except the modal when you right click delete doesnt give you two warnings about how it will delete the service from all environments the action is intentional, its just missing the same warnings as the delete service from its settings has
alexbalandi
alexbalandiā€¢9mo ago
oh, I see. Is it possible to delete from single env? or not intended for enivronments to work that way?
Brody
Brodyā€¢9mo ago
you want forked environments for that, but thats broken still i assume @Angelo @Melissa another right click delete victim šŸ˜¦
alexbalandi
alexbalandiā€¢9mo ago
I edned up recreating it in new project 2c9f2913-06da-4053-a6c3-14bd48bb2682, works good so far after manually setting env vars. My only problem is that while redis spins up in development env, I can't quickly observe data tab in ui in it šŸ¤” might've messed sth with env vars, I guess, but i certainly can curl it from outside
No description
Brody
Brodyā€¢9mo ago
did you change any of the variables it came with?
alexbalandi
alexbalandiā€¢9mo ago
well, since i copied from production initially, ye šŸ˜… my dev env looks like this:
RAILWAY_RUN_AS_ROOT=true
RAILWAY_RUN_UID=0
REDISUSER=<actual user here>
REDIS_PASSWORD=<actual password hehre>
REDISHOST=${{RAILWAY_TCP_PROXY_DOMAIN}}
REDISPASSWORD=${{REDIS_PASSWORD}}
REDISPORT=${{RAILWAY_TCP_PROXY_PORT}}
REDIS_PRIVATE_URL=redis://<actual user here>:${{REDIS_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:6379
REDIS_URL=redis://<actual user here>:${{REDIS_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}
RAILWAY_RUN_AS_ROOT=true
RAILWAY_RUN_UID=0
REDISUSER=<actual user here>
REDIS_PASSWORD=<actual password hehre>
REDISHOST=${{RAILWAY_TCP_PROXY_DOMAIN}}
REDISPASSWORD=${{REDIS_PASSWORD}}
REDISPORT=${{RAILWAY_TCP_PROXY_PORT}}
REDIS_PRIVATE_URL=redis://<actual user here>:${{REDIS_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:6379
REDIS_URL=redis://<actual user here>:${{REDIS_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}
So i did change <actual password here> and <actual user here> compared to prod i tried changing the port too, but then switched it back - i assume its okay to keep it the same, since its different ip/domain on internal network
Brody
Brodyā€¢9mo ago
nino
alexbalandi
alexbalandiā€¢9mo ago
oohp, didn't edit out NinoFace
Brody
Brodyā€¢9mo ago
I don't even think you can specify a username other than default
alexbalandi
alexbalandiā€¢9mo ago
lemme try to connect with redis-cli
Brody
Brodyā€¢9mo ago
yeah changing the username in the variables doesn't do anything, it will accept any username
alexbalandi
alexbalandiā€¢9mo ago
i succesfully used AUTH with the password I manually set there so it definitely works for cli
Brody
Brodyā€¢9mo ago
yeah just the default deploy accepts any username
alexbalandi
alexbalandiā€¢9mo ago
True. Anyway, I can connect with redis-cli, but the ui doesn't display anything. then again, right now it's empty, hmm. I'll try ppulating and see
Brody
Brodyā€¢9mo ago
maybe the UI doesn't like the format of the password you set?
alexbalandi
alexbalandiā€¢9mo ago
true, my django project doesn't seem to like it too šŸ˜… eugh, lemme just reuse the one from prod no harm i guess and see how it goes ye, true will need to look up docs possibly it's stricter format than i expected now it displays properly
Brody
Brodyā€¢9mo ago
if that works, for future reference generate a password from a lowercase alphabet, uppercase alphabet, and 0-9 digits, no specials
alexbalandi
alexbalandiā€¢9mo ago
oh, I see the "!" got me. Was totally ok with cli though šŸ˜…
Brody
Brodyā€¢9mo ago
jr has told me they plan to add back an easy way to regen the password for databases, since currently (as you know) you have to manually make a password yourself
alexbalandi
alexbalandiā€¢9mo ago
ye, that would be good šŸ‘
Brody
Brodyā€¢9mo ago
bumped that to the team just now too
jr
jrā€¢9mo ago
This is good feedback, thank you