Flask API
Hello - i deployed several apps with Railway using only the Railway templates, and it worked but my i am having hard time with my current project -- Serving Flask app "main" (lazy loading)
Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
Debug mode: off
23 Replies
you said you used railway templates without issues, so the difference between those templates and your current project would be the templates used gunicorn in the start command
i already have the procfile with this "web: gunicorn main:app"
so not sure if that is enough
well that's usually enough yes
does the procfile have a capital P?
the image is build with no issues but when i run the app it fails starting
No
needs a capital P
just corrected it and committed and will see
Application failed to respond!
project ID- 9754b56e-d2f7-4872-bd06-e2b33ae8c2be
build logs please https://bookmarklets.up.railway.app/log-downloader/
thats the deployment logs, but good enough
send me your railway domain please?
the app finally is launching now π
oh cool, what did you change
I got this error message . it is a 503 error message ...here fare the last log lines
https://pdf2t2c-production.up.railway.app/
the only change made is the capital P for procfile
what are you doing to cause the timeout?
calling some endpoint?
calling the ADOBE API services and it takes around 10 sec to respond
[CRITICAL] WORKER TIMEOUT
means the request took longer than 30 seconds, 30 seconds is gunicorns default timeoutwhen i ran the app using localhost, it takes 10-15 sec only
I just ran it and it took 9 sec
locally
looks like you have a code issue on your hands
maybe something you are doing in code during that enpoint request is silently failing and locking up the request causing it to time out
ok then let me have another look tomorrow and get back to you
add proper error handling, and time telemetry throughout your code to see where the hold up is
Thank you for the great support. At least the app is launching and passed the build and deployment stages π thank you.
no problem π
Brody - The endpoint is up and running. I had an issue with an API key. So wll is good now. Thank you again for the help π
glad it was something simple! make sure you add proper error handling so this doesn't happen again!