RocketChat / RocketChat/Rocket.Chat

Custom Emoji Filesystem settings caused the program failed to start

Open
#26,533 2 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:

I edited Custom Emoji Filesystem settings and restarted the server. However, it seems that the server have no permissions in this path and fail to start. I cannot remove the previous edit since I cannot login to the control panel.
Using the command
journalctl -fu snap.rocketchat-server.rocketchat-server
shows that
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: Error: EACCES: permission denied, mkdir '/home/ubuntu/emoji'

Steps to reproduce:
  1. Go to Administration > Settings > Custom Emoji Filesystem.
  2. Choose filesystem and input /home/ubuntu/emoji (Any path that rocket.chat-server have no permission).
  3. Restart the program.
Expected behavior:

There should be some kind of ways to remove such error edits.

Actual behavior:

The server failed to restart.

Server Setup Information:
  • Operating System: Ubuntu 20.04
  • Deployment Method: snap
  • Number of Running Instances: 1
Relevant logs:

Aug 10 11:23:49 VM-12-11-ubuntu systemd[1]: Started Service for snap application rocketchat-server.rocketchat-server.
Aug 10 11:23:49 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483511]: node $SNAP/main.js
Aug 10 11:23:57 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: LocalStore: store created at
Aug 10 11:23:57 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: LocalStore: store created at
Aug 10 11:23:57 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: LocalStore: store created at
Aug 10 11:23:58 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: MessageType.render is deprecated. Use MessageType.message instead. livechat_webrtc_video_call
Aug 10 11:23:59 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: {"level":40,"time":"2022-08-10T03:23:59.260Z","pid":1483567,"hostname":"VM-12-11-ubuntu","name":"VoIPService","msg":"Voip is not enabled. Cant start the service"}
Aug 10 11:24:01 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: {"level":40,"time":"2022-08-10T03:24:01.933Z","pid":1483567,"hostname":"VM-12-11-ubuntu","name":"VoIPService","msg":"VoIP service already stopped"}
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: {"level":51,"time":"2022-08-10T03:24:02.441Z","pid":1483567,"hostname":"VM-12-11-ubuntu","name":"Migrations","msg":"Not migrating, already at version 265"}
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: /snap/rocketchat-server/1523/programs/server/node_modules/fibers/future.js:280
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: throw(ex);
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: ^
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: Error: EACCES: permission denied, mkdir '/home/ubuntu/emoji'
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: at Object.mkdirSync (fs.js:1013:3)
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: at mkdirpNativeSync (/snap/rocketchat-server/1523/programs/server/npm/node_modules/mkdirp/lib/mkdirp-native.js:29:10)
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: at Function.mkdirpSync [as sync] (/snap/rocketchat-server/1523/programs/server/npm/node_modules/mkdirp/index.js:21:7)
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: at new RocketChatFile.FileSystem (app/file/server/file.server.js:160:10)
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: at app/emoji-custom/server/startup/emoji-custom.js:33:38
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: at Function.time (/snap/rocketchat-server/1523/programs/server/profile.js:273:30)
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: at /snap/rocketchat-server/1523/programs/server/boot.js:415:15
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: at /snap/rocketchat-server/1523/programs/server/boot.js:465:7
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: at Function.run (/snap/rocketchat-server/1523/programs/server/profile.js:280:14)
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: at /snap/rocketchat-server/1523/programs/server/boot.js:463:13 {
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: errno: -13,
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: syscall: 'mkdir',
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: code: 'EACCES',
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: path: '/home/ubuntu/emoji'
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483567]: }
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483696]: pkill: pidfile not valid
Aug 10 11:24:02 VM-12-11-ubuntu rocketchat-server.rocketchat-server[1483696]: Try `pkill --help' for more information.
Aug 10 11:24:02 VM-12-11-ubuntu systemd[1]: snap.rocketchat-server.rocketchat-server.service: Control process exited, code=exited, status=1/FAILURE
Aug 10 11:24:02 VM-12-11-ubuntu systemd[1]: snap.rocketchat-server.rocketchat-server.service: Failed with result 'exit-code'.
Aug 10 11:24:03 VM-12-11-ubuntu systemd[1]: snap.rocketchat-server.rocketchat-server.service: Scheduled restart job, restart counter is at 60.
Aug 10 11:24:03 VM-12-11-ubuntu systemd[1]: Stopped Service for snap application rocketchat-server.rocketchat-server.

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/emoji-custom/server/startup/emoji-custom.js and app/file/server/file.server.js, following the Custom Emoji Filesystem setting into the mkdir failure shown in the logs. Determine how startup handles an inaccessible path and verify that the server can recover from an invalid setting and that the setting can be corrected without control-panel access.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
backend
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.