Summary

Fixes Rocket.Chat deployments failing due to MongoDB dependency being marked as unhealthy.

The MongoDB container was starting successfully but failing its healthcheck, which caused Coolify to stop the deployment.

Root Cause

  1. MongoDB 6+ images no longer include the mongo shell, but the healthcheck was still using it.
  2. Rocket.Chat requires MongoDB to run as a replica set (even for single-node setups).
  3. The MongoDB container hostname did not match the advertised hostname used by the replica set configuration.

This resulted in:

  • Unhealthy MongoDB container
  • Replica set initialization errors
  • Rocket.Chat failing to start

Fix

This PR updates the Rocket.Chat MongoDB dependency to:

  • Use mongosh --eval "db.adminCommand('ping')" for the healthcheck
  • Start MongoDB with replica set support enabled
  • Align the container hostname with the advertised replica set hostname

Verification

Tested locally on Linux (WSL2 + Docker Engine):

  • MongoDB container starts and becomes HEALTHY after initialization
  • Replica set initializes successfully without hostname errors
  • Rocket.Chat successfully connects to MongoDB and proceeds with startup
    • (Rocket.Chat exits only if ROOT_URL is missing, which is expected behavior)

Result

Rocket.Chat deployments no longer fail due to MongoDB being marked unhealthy.

rocketchat-mongodb-fix-demo.zip

/claim #7941

Claim

Total prize pool $5
Total paid $0
Status Pending
Submitted January 13, 2026
Last updated January 13, 2026

Contributors

AY

ayush-agrawal-07-30-gmail-com

@ayush-agrawal-07-30-gmail-com

100%

Sponsors

PA

Paul Albrecht

@paul-hph

$5