# Cannot upload a file larger than 30MB

**URL:** <https://forums.rocket.chat/t/cannot-upload-a-file-larger-than-30mb/4809>\
**Category:** Community Support\
**Created:** [October 11, 2019, 5:26am UTC](https://forums.rocket.chat/t/cannot-upload-a-file-larger-than-30mb/4809 "2019-10-11T05:26:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![noopy](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/noopy/32/1294_2.png) [@noopy](https://forums.rocket.chat/u/noopy)\
**Post date:** [October 11, 2019, 5:26am UTC](https://forums.rocket.chat/t/cannot-upload-a-file-larger-than-30mb/4809/1 "2019-10-11T05:26:29Z")

</div>

Running into an issue where mongodb (GridFS) isn’t accepting a file upload larger than 30MB. Using Snap and honestly have no idea how to edit mongodb values.

Error:

`Exception while invoking method 'ufsComplete' { MongoError: Executor error during find command: OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit. at queryCallback (/snap/rocketchat-server/1399/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/cursor.js:248:25) at /snap/rocketchat-server/1399/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:532:18 at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickDomainCallback (internal/process/next_tick.js:218:9) ok: 0, errmsg: 'Executor error during find command: OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit.', code: 96, codeName: 'OperationFailed', name: 'MongoError', [Symbol(mongoErrorContextSymbol)]: {} }`

- Version of Rocket.Chat Server: 1.3.2
- Operating System: Ubuntu 18.04
- Deployment Method: Snap
- Number of Running Instances: 1
- DB Replicaset Oplog: n/a
- NodeJS Version: 8.11.4
- MongoDB Version: 3.4.20
- Proxy: nginx

Thank you for any/all help!

---

<div class="post-metadata">

**Author:** ![noopy](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/noopy/32/1294_2.png) [@noopy](https://forums.rocket.chat/u/noopy)\
**Post date:** [October 11, 2019, 2:44pm UTC](https://forums.rocket.chat/t/cannot-upload-a-file-larger-than-30mb/4809/2 "2019-10-11T14:44:35Z")

</div>

To be clear, the system has enough RAM to cover the upload. It fails at 100%.

---

<div class="post-metadata">

**Author:** ![reetp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/reetp/32/5546_2.png) [@reetp](https://forums.rocket.chat/u/reetp)\
**Post date:** [October 15, 2019, 12:39pm UTC](https://forums.rocket.chat/t/cannot-upload-a-file-larger-than-30mb/4809/3 "2019-10-15T12:39:17Z")

</div>

I think this is an Issue in Mongo itself.

“Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit”

GridFS is ok for a low volume of small files but it is useless for anything larger really.

You should really be using local file storage, Minio or one of the other storage methods.
