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