"Database URL cannot be empty" error on CLI

Today I started getting error "Database URL cannot be empty" when running: railway run rails c
58 Replies
Percy
Percy2y ago
Project ID: 1e715dda-f769-4167-bae5-3c58d685441c
Percy
Percy2y ago
No search results found.
⚠️ experimental feature
dwaynemac
dwaynemacOP2y ago
my project ID is 1e715dda-f769-4167-bae5-3c58d685441c my instance is running ok for the webserver but i can't run console on it
Brody
Brody2y ago
what os? and have you ran both railway link and railway service inside of that project folder?
dwaynemac
dwaynemacOP2y ago
macOS railway run was working a few days ago. i did run railway service 'railway run --service web rails c' didnt work either
Brody
Brody2y ago
did any of railway login, railway link, or railway service give you any errors?
dwaynemac
dwaynemacOP2y ago
mmm, not really. i can try to logout and re-login no errors on login
Brody
Brody2y ago
not really? I think it was a yes or no question lol
dwaynemac
dwaynemacOP2y ago
aand after logout and re-login CLI still same error when running 'railway run rails c' sorry. english not my native language. NO, no errors on logout and login
Brody
Brody2y ago
okay what about the other commands I listed, any errors with them?
dwaynemac
dwaynemacOP2y ago
they all work ok but dont resolve the issue
Brody
Brody2y ago
right okay can you run railway shell and then run env lmao no
dwaynemac
dwaynemacOP2y ago
sorry, wout run retrying
Brody
Brody2y ago
railway shell hit enter env does the database url variable show up?
dwaynemac
dwaynemacOP2y ago
when running railway shell it thinks for a while and nothing happens
dwaynemac
dwaynemacOP2y ago
is railwayapp 3.0.1 the latest?
Brody
Brody2y ago
no
dwaynemac
dwaynemacOP2y ago
i'll try updating
Brody
Brody2y ago
yeah but also try listening to what I'm saying
dwaynemac
dwaynemacOP2y ago
railway shell?? i did it and it didnt work. i told you here
Brody
Brody2y ago
close that terminal now open a new terminal in the project run railway shell hit enter run env check if the printed environment variables contain the database url
dwaynemac
dwaynemacOP2y ago
still getting this problem on the new terminal
Brody
Brody2y ago
screenshot please
dwaynemac
dwaynemacOP2y ago
there is a screenshot in the mentioned message. but i'll take a new one
Brody
Brody2y ago
that screenshot you already sent shows that you didn't do what I'm asking
dwaynemac
dwaynemacOP2y ago
Brody
Brody2y ago
please carefully read over this message ^
dwaynemac
dwaynemacOP2y ago
aah, no prompt will come after railway shell got it
Brody
Brody2y ago
what do you mean no prompt? there's a white rectangle, that's the prompt
dwaynemac
dwaynemacOP2y ago
sure, sorry when running 'env' among all variables this appears: DATABASE_URL=
Brody
Brody2y ago
there we go have you setup the references?
dwaynemac
dwaynemacOP2y ago
not sure. as i said, it's been working until now.
Brody
Brody2y ago
you're a beta tester
dwaynemac
dwaynemacOP2y ago
you mean the new variables references for plugin that where announced on the last changelog?
Brody
Brody2y ago
yes did you watch the video where Greg explained it all
dwaynemac
dwaynemacOP2y ago
i didnt configure it manually no. no
dwaynemac
dwaynemacOP2y ago
ah, yes that video yes
dwaynemac
dwaynemacOP2y ago
dwaynemac
dwaynemacOP2y ago
but on the UI it seems to be ok
Brody
Brody2y ago
normally I would refrain from asking you to go through all the above steps and just test it myself, but my power is out and I'm on mobile so once I'm able to get back on the computer, I will check if I can replicate this issue and if I can I will bring it up to the team
Greg Schier
Greg Schier2y ago
Hey, just jumping in. It seems like this is likely a result of the new database reference variable changes, but I'm unable to reproduce on my end. Also note that we've created references for your services (like you see in the screenshot) so everything should be working as it was. Note, you can also type railway run env to print the environment variables that would be available
dwaynemac
dwaynemacOP2y ago
running "railway variables" returns this
dwaynemac
dwaynemacOP2y ago
trying
railway run env
railway run env
now DATABASE_URL is blank in "railway run env"
Greg Schier
Greg Schier2y ago
Have you done railway service yet?
dwaynemac
dwaynemacOP2y ago
yep
Greg Schier
Greg Schier2y ago
Also ensure you're on the latest CLI version, as we've update the varialbes endpoint there too recently
dwaynemac
dwaynemacOP2y ago
railway --version
railway --version
railwayapp 3.0.1
Greg Schier
Greg Schier2y ago
Oh ya, that might be it. The latest is 3.0.13 https://docs.railway.app/develop/cli
dwaynemac
dwaynemacOP2y ago
aaah, maybe its related to the brew install rlwy how do I run rlwy ?
Greg Schier
Greg Schier2y ago
I think our brew version may be behind at the moment
dwaynemac
dwaynemacOP2y ago
oh, ok best install source?
Greg Schier
Greg Schier2y ago
If you uninstall from brew and install with curl -fsSL cli.new | sh it should work
dwaynemac
dwaynemacOP2y ago
i'll try that ok, running railway --version railwayapp 3.0.13 now aaand worked! thanks
Greg Schier
Greg Schier2y ago
Cool, so railway variables should print Nice! Apologies for the frustration here. We're not happy with the way we rolled out our new 3.0 CLI and are discussing as a team ways to avoid breaking changes going forward But I'm glad it's working now. Any other questions?
dwaynemac
dwaynemacOP2y ago
appreaciated i'm good now. getting back to work! 😄 thanks for the help
Greg Schier
Greg Schier2y ago
Anytime 👋
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server