R
Railway•2y 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•2y ago
Project ID: 79f1c83a-6d2b-438b-83e7-222a04cc317a
Gagik
GagikOP•2y ago
Getting this
Gagik
GagikOP•2y ago
Do I need to write it in Procfile? @jtmaveryk
Brody
Brody•2y 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
GagikOP•2y ago
Getting the same error
Gagik
GagikOP•2y ago
this is my procfile content as you said
Brody
Brody•2y ago
its showing up in the build logs???
Gagik
GagikOP•2y ago
exactly
Brody
Brody•2y ago
can you share your repo so i cant understand whats going on
Gagik
GagikOP•2y ago
after couple of minutes it's automatically failinh
Brody
Brody•2y ago
please
Gagik
GagikOP•2y ago
email pls
Gagik
GagikOP•2y ago
check pls
Brody
Brody•2y 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
GagikOP•2y ago
I just copied from this instruction
Brody
Brody•2y ago
please do these things
Gagik
GagikOP•2y ago
testing now
Brody
Brody•2y ago
just curious about something, can you send me a screenshot of the table at the top of your build logs please?
Gagik
GagikOP•2y ago
again same
Gagik
GagikOP•2y ago
Brody
Brody•2y ago
screenshot of the details tab please
Gagik
GagikOP•2y ago
Brody
Brody•2y 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
GagikOP•2y ago
trying now. But 100% it's using new one that you provided
Brody
Brody•2y ago
no it's not
Gagik
GagikOP•2y ago
Brody
Brody•2y 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
GagikOP•2y ago
no now rebuilding in the app
Gagik
GagikOP•2y ago
Brody
Brody•2y ago
there we go, that looks good
Gagik
GagikOP•2y ago
OMG it's going further 😄 I'm trying to solve this around a week
Brody
Brody•2y 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
GagikOP•2y ago
And it's crashed cryingman
Brody
Brody•2y ago
makes sense full deploy logs please
Gagik
GagikOP•2y ago
Brody
Brody•2y 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
GagikOP•2y 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•2y ago
yeah heroku holds your hand a whole lot, here on railway your code is ran as is
Want results from more Discord servers?
Add your server