please help me on the deployment, spent the whole day, thanks!

visionandyTRIAL

6 months ago

I want to deploy my project using git and postgres, all from railway, however, it always failed at the step, when I try to click the link, to get access to the web, fro the error message, it seems the database url is not right,
"django.db.utils.OperationalError: could not translate host name "autorack.proxy.rlwy.net:16108" to address: Name or service not known"
Do you know where I can correctly config my setting.py at django, this is my current setup DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": os.environ.get("DBNAME"), "USER": os.environ.get("DBUSER"),
"PASSWORD": os.environ.get("DBPASSWORD"), "HOST": "autorack.proxy.rlwy.net:16108",#os.environ.get("DBHOST"),
"PORT": "5432", #os.environ.get("DBPORT", "5432"), } } DATABASES = { "default": { "ENGINE": "django.db.backends.postgresql", "NAME": os.environ.get("DBNAME"),
"USER": os.environ.get("DBUSER"), "PASSWORD": os.environ.get("DBPASSWORD"),
"HOST": "autorack.proxy.rlwy.net:16108",
"PORT": "5432",
}
}
I got the HOST and PORT data from setting at postgres. Many Thanks!!!!

View Deploy details

ⓘ Deployment information is only viewable by project members and Railway employees.

Solved

6 Replies

6 months ago

autorack.proxy.rlwy.net:16108 is a host and port, you need to use the host and port separately.


visionandyTRIAL

6 months ago

Thanks @Brody, I have tried, does not work. gives the following error, django.db.utils.OperationalError: connection to server at "autorack.proxy.rlwy.net" (35.212.144.195), port 16108 failed: FATAL: password authentication failed for user "root"

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.postgresql",
        "NAME": os.environ.get("DB_NAME"),
        "USER": os.environ.get("DB_USER"),
        "PASSWORD": os.environ["DB_PASSWORD"],
        "HOST": "autorack.proxy.rlwy.net",
        "PORT": "16108",
    }
}

6 months ago

Since this is Postgres on Railway I can tell you that the user is not root.

You have the variables missconfigured or simply not set.


visionandyTRIAL

6 months ago

Thanks, Brody, I have hard-coding it, currently, it can deploy successfully, however, there is no data loading in, the attachment is the screenshot, any ideas?

Attachments


6 months ago

That's diving more into application level support that we can't provide since this forum is for support with the Railway platform.


visionandyTRIAL

6 months ago

no problem! Thanks!


Status changed to Solved brody 6 months ago