"Application failed to respond" after successfull deploy
I have deployed a flask server using docker but when I'm trying to access the route getting
Application failed to respond
here is the deploy logs23 Replies
Project ID:
02456656-8527-4d43-92f2-e16dfc73d2ab
02456656-8527-4d43-92f2-e16dfc73d2ab
tried multiple times same error here is my dockerfile if it helps
I recommend taking a look at this:
https://docs.railway.app/troubleshoot/fixing-common-errors
ur exposing on 5000 but in the logs it listens on 8000?
not sure if it's port related issue here it's exposing railway provided port after updating CMD ["gunicorn", "wsgi:app"]
I am not sure which port railway will assign so exposed an static port 5000
Ok, may not be the best idea to check if its a port related issue but try this out:
Expose port 8000 in your dockerfile
Make your app listen on port 8000
Assign a PORT=8000 env var in your project
exposed the port using variable like
EXPOSE $PORT
it assigned dynamicallyfun fact you don't need to expose the port in your dockerfile
it didn't have any effect so far
I know
so what ya downloading?
this
python -m spacy download en_core_web_sm
you are running that during the build phase (good)
but then you are running that download again when your app starts (bad)
add some logic there to detect if it was already downloaded and skip the second download if it was found
doesn't it supposed to that
RUN python -c "import spacy; spacy.load('en_core_web_sm')" || python -m spacy download en_core_web_sm
In the code i didn't specify anything to downloadthats running it in the build phase (good)
but as I can see clear as day from your screenshot of the start phase, you are downloading something again, likely the spacy thing
you can see the download progress bars in your screenshot right? that's from the deployment logs, aka runtime logs, you are downloading something again during runtime
you're right something is downloading but I'm not yet not sure what. need to debug
let me know when the double download is resolved
sure thanks for the help
my project didn't work when i deployed without exposing 💀
but it was like almost a year ago, now since its all exposed from the dockerfile i just don't mess with it anymore lmao
forgot to update, the problem was I was loading whisper model on runtime
found out didnt need that part of code just commented out
yep that sounds exactly like what was happening, all good now?
yeah
awsome!