RocketChat / RocketChat/Rocket.Chat

Uploading file bigger than the size limit lead to rocketchat server to stop/crash

Open
#23,583 2 comments 2 reactions 0 assignees View on GitHub

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:
image
at the end of the transfer, (100% uploaded) the server became unresponsive

Steps to reproduce:
  1. set a upload size limit
  2. upload a bigger file than the limit
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.