R
Railway•13mo ago
Gagik

Listening on 127.0.0.1 instead of 0.0.0.0. Running with gunicorn

Always getting this error while deployin. Project is on Python Django.
39 Replies
Percy
Percy•13mo ago
Project ID: 79f1c83a-6d2b-438b-83e7-222a04cc317a
Gagik
Gagik•13mo ago
Getting this
Gagik
Gagik•13mo ago
Do I need to write it in Procfile? @jtmaveryk
Brody
Brody•13mo ago
1. railway currently runs on the Google cloud platform, and the only region available at the moment is us-west1, not aws 2. gunicorn listens on host 0.0.0.0 and Environment variable PORT by default 3. you forgot to prefix the Procfile's start command with web: a Procfile with this should be fine
web: python manage.py migrate && python manage.py collectstatic --noinput && gunicorn mysite.wsgi
web: python manage.py migrate && python manage.py collectstatic --noinput && gunicorn mysite.wsgi
obviously adapting that for whatever name you use for your django app we greatly appreciate your efforts to help but unfortunately this answers gets some things wrong, and in the interest of providing the most accurate help we can, I've had to remove this answer, but we hope you can continue helping people in the future!
Gagik
Gagik•13mo ago
Getting the same error
Gagik
Gagik•13mo ago
this is my procfile content as you said
Brody
Brody•13mo ago
its showing up in the build logs???
Gagik
Gagik•13mo ago
exactly
Brody
Brody•13mo ago
can you share your repo so i cant understand whats going on
Gagik
Gagik•13mo ago
after couple of minutes it's automatically failinh
Brody
Brody•13mo ago
please
Gagik
Gagik•13mo ago
email pls
Brody
Brody•13mo ago
brodyover@gmail.com
Gagik
Gagik•13mo ago
check pls
Brody
Brody•13mo ago
i see whats wrong 1. delete your Procfile 2. for uniformity, use a lowercase 'r' in your railway.json file 2. replace your railway.json with this
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS"
},
"deploy": {
"startCommand": "python manage.py migrate && python manage.py collectstatic --noinput && gunicorn coverletter.wsgi",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS"
},
"deploy": {
"startCommand": "python manage.py migrate && python manage.py collectstatic --noinput && gunicorn coverletter.wsgi",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
Gagik
Gagik•13mo ago
I just copied from this instruction
Brody
Brody•13mo ago
please do these things
Gagik
Gagik•13mo ago
testing now
Brody
Brody•13mo ago
just curious about something, can you send me a screenshot of the table at the top of your build logs please?
Gagik
Gagik•13mo ago
again same
Gagik
Gagik•13mo ago
Brody
Brody•13mo ago
screenshot of the details tab please
Gagik
Gagik•13mo ago
Brody
Brody•13mo ago
seems like its using an old railway.json file, i think you may have bugged the service, can you please delete the service and remake it
Gagik
Gagik•13mo ago
trying now. But 100% it's using new one that you provided
Brody
Brody•13mo ago
no it's not
Gagik
Gagik•13mo ago
Brody
Brody•13mo ago
this is not the same railway.json that I gave you, look closer this one is correct, but it is not the one railway is using, according to your screenshot of the details tab have you set a custom build command in the service settings??
Gagik
Gagik•13mo ago
no now rebuilding in the app
Gagik
Gagik•13mo ago
Brody
Brody•13mo ago
there we go, that looks good
Gagik
Gagik•13mo ago
OMG it's going further 😄 I'm trying to solve this around a week
Brody
Brody•13mo ago
damn I wonder how many deploys you have made that have failed in a week railway gonna have to start billing for builder resources after this lmao
Gagik
Gagik•13mo ago
And it's crashed cryingman
Brody
Brody•13mo ago
makes sense full deploy logs please
Gagik
Gagik•13mo ago
Brody
Brody•13mo ago
please reference the railway django settings.py file on how to configure static files https://github.com/railwayapp-templates/django/blob/main/mysite/settings.py
Gagik
Gagik•13mo ago
I came from Heroku, I guess that's why there is so much inconsistencies 😄 BTW thank you very much for providing your time and helping me to figure it out
Brody
Brody•13mo ago
yeah heroku holds your hand a whole lot, here on railway your code is ran as is