DB not recognizable
curiebuffer
FREEOP

2 years ago

0 Replies

curiebuffer
FREEOP

2 years ago

42cb5f33-ac30-472f-be18-06847d544555


brody
EMPLOYEE

2 years ago

going to need more information, are you trying to connect to a database hosted on railway?


curiebuffer
FREEOP

2 years 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
EMPLOYEE

2 years ago

show me the code that connects to the database please


curiebuffer
FREEOP

2 years ago

1212268796233121800


brody
EMPLOYEE

2 years ago

show me where that database url variable is defined please


curiebuffer
FREEOP

2 years ago

Its defined in settings.py
Lastly i am doing this

1212269250572587000
1212269251054928000


brody
EMPLOYEE

2 years ago

but that's just the word "postgres" I'm not sure what you are doing there


brody
EMPLOYEE

2 years ago

that's an empty string?


brody
EMPLOYEE

2 years ago

it should load the value from the environment variables


curiebuffer
FREEOP

2 years ago

Settings.py imports BaseSetting which directly loads the env variables

1212270731510022100


curiebuffer
FREEOP

2 years ago

The empty string was the placeholder value


brody
EMPLOYEE

2 years ago

have you done the classic debugging technique of printing the variable that you use in tortoise?


curiebuffer
FREEOP

2 years ago

Yes it is getting recognized


curiebuffer
FREEOP

2 years ago

I am getting the db value


curiebuffer
FREEOP

2 years ago

@Brody any idea on how i can fix this


brody
EMPLOYEE

2 years ago

at first glace this is kinda looking like its loading variables from a file?


curiebuffer
FREEOP

2 years ago

I tried logging the db url that the app is connecting to and the url looks fine.


brody
EMPLOYEE

2 years ago

its printing the scheme blank in your screenshot

1212626540702081000


curiebuffer
FREEOP

2 years ago

Logged the db here

1212628853801881600


brody
EMPLOYEE

2 years ago

right but seems like tortoise is ending up with a bad url


curiebuffer
FREEOP

2 years ago

Any idea how i can debug that?


brody
EMPLOYEE

2 years ago

print the same value you are passing to tortoise, not just the environment variable


Anonymous
PRO

2 months ago

@curiebufferfinance were you able to solve this


Loading...