RocketChat / RocketChat/Rocket.Chat

Image uploads fail when /tmp/ufs directory does not exist

Open
#20,173 1 comment 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:

For whatever reason the ufs directory in /tmp was missing. Image uploads fail if that is the case. There is an error message in the browser, but it does only state that a file in /tmp/ufs is missing not that the directory is missing.

Steps to reproduce:
  1. cd /tmp; rm -r ufs
  2. try to upload an image to a channel in a rocket.chat instance
Expected behavior:
  • /tmp/ufs directory is created, then file put there
  • error with the information that the directory to upload to does not exist
Actual behavior:
  • upload fails
  • error message shown states the file /tmp/ufs/ does not exist. (that is technically true but not helpful)
Server Setup Information:
Client Setup Information
  • Desktop App or Browser Version: Safari 14.0.3
  • Operating System: macOS 11
Additional context
Relevant logs:

Browser: [Error] Failed to load resource: the server responded with a status of 400 () (PaMv9AAWxemH7B4Si, line 0) https://regenbogenchat.queer-lexikon.net/api/v1/rooms.upload/PaMv9AAWxemH7B4Si

Server: server log has no entries from today.

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 failure through the /api/v1/rooms.upload endpoint after removing /tmp/ufs. Trace the upload handling and temporary-file path, then make the missing-directory behavior match the expected outcome: create /tmp/ufs before storing the file or report that the upload directory is absent. Confirm the browser error is more informative.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.