R
Railway14mo ago
Fabiana

Application failed to respond

When I run my project locally, it's working fine but when I made the deploy, didn't run with --host=0.0.0.0. I am using python, flask, waitress and a few days ago I have deployed another project that's working fine. The logs of the 2 replics are: INFO:waitress:Serving on http://0.0.0.0:8080 INFO:waitress:Serving on http://0.0.0.0:8080 What's happening please? Thank you
Solution:
change the start command in your Procfile to this waitress-serve --host=0.0.0.0 --port=$PORT app:app...
Jump to solution
42 Replies
Percy
Percy14mo ago
Project ID: N/A
Fabiana
FabianaOP14mo ago
ok 19fc1404-63f7-49bb-a509-04836491603b
Fragly
Fragly14mo ago
You need to set your PORT service variable to 8080 if you haven't already you can read more on why here: https://docs.railway.app/troubleshoot/fixing-common-errors
Fabiana
FabianaOP14mo ago
I have donne that I have done
Fragly
Fragly14mo ago
So your host is 0.0.0.0 and you've set your PORT service variable to8080?
Fabiana
FabianaOP14mo ago
yes
Fragly
Fragly14mo ago
Then I have no idea why that is happening
Fabiana
FabianaOP14mo ago
thank you, neither do I
Brody
Brody14mo ago
you would only set a PORT service variable to a fixed PORT if it is not easy to get the app to listen on the randomly generated PORT, it is always best to listen on the PORT Railway assigns automatically @Fabiana what is your current start command?
Fragly
Fragly14mo ago
Sorry, I thought flask what that one framework where it's difficult to change the PORT probably misremembered
Brody
Brody14mo ago
typically flask apps are run with gunicorn and gunicorn listens on the appropriate host and port by default, with waitress it should be as simple as providing a port or bind flag
Fragly
Fragly14mo ago
Thank you for telling me 🙏
Brody
Brody14mo ago
I need to first know what their current start command is so I can provide them with an appropriately modified start command
Fabiana
FabianaOP14mo ago
waitress-serve --host=0.0.0.0 --port=8080 app:app
Brody
Brody14mo ago
are you building with a dockerfile?
Fabiana
FabianaOP14mo ago
no no
Brody
Brody14mo ago
how are you setting that start command there's no need to ping reply, I'm here
Fabiana
FabianaOP14mo ago
in a Procfile
Brody
Brody14mo ago
is the start command in your service settings empty?
Fabiana
FabianaOP14mo ago
in the service settings I am using that one
Brody
Brody14mo ago
is the start command in your service settings empty? (yes/no)
Fabiana
FabianaOP14mo ago
no
Brody
Brody14mo ago
clear it
Fabiana
FabianaOP14mo ago
Railway?
Brody
Brody14mo ago
yes, the service settings would be in railway
Fabiana
FabianaOP14mo ago
I'm using this waitress-serve --host=0.0.0.0 --port=8080 app:app
Brody
Brody14mo ago
is the start command in your service settings empty? (yes/no)
Fabiana
FabianaOP14mo ago
no
Brody
Brody14mo ago
clear it yes I know it's a process fragly
Fabiana
FabianaOP14mo ago
yes it is I use the same in another one last week and it's working fine
Brody
Brody14mo ago
do you have a PORT service variable set, in railway? (yes/no)
Fabiana
FabianaOP14mo ago
no should I?
Brody
Brody14mo ago
no you shouldn't
Solution
Brody
Brody14mo ago
change the start command in your Procfile to this waitress-serve --host=0.0.0.0 --port=$PORT app:app
Fabiana
FabianaOP14mo ago
ok This site can’t be reachedThe webpage at http://0.0.0.0:7334/ might be temporarily down or it may have moved permanently to a new web address. ERR_ADDRESS_INVALID 😥
Brody
Brody14mo ago
did you try opening that URL with 0.0.0.0 in it???
Fabiana
FabianaOP14mo ago
It' s working Thank you!!!!!!!!!!!!! Very much!!!!!!!!!!
Brody
Brody14mo ago
yeah you need to use the railway domain lol no problem!
Fabiana
FabianaOP14mo ago
Good to know! I'm learning, thank you!
Brody
Brody14mo ago
fragly, study up
Fragly
Fragly14mo ago
o7
Fabiana
FabianaOP14mo ago
🥰
Want results from more Discord servers?
Add your server