RocketChat / RocketChat/Rocket.Chat
Uploading file bigger than the size limit lead to rocketchat server to stop/crash
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
One of our user (admin rights) upload a big file (2GB) when the limit is set to:

at the end of the transfer, (100% uploaded) the server became unresponsive
Steps to reproduce:
- set a upload size limit
- upload a bigger file than the limit
- server crash
Expected behavior:
Message saying that the file is higher than the limit and not start the upload (or stop it when the limit is reached)
Actual behavior:
The rocketchat server went unresponsive, as well as the hosting server (ubuntu).
Server Setup Information:
- Version of Rocket.Chat Server: 3.18.1
- Operating System: Ubuntu 18.04.6 LTS
- Deployment Method: snap
- Number of Running Instances: 1
- DB Replicaset Oplog: 1
- NodeJS Version: 12.22.1 - x64
- MongoDB Version: 3.6.14
Client Setup Information
- Desktop App or Browser Version: Desktop 3.5.6
- Operating System: Windows 10
Additional context
Relevant logs:
Exception in callback of async function: RangeError [ERR_INVALID_OPT_VALUE] [ERR_INVALID_OPT_VALUE]: The value "2482641664" is invalid for option "size"
at Function.allocUnsafe (buffer.js:383:3)
at Function.concat (buffer.js:564:25)
at FileStream.<anonymous> (app/api/server/lib/getUploadFormData.js:18:81)
at FileStream.emit (events.js:326:22)
at FileStream.EventEmitter.emit (domain.js:483:12)
at endReadableNT (_stream_readable.js:1241:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
code: 'ERR_INVALID_OPT_VALUE'
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with app/api/server/lib/getUploadFormData.js at the line 18 stack-trace entry, then reproduce the upload using a configured size limit and an oversized file. Done means the server remains responsive and the client receives a message that the file exceeds the limit without completing the upload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100