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:Jump to solution
change the start command in your Procfile to this
waitress-serve --host=0.0.0.0 --port=$PORT app:app
...42 Replies
Project ID:
N/A
ok
19fc1404-63f7-49bb-a509-04836491603b
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
I have donne that
I have done
So your host is
0.0.0.0
and you've set your PORT
service variable to8080
?yes
Then I have no idea why that is happening
thank you, neither do I
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?
Sorry, I thought flask what that one framework where it's difficult to change the PORT
probably misremembered
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
Thank you for telling me 🙏
I need to first know what their current start command is so I can provide them with an appropriately modified start command
waitress-serve --host=0.0.0.0 --port=8080 app:app
are you building with a dockerfile?
no
no
how are you setting that start command
there's no need to ping reply, I'm here
in a Procfile
is the start command in your service settings empty?
in the service settings I am using that one
is the start command in your service settings empty? (yes/no)
no
clear it
Railway?
yes, the service settings would be in railway
I'm using this
waitress-serve --host=0.0.0.0 --port=8080 app:app
is the start command in your service settings empty? (yes/no)
no
clear it
yes I know it's a process fragly
yes
it is
I use the same in another one last week and it's working fine
do you have a PORT service variable set, in railway? (yes/no)
no
should I?
no you shouldn't
Solution
change the start command in your Procfile to this
waitress-serve --host=0.0.0.0 --port=$PORT app:app
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
😥
did you try opening that URL with 0.0.0.0 in it???
It' s working
Thank you!!!!!!!!!!!!!
Very much!!!!!!!!!!
yeah you need to use the railway domain lol
no problem!
Good to know! I'm learning, thank you!
fragly, study up
🥰