MongoDB broken after file upload

Hi all!

I run a small Rocket Chat instance at my home for me and a frew friends via docker-compose. Now I ran into unexpected trouble.


Recently, I sent an MP3 file as a reply in a thread. After successfully uploading, I saw a truncated error message in the GUI (containing the word oplog, which is why I think i saw the full exception), and shortly after the whole server was down.
When inspecting the docker containers, I saw that the MongoDB container is constantly restarting. Its log gives me this exception:
DBException::toString(): Location17322: write to oplog failed: DocTooLargeForCapped: document doesn't fit in capped collection. size: 124 storageSize:134217728

I’m aware that there is a posting here with a similar topic, but it does not contain the solution to my problem. The exception message is the same, but it is solved in a way that’s not helping me.

Server Setup Information

  • Version of Rocket.Chat Server: 3.8.3
  • Operating System: Ubuntu Server 18.04 LTS
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Can’t tell because the die DB’s container goes down immediately, but it’s the stock mongo 4.0 image.
  • MongoDB Version: 4.0

Here is the corresponding part of my docker-compose.yaml:

    container_name: rc_mongo
    image: mongo:4.0
    restart: unless-stopped
      - db:/data/db
      - dump:/dump
    command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1
      - "traefik.enable=false"
      - default

What I wish for

My knowledge of MongoDB is limited, so I’d be glad to know if there is a way to temporarily, say, increase the size of the Oplog with an additional parameter to the docker start command.

Additional Notes

My belief that the file caused the problem is based on that I saw the error message right after uploading and the general temporal cohesion. Which is odd on itself, because this was not at all the first time I uploaded a file of this size to my Rocket Chat, and never ever have I encountered any problems. Therefore, it might just be coincidence.