RocketChat / RocketChat/Rocket.Chat

Attempt to upload animated gif image file with size +5Mb gives POST response 504 - Gateway Time-out

Open
#31,405 4 comments 0 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:

When I try to upload an animated gif file, if it is 5.2Mb the POST fails with error 504 Gateway timeout.

If I try to upload a smaller animated gif, like 2 or 4Mb, the upload goes without issues, in the same way that if I try to upload a 9Mb .jpg image there is also no problem.

It seems that there is a specific problem with +5Mb gif files.

See video (be patient, the video not freezes on (pending) it takes a while to show the timeout):
UploadAnimatedGif5 2Mb

Storage Type: Filesystem
Maximum File Upload Size (in bytes): 10485760 (10mb)
Nginx configuration client_max_body_size 10mb

Steps to reproduce:
  1. Try to upload an animated .gif file with 5.2Mb
Expected behavior:

File sucessfully uploaded:
POST to https://server/api/v1/rooms.upload/ returns 200 - OK

Actual behavior:

Upload fails:
POST to https://server/api/v1/rooms.upload/ returns 504 - Gateway Time-out

Server Setup Information:
  • Version of Rocket.Chat Server: 6.5.0
  • Operating System: Linux
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version:
  • MongoDB Version:
Client Setup Information
  • Desktop Rocket.Chat Linux 3.9.11(snap) or Browser Version: Chrome Version 120.0.6099.199 (64-bit)
  • Operating System: Linux "Ubuntu 22.04.3 LTS" 64bit.

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 by reproducing the rooms.upload POST with an animated GIF around 5.2 MB, then compare it with the reported smaller GIF and 9 MB JPG cases. Review the Docker deployment and Nginx client_max_body_size setting alongside server and proxy logs; done means the GIF upload returns 200 OK rather than 504 under the stated 10 MB limits.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, nginx
Domain
api, backend, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.