R
Railwayβ€’13mo ago
sas70

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
Brody
Brodyβ€’13mo ago
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
sas70
sas70β€’13mo ago
i already have the procfile with this "web: gunicorn main:app" so not sure if that is enough
Brody
Brodyβ€’13mo ago
well that's usually enough yes does the procfile have a capital P?
sas70
sas70β€’13mo ago
the image is build with no issues but when i run the app it fails starting No
Brody
Brodyβ€’13mo ago
needs a capital P
sas70
sas70β€’13mo ago
just corrected it and committed and will see Application failed to respond! project ID- 9754b56e-d2f7-4872-bd06-e2b33ae8c2be
Brody
Brodyβ€’13mo ago
thats the deployment logs, but good enough send me your railway domain please?
sas70
sas70β€’13mo ago
the app finally is launching now πŸ™‚
Brody
Brodyβ€’13mo ago
oh cool, what did you change
sas70
sas70β€’13mo ago
I got this error message . it is a 503 error message ...here fare the last log lines
2023-10-21 02:58:04,184 - INFO - All validations successfully done. Beginning ExtractPDF operation execution

[2023-10-21 02:58:33 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:10)

[2023-10-21 02:58:33 +0000] [10] [INFO] Worker exiting (pid: 10)

[2023-10-21 02:58:34 +0000] [11] [INFO] Booting worker with pid: 11
You reached the present time

Try Loading More
2023-10-21 02:58:04,184 - INFO - All validations successfully done. Beginning ExtractPDF operation execution

[2023-10-21 02:58:33 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:10)

[2023-10-21 02:58:33 +0000] [10] [INFO] Worker exiting (pid: 10)

[2023-10-21 02:58:34 +0000] [11] [INFO] Booting worker with pid: 11
You reached the present time

Try Loading More
https://pdf2t2c-production.up.railway.app/ the only change made is the capital P for procfile
Brody
Brodyβ€’13mo ago
what are you doing to cause the timeout? calling some endpoint?
sas70
sas70β€’13mo ago
calling the ADOBE API services and it takes around 10 sec to respond
Brody
Brodyβ€’13mo ago
[CRITICAL] WORKER TIMEOUT means the request took longer than 30 seconds, 30 seconds is gunicorns default timeout
sas70
sas70β€’13mo ago
when i ran the app using localhost, it takes 10-15 sec only I just ran it and it took 9 sec locally
Brody
Brodyβ€’13mo ago
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
sas70
sas70β€’13mo ago
ok then let me have another look tomorrow and get back to you
Brody
Brodyβ€’13mo ago
add proper error handling, and time telemetry throughout your code to see where the hold up is
sas70
sas70β€’13mo ago
Thank you for the great support. At least the app is launching and passed the build and deployment stages πŸ™‚ thank you.
Brody
Brodyβ€’13mo ago
no problem πŸ™‚
sas70
sas70β€’13mo ago
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 πŸ™‚
Brody
Brodyβ€’13mo ago
glad it was something simple! make sure you add proper error handling so this doesn't happen again!
Want results from more Discord servers?
Add your server