django.db.utils.OperationalError: [Errno 11001] getaddrinfo failed Django project connecting todb
denistsh01
HOBBYOP

a year ago

django.db.utils.OperationalError: [Errno 11001 unable to connect to db

Solved

42 Replies

denistsh01
HOBBYOP

a year ago

ac9964b2-c042-43a4-8a28-e83db3a4a6ee


a year ago

where do you get this error?


denistsh01
HOBBYOP

a year ago

my terminal when i want to open the project


a year ago

use railway ssh


denistsh01
HOBBYOP

a year ago

i cant run the migrations locally


a year ago

please use railway ssh


denistsh01
HOBBYOP

a year ago

railway login

Open the browser? Yes
Logged in as Tsh (tosadenisandrei@gmail.com)
PS C:\Users\toshd\Licenta - Copy (4)Chinezu\licentaRepo\backend> railway ssh
Expected welcome message, received: error
PS C:\Users\toshd\Licenta - Copy (4)Chinezu\licentaRepo\backend>


a year ago

are you linked to the correct service?


denistsh01
HOBBYOP

a year ago

i will relink then . i must link it to the BE right ?


denistsh01
HOBBYOP

a year ago

not the DB


a year ago

correct


denistsh01
HOBBYOP

a year ago

Expected welcome message, received: error
re linked it again


a year ago

then run the command locally using the database public host and port


denistsh01
HOBBYOP

a year ago

can you give me the template for that ?


a year ago

there is no template involved


denistsh01
HOBBYOP

a year ago

DATABASES = {
'default': djdatabaseurl.config(default=os.environ.get('DATABASE_URL'))
} you mean like this ?


a year ago

Yep, then use the public URL locally


denistsh01
HOBBYOP

a year ago

deploy failed


denistsh01
HOBBYOP

a year ago

pre-deploy comand failed


denistsh01
HOBBYOP

a year ago

i changed the way i connect to db now what ?


denistsh01
HOBBYOP

a year ago

i run makemigrations & migrate with railway run or the usual way ?


denistsh01
HOBBYOP

a year ago

ok locally works , but deployment failed


a year ago

please do not change anything on railway


denistsh01
HOBBYOP

a year ago

i just tested with an entrance from local project . but didnt change anything in setup


denistsh01
HOBBYOP

a year ago

so ?


a year ago

please revert the changes you made in railway


denistsh01
HOBBYOP

a year ago

what changes


denistsh01
HOBBYOP

a year ago

the entrances in db ?


denistsh01
HOBBYOP

a year ago

i did not change anything in setup


denistsh01
HOBBYOP

a year ago

What changes


a year ago

you said your service on railway has crashed? what changes did you do to cause that?


denistsh01
HOBBYOP

a year ago

it crashed after i changed to DATABASES = {
'default': djdatabaseurl.config(default=os.environ.get('DATABASE_URL'))
}


denistsh01
HOBBYOP

a year ago

1353770329398579200


a year ago

gotcha, you had the database url set to some render url


a year ago

i've changed that for you


denistsh01
HOBBYOP

a year ago

in service variabls ?


a year ago

yeah


a year ago

all good, your service is back online


denistsh01
HOBBYOP

a year ago

so now i just keep my commands i dont need to pull variables like the cli version right ?


a year ago

you need to use the public database url locally


denistsh01
HOBBYOP

a year ago

yeah it works locally


a year ago

!s


Status changed to Solved brody 12 months ago


Loading...