Where is rocketchat's log file?

Description

Install rocket chat on a private cloud VM with:
Ubuntu 16.04
40GB Disk
after 2 month running, VM’s disk is full, tried to extend disk,
I did resize volume but can’t extend the partition because no disk space remain to install other package to resize disk partition
So, where is rocketchat’s log file? Where I could temporary delete some to get disk space?
Regards, LongNX.

Server Setup Information

  • Version of Rocket.Chat Server:
  • Operating System: Ubuntu 16.04
  • Deployment Method: snap
  • Number of Running Instances: 1
  • DB Replicaset Oplog: not sure, use deafult rocket setting
  • NodeJS Version: not sure, use deafult rocket setting
  • MongoDB Version: not sure, use deafult rocket setting
  • Proxy: ? not sure, use deafult rocket setting
  • Firewalls involved: not sure, use deafult rocket setting

Any additional Information


ubuntu@ds1-tytodc-longnx-rocketchat2:~
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            2.0G     0  2.0G   0% /dev
tmpfs           394M  6.0M  388M   2% /run
/dev/sda1        39G   39G     0 100% /
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/loop1      249M  249M     0 100% /snap/rocketchat-server/1377
/dev/loop0       89M   89M     0 100% /snap/core/6964
/dev/sdb         20G   44M   19G   1% /mnt/data
tmpfs           394M     0  394M   0% /run/user/1000
ubuntu@ds1-tytodc-longnx-rocketchat2:~
$ sudo fdisk -l
Disk /dev/loop0: 88.4 MiB, 92733440 bytes, 181120 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 249 MiB, 261066752 bytes, 509896 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes




Disk /dev/sda: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb4cd243e

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1  *        2048 81885183 81883136   39G 83 Linux
/dev/sda2       81887230 83884031  1996802  975M  5 Extended
/dev/sda5       81887232 83884031  1996800  975M 82 Linux swap / Solaris


Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


ubuntu@ds1-tytodc-longnx-rocketchat2:~
$ growpart /dev/sda 1
mkdir: cannot create directory ‘/tmp/growpart.4302’: No space left on device
FAILED: failed to make temp dir

No way to access logs command line?

nm… i see it writes to /var/log/messages

This is a popular post but the answer to the original post won’t be to delete logs.

Where do *buntu servers store logs:

You can also use some of these commands in a terminal:

journactl

journalctl -u snapd

journalctl -u nginx.service

journalctl -f

journalctl --disk-usage

journalctl -xe

More information on snaps specifically here:

For docker logs you can use something like:

docker logs -f <container_name>

As for this particular issue logs don’t usually take up that much space, relatively.

It is most likely that the MongoDB inside the snap was using GridFS and got filled with files.

First thing is can you delete any other files to make space?

If not then follow the above FAQ, stop Rocket.Chat, backup, remove the snap, increase the disk size, and restore.

Make sure you restore to the exact same version you backed up from.

There may be other answers but hope this helps people searching for log questions.

2 Likes

Hi, I’m back here again, 4 months ago, I can’t figure out how to delete file, and my data is quite small, so I erase everything and start over with a 100GB disk and config to Rocket to auto delete file & message every 3 months, but now it failed again,
can you give me a guide to delete my users’ files in the MongoDB?