RocketChat / RocketChat/Rocket.Chat
Image uploads fail when /tmp/ufs directory does not exist
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:
- cd /tmp; rm -r ufs
- 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:
- Version of Rocket.Chat Server: 3.10.2
- Operating System: CentOS 7 (Uberspace)
- Deployment Method: https://lab.uberspace.de/guide_rocketchat.html?highlight=rocket
- Number of Running Instances: 1
- DB Replicaset Oplog:
- NodeJS Version: 12.19.0
- MongoDB Version: db version v4.2.6
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
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 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