Import file flow breaks when horizontally scaled app
See original GitHub issueI’m getting this error on file upload of my prod server, only recently when I bumped up the number of dynos:
File "/app/.heroku/python/lib/python2.7/site-packages/import_export/admin.py", line 122, in process_import
import_file = open(import_file_name, input_format.get_read_mode())
IOError: [Errno 2] No such file or directory: u'/tmp/tmpPWSbPm'
The only thing that makes sense to me is the upload and process is happening in separate web requests? Am I missing a config value?
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Scaling Your Environment in Mendix Cloud v4
Describes how to scale your environments in Mendix Cloud v4. ... Horizontal scaling is only available for apps written in Mendix version 7.0 ......
Read more >How to repackage a flow for import (in .zip file) after extracting?
After exporting a flow, and extracting the resulting .zip file, it seems as though I'm unable to compress the flow folder again and...
Read more >Import & Export Surveys
When you export your survey as a Word document, this document will contain all of the questions, blocks, page breaks, and answer choices...
Read more >grid-auto-flow - CSS: Cascading Style Sheets - MDN Web Docs
The grid-auto-flow CSS property controls how the auto-placement algorithm works, specifying exactly how auto-placed items get flowed into ...
Read more >Horizontally Scaling for User Volume with Distributed ...
Using configuration merge, you can deploy a distributed cache cluster by calling separate merge files for the data server and the application servers,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Leaving this here since I had the same issue and it wasn’t clear to me from the documentation.
What may happen if you’re running on an EC2 server behind a load balancer is:
So you can use the CacheStorage instead in your admin.py, for example:
In our case, we’re using the
ImportExportMixin
in multiple classes, so I added this:And replaced on the admin classes that were using it:
@Bubbassauro you are a lifesaver. I couldnt figure out why local was fine and production crashed until I found this https://stackoverflow.com/a/42452966 and this thread here.
In my case, I just temporarily removed all but one instances from the LB and ran the import. I didnt want to take a risk with CacheStorage which I understand needs memcache. Each of my EC2 instances has its own memcache, and all are synced, but I wasnt sure whether that would still work. I also didnt know how the the 1MB per key limit would affect when importing 1000s of records.
PS: This is such an excellent library, but the documentation is really lacking.