Env variables are not updating
alkor-one
FREEOP

9 months ago

I update some of my env variables on my wonderflow.ca project, but it still uses the old ones, I tried to delete and added them again, and also used the raw editor, but it uses the old ones.

the repo is https://github.com/jeromeOlivier/wonderflow/

$10 Bounty

10 Replies

lofimit
HOBBY

9 months ago

The answer given by @teereckzi is likely AI, hard to read, I'll be giving my own answer.

Alright so basically this usually happens on Railway when you change env vars but don’t restart the service, the app keeps running with the old ones. You gotta either hit the "Restart" button in the service settings or just redeploy it manually as envs only load at startup.

Also, if you're using something like Next.js and the env vars are used in the build (like in next.config.js or server-side code), then you need to redeploy so it rebuilds with the new vars, not just restart.

Basically: restart or redeploy after changing envs or they won't update.


danny
PRO

9 months ago

Also make sure you do not have a .env file on git, as it might use that instead of the railway variables. Run git rm --cached .env , add .env to the .gitignore file if it doesn't already exist and commit it.


danny

Also make sure you do not have a .env file on git, as it might use that instead of the railway variables. Run git rm --cached .env , add .env to the .gitignore file if it doesn't already exist and commit it.

notajumma
PRO

9 months ago

how to open terminal on railway project? I'm new to railway and still use free trial


notajumma

how to open terminal on railway project? I'm new to railway and still use free trial

lofimit
HOBBY

9 months ago

Hey, alright so first you Download and Setup Railway's CLI (docs.railway.com/guides/cli)
After that, you go to your project, right click on instance and select "Copy SSH Command", and paste it into the Railway's CLI.


lofimit

Hey, alright so first you Download and Setup Railway's CLI (docs.railway.com/guides/cli)After that, you go to your project, right click on instance and select "Copy SSH Command", and paste it into the Railway's CLI.

notajumma
PRO

9 months ago

Thanks so much, I want ask if HOBBY plan can support 500 user send form at one time? or you can hit me on discord notizzy99 if you don't mind


notajumma

Thanks so much, I want ask if HOBBY plan can support 500 user send form at one time? or you can hit me on discord notizzy99 if you don't mind

lofimit
HOBBY

9 months ago

Well, it depends on what kind of form, what kind of data is being received and sent, but if it's not a lot of data, I would think maybe yes.


lofimit

The answer given by @teereckzi is likely AI, hard to read, I'll be giving my own answer.Alright so basically this usually happens on Railway when you change env vars but don’t restart the service, the app keeps running with the old ones. You gotta either hit the "Restart" button in the service settings or just redeploy it manually as envs only load at startup.Also, if you're using something like Next.js and the env vars are used in the build (like in next.config.js or server-side code), then you need to redeploy so it rebuilds with the new vars, not just restart.Basically: restart or redeploy after changing envs or they won't update.

alkor-one
FREEOP

9 months ago

Thanks, I tried to redeploy and restart, and all the same, it keeps using the old values.


alkor-one

Thanks, I tried to redeploy and restart, and all the same, it keeps using the old values.

lofimit
HOBBY

9 months ago

Hmm... could you try to comment the require('dotenv').config(); line in app.js ? Maybe you could have an old .env in the project or something, this is really weird.
Did you rebuild the app?


danny
PRO

9 months ago

And also how are you checking the env is not updating?


lofimit

Hmm... could you try to comment the require('dotenv').config(); line in app.js ? Maybe you could have an old .env in the project or something, this is really weird.Did you rebuild the app?

alkor-one
FREEOP

9 months ago

Thanks, I found the right button, if I redeployed or restarted from the ... menu or github, it didn't help, but when clicking on the "Deploy" above the project field it worked.


Status changed to Open chandrika 9 months ago


Loading...