DB not recognizable

No description
20 Replies
Percy
Percy9mo ago
Project ID: 42cb5f33-ac30-472f-be18-06847d544555
curiebufferfinance
curiebufferfinanceOP9mo ago
42cb5f33-ac30-472f-be18-06847d544555
Brody
Brody9mo ago
going to need more information, are you trying to connect to a database hosted on railway?
curiebufferfinance
curiebufferfinanceOP9mo ago
Yes postgres hosted on railway in the same project. I have added DATABASE_URL as the env variable but its still throwing this error. I have multiple such projects running and everything works fine. Only in this project i am facing this issue.
Brody
Brody9mo ago
show me the code that connects to the database please
curiebufferfinance
curiebufferfinanceOP9mo ago
No description
Brody
Brody9mo ago
show me where that database url variable is defined please
curiebufferfinance
curiebufferfinanceOP9mo ago
Its defined in settings.py Lastly i am doing this
No description
No description
Brody
Brody9mo ago
that's an empty string? it should load the value from the environment variables
curiebufferfinance
curiebufferfinanceOP9mo ago
Settings.py imports BaseSetting which directly loads the env variables
No description
curiebufferfinance
curiebufferfinanceOP9mo ago
The empty string was the placeholder value
Brody
Brody9mo ago
have you done the classic debugging technique of printing the variable that you use in tortoise?
curiebufferfinance
curiebufferfinanceOP9mo ago
Yes it is getting recognized I am getting the db value @Brody any idea on how i can fix this
Brody
Brody9mo ago
at first glace this is kinda looking like its loading variables from a file?
curiebufferfinance
curiebufferfinanceOP9mo ago
I tried logging the db url that the app is connecting to and the url looks fine.
Brody
Brody9mo ago
its printing the scheme blank in your screenshot
No description
curiebufferfinance
curiebufferfinanceOP9mo ago
Logged the db here
No description
Brody
Brody9mo ago
right but seems like tortoise is ending up with a bad url
curiebufferfinance
curiebufferfinanceOP9mo ago
Any idea how i can debug that?
Brody
Brody9mo ago
print the same value you are passing to tortoise, not just the environment variable
Want results from more Discord servers?
Add your server