"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
Percy16mo ago
Project ID: 1e715dda-f769-4167-bae5-3c58d685441c
Percy
Percy16mo ago
No search results found.
⚠️ experimental feature
dwaynemac
dwaynemac16mo 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
Brody16mo ago
what os? and have you ran both railway link and railway service inside of that project folder?
dwaynemac
dwaynemac16mo 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
Brody16mo ago
did any of railway login, railway link, or railway service give you any errors?
dwaynemac
dwaynemac16mo ago
mmm, not really. i can try to logout and re-login no errors on login
Brody
Brody16mo ago
not really? I think it was a yes or no question lol
dwaynemac
dwaynemac16mo 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
Brody16mo ago
okay what about the other commands I listed, any errors with them?
dwaynemac
dwaynemac16mo ago
they all work ok but dont resolve the issue
Brody
Brody16mo ago
right okay can you run railway shell and then run env lmao no
dwaynemac
dwaynemac16mo ago
sorry, wout run retrying
Brody
Brody16mo ago
railway shell hit enter env does the database url variable show up?
dwaynemac
dwaynemac16mo ago
when running railway shell it thinks for a while and nothing happens
dwaynemac
dwaynemac16mo ago
is railwayapp 3.0.1 the latest?
Brody
Brody16mo ago
no
dwaynemac
dwaynemac16mo ago
i'll try updating
Brody
Brody16mo ago
yeah but also try listening to what I'm saying
dwaynemac
dwaynemac16mo ago
railway shell?? i did it and it didnt work. i told you here
Brody
Brody16mo 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
dwaynemac16mo ago
still getting this problem on the new terminal
Brody
Brody16mo ago
screenshot please
dwaynemac
dwaynemac16mo ago
there is a screenshot in the mentioned message. but i'll take a new one
Brody
Brody16mo ago
that screenshot you already sent shows that you didn't do what I'm asking
dwaynemac
dwaynemac16mo ago
Brody
Brody16mo ago
please carefully read over this message ^
dwaynemac
dwaynemac16mo ago
aah, no prompt will come after railway shell got it
Brody
Brody16mo ago
what do you mean no prompt? there's a white rectangle, that's the prompt
dwaynemac
dwaynemac16mo ago
sure, sorry when running 'env' among all variables this appears: DATABASE_URL=
Brody
Brody16mo ago
there we go have you setup the references?
dwaynemac
dwaynemac16mo ago
not sure. as i said, it's been working until now.
Brody
Brody16mo ago
you're a beta tester
dwaynemac
dwaynemac16mo ago
you mean the new variables references for plugin that where announced on the last changelog?
Brody
Brody16mo ago
yes did you watch the video where Greg explained it all
dwaynemac
dwaynemac16mo ago
i didnt configure it manually no. no
dwaynemac
dwaynemac16mo ago
ah, yes that video yes
dwaynemac
dwaynemac16mo ago
dwaynemac
dwaynemac16mo ago
but on the UI it seems to be ok
Brody
Brody16mo 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 Schier16mo 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
dwaynemac16mo ago
running "railway variables" returns this
dwaynemac
dwaynemac16mo ago
trying
railway run env
railway run env
now DATABASE_URL is blank in "railway run env"
Greg Schier
Greg Schier16mo ago
Have you done railway service yet?
dwaynemac
dwaynemac16mo ago
yep
Greg Schier
Greg Schier16mo ago
Also ensure you're on the latest CLI version, as we've update the varialbes endpoint there too recently
dwaynemac
dwaynemac16mo ago
railway --version
railway --version
railwayapp 3.0.1
Greg Schier
Greg Schier16mo ago
Oh ya, that might be it. The latest is 3.0.13 https://docs.railway.app/develop/cli
dwaynemac
dwaynemac16mo ago
aaah, maybe its related to the brew install rlwy how do I run rlwy ?
Greg Schier
Greg Schier16mo ago
I think our brew version may be behind at the moment
dwaynemac
dwaynemac16mo ago
oh, ok best install source?
Greg Schier
Greg Schier16mo ago
If you uninstall from brew and install with curl -fsSL cli.new | sh it should work
dwaynemac
dwaynemac16mo ago
i'll try that ok, running railway --version railwayapp 3.0.13 now aaand worked! thanks
Greg Schier
Greg Schier16mo 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
dwaynemac16mo ago
appreaciated i'm good now. getting back to work! 😄 thanks for the help
Greg Schier
Greg Schier16mo ago
Anytime 👋
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View