I’m trying to download a large file (larger then 100 MB) from gridFs:
ObjectId objectId = new ObjectId(item.RawDataFileId);
file = gridFsBucket.DownloadAsBytes(objectId);
I get this error:
MongoDB.Driver.MongoCommandException: Command find failed: Executor error during find command :: caused by :: Sort exceeded memory limit of 104857600 bytes, but did not opt in to external sorting..
The app (.net core) is running on a windows service if it counts, I get this error only on the server, in the local environment everything is working perfectly.
2
Answers
My crew and I had the same problem a long time ago, and we did not find any reasonable issue and/or any details about it on Stack Overflow/Google.
So we investigate this issue in other environments (not dev/test) and find out that the issue is no longer happening.
After continuing to investigate this issue, I started to clean space from the test server itself (where the issue was happening) and it started to work without any further errors (Althouse even before there was enough space).
Still can not point the finger at why it happened, but I do encourage you to check the disk space.
P.S. If you do find out why it was happening, please post it here because there are not enough details about this error.
Make sure that fs.chunks has proper indexes. (It should have indexes, if not do create index explititly)