Why am i getting this error?

Hello i am getting this below error when i try to upload a file in flask. It is working fine in my local machine but when i deploy to railway and then i try uploading the file it keeps loading and then times out it is giving the below error in the deploy logs and the file is not getting uploaded.
warnings.warn(FSADeprecationWarning(
[2023-02-15 06:37:28 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:15)
[2023-02-15 06:37:28 +0000] [15] [INFO] Worker exiting (pid: 15)
[2023-02-15 06:37:28 +0000] [16] [INFO] Booting worker with pid: 16
/opt/venv/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py:872: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future. Set it to True or False to suppress this warning.
warnings.warn(FSADeprecationWarning(
[2023-02-15 06:37:28 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:15)
[2023-02-15 06:37:28 +0000] [15] [INFO] Worker exiting (pid: 15)
[2023-02-15 06:37:28 +0000] [16] [INFO] Booting worker with pid: 16
/opt/venv/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py:872: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future. Set it to True or False to suppress this warning.
Update: i tryed to update the Procfile to --timeout=120 and still it is not working
21 Replies
Percy
Percy2y ago
Project ID: N/A
Percy
Percy2y ago
⚠️ experimental feature
Brody
Brody2y ago
https://stackoverflow.com/a/39794504' if you aren't using the event system, you will need to disable the feature to suppress the deprecation message, please try changing the value to false like the answer suggests, i hope that helps
みなと
みなと2y ago
Like i am trying to upload a file which is 700MB but i have a MAX_CONTENT_LENGTH of 100MB
Brody
Brody2y ago
try to increase the limit
みなと
みなと2y ago
How The application is working fine in my local machine
Brody
Brody2y ago
are you by chance on the free plan?
みなと
みなと2y ago
Yeah i am
みなと
みなと2y ago
Brody
Brody2y ago
perhaps flask is trying to buffer the 700mb file into memory, but on the free plan you only have 512mb available
みなと
みなと2y ago
Right
Brody
Brody2y ago
You still get 5$ worth of credit every month with the Dev plan 🙂
みなと
みなと2y ago
Hey sorry i just checked in my local machine it is not trying to buffer to RAM there is some CPU usage that is it. What seems to be the problem im not able to debug
Brody
Brody2y ago
You mean excessive CPU usage?
みなと
みなと2y ago
It's just using the CPU for checking the file size if it is below 100MB
Brody
Brody2y ago
There's definitely bigger issues than checking the file size
みなと
みなと2y ago
If we say about uploading im doing that in chuncks of 1024 bytes to the filesystem
Brody
Brody2y ago
Is this example just uploading and saving the file to disk?
みなと
みなと2y ago
Yes that is all it is doing
Brody
Brody2y ago
I'm gonna go out on a limb here and say it shouldn't take that much processing power so save a file to disk Could I see a repository for this code?
みなと
みなと2y ago
Sure
Want results from more Discord servers?
Add your server