RocketChat / RocketChat/Rocket.Chat
Pictures corrupting when using remote network drive w. caching in fstab
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 using the mobile Rocket.Chat app on android or the PC app to send one or more pictures to the Rocket.Chat instance, some of the uploaded pictures are corrupted (e.g. one half of the picture is black/transparent). This behaviour could be observed from us on multiple android phones (including three samsung galaxy s10+, a galaxy s20, an older a-series phone, etc) as well as PCs. Also, this does happen to almost every fifth pictures, especially when sending multiple pictures at once (but single pictures were also affected from time to time).
Steps to reproduce:
- Select one or multiple pictures from the app or from the PC and send them to the server
Expected behavior:
All pictures should be uploaded correctly and with full integrity.
Actual behavior:
Some pictures corrupt as seen in this screenshot:

When clicking on the image with the PC app or using the browser, the following can be observed:

On the android app, the same behaviour is seen. Furthermore, when downloading the file itself to the PC and opening it up with a picture viewer, this mess is shown:

This behaviour could also be observed when sharing pictures directly from the PC app/browser. File uploads on the other hand (for example a .zip-archive) seem to work just fine.
Server Setup Information:
- Version of Rocket.Chat Server: 3.9.3
- Operating System: Debian GNU/Linux 10 (buster)
- Deployment Method: Manual install using this guide: https://docs.rocket.chat/installation/manual-installation/debian/
- Number of Running Instances: 1
- DB Replicaset Oplog: Enabled
- NodeJS Version: v12.20.0
- MongoDB Version: 4.0.21
Client Setup Information
Android app:
- App Version: 4.13.0.22100
- Operating System: Android 10
PC app:
- App Version: 3.0.6
- Operating System: Windows 10 Pro Version 1909
Additional context
The instance does store all uploads (and custom emojis, etc) with the Storage Type FileSystem. The corresponding System Path is pointing to a folder which is mapped to a network drive using the static filesystem fstab. The user rocketchat has rwx permissions on this folder as seen in this picture:

This issue shows the same behaviour as we are getting.
Relevant logs:
Logs from the browser console:

Server logs (after updating to the newest version today):
I20201227-17:21:03.590(1) (migrations.js:120) Migrations: Migrating from version 209 -> 212
I20201227-17:21:03.597(1) (migrations.js:120) Migrations: Running up() on version 210
I20201227-17:21:03.614(1) (migrations.js:120) Migrations: Running up() on version 211
I20201227-17:21:05.022(1) (migrations.js:120) Migrations: Running up() on version 212
I20201227-17:21:05.042(1) (migrations.js:120) Migrations: Finished migrating.
I20201227-17:21:15.046(1) Not migrating, control is locked. Attempt 1/30. Trying again in 10 seconds.
I20201227-17:21:15.054(1) (migrations.js:120) Migrations: Not migrating, already at version 212
I20201227-17:21:20.478(1) Loaded the Apps Framework and loaded a total of 1 Apps!
I20201227-17:21:20.685(1) Using FileSystem for custom sounds storage
I20201227-17:21:20.696(1) Using FileSystem for custom emoji storage
I20201227-17:21:20.766(1) Updating process.env.MAIL_URL
I20201227-17:21:23.155(1) ➔ System ➔ startup
I20201227-17:21:23.156(1) ➔ +--------------------------------------+
I20201227-17:21:23.158(1) ➔ | SERVER RUNNING |
I20201227-17:21:23.159(1) ➔ +--------------------------------------+
I20201227-17:21:23.160(1) ➔ | |
I20201227-17:21:23.161(1) ➔ | Rocket.Chat Version: 3.9.3 |
I20201227-17:21:23.162(1) ➔ | NodeJS Version: 12.20.0 - x64 |
I20201227-17:21:23.163(1) ➔ | MongoDB Version: 4.0.21 |
I20201227-17:21:23.164(1) ➔ | MongoDB Engine: mmapv1 |
I20201227-17:21:23.165(1) ➔ | Platform: linux |
I20201227-17:21:23.167(1) ➔ | Process Port: 3000 |
I20201227-17:21:23.168(1) ➔ | Site URL: |
I20201227-17:21:23.168(1) ➔ | ReplicaSet OpLog: Enabled |
I20201227-17:21:23.169(1) ➔ | Commit Hash: e47dc05618 |
I20201227-17:21:23.170(1) ➔ | Commit Branch: HEAD |
I20201227-17:21:23.172(1) ➔ | |
I20201227-17:21:23.172(1) ➔ +--------------------------------------+ ```
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 image uploads through the FileSystem storage configured on the network-mounted fstab path, comparing them with ordinary file uploads. Done means uploads from the Android app and PC app remain intact and match the original images.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100