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.
Update: i tryed to update the Procfile to --timeout=120 and still it is not working
21 Replies
Project ID:
N/A
You might find these helpful:
- Struggling hosting my Flask website
- Failed to deploy Flask app
- Error with flask app
⚠️ experimental feature
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
Like i am trying to upload a file which is 700MB but i have a MAX_CONTENT_LENGTH of 100MB
try to increase the limit
How
The application is working fine in my local machine
are you by chance on the free plan?
Yeah i am
perhaps flask is trying to buffer the 700mb file into memory, but on the free plan you only have 512mb available
Right
You still get 5$ worth of credit every month with the Dev plan 🙂
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
You mean excessive CPU usage?
It's just using the CPU for checking the file size if it is below 100MB
There's definitely bigger issues than checking the file size
If we say about uploading im doing that in chuncks of 1024 bytes to the filesystem
Is this example just uploading and saving the file to disk?
Yes that is all it is doing
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?
Sure