4 months ago
Hello Railway Team,
I'm facing a series of critical issues with my Flask application and would be very grateful for your expert advice. My project is poetic-harmony.
The Core Problem:
My deployments are consistently failing with a WORKER TIMEOUT error. This seems to be the root cause of all other issues. The timeout triggers a chaotic loop of database initializations, and the application becomes unstable.
Symptom 1: Inconsistent Translations
My primary issue is that my Flask-Babel translations are not working correctly. Some texts are translated, while others are not, and it changes on page refresh.
I've confirmed my
.poand.mofiles are correct and thepybabel compilecommand runs successfully during the build. I suspect theWORKER TIMEOUTis preventing the locale from being loaded consistently.
Symptom 2: Email Delivery Failure (SMTP)
My application also fails to send emails via Zoho SMTP.
I have triple-checked all my environment variables (
MAIL_SERVER,MAIL_PORT,SUPPORT_EMAIL,SUPPORT_EMAIL_PASS, etc.), and they are correct.I've also confirmed with my domain provider (Namecheap) and Zoho that my DNS records (SPF, DKIM) are now set up correctly.
I believe the
WORKER TIMEOUTis causing the application to crash before it can even establish an SMTP connection.
What I've Tried:
I've spent a long time debugging this. The key issue seems to be the slow startup process, likely caused by my database initialization code running at the global scope of my run.py file.
My Question:
What is the standard, recommended Railway practice to initialize a database for a Flask application to avoid the WORKER TIMEOUT error? I believe if I can solve the timeout issue, the translation and email problems will be resolved as a consequence.
Thank you for your time and help.
1 Replies
4 months ago
Please do not open duplicate threads.
Status changed to Closed brody • 4 months ago