Typhonragewind / meshcentral-docker

163 stars 46 forks source link

Unable to find mongodump #36

Closed yodaphone closed 7 months ago

yodaphone commented 11 months ago

Hi

I used your docker-compose & created the container. everything works but i get this error message on the server

Server Warnings WARNING: Unable to find mongodump, MongoDB database auto-backup will not be performed.

I used your compose file as it with my modifications. I can run the mongodump command in the mongocentral_db container just fine but see this message. this is my compose file. can you please let me know how to solve this?

 mongodb:
    container_name: meshcentral_db
    restart: always
    image: mongo:latest
    expose:
        - 27017
    volumes:
        - '/opt/meshcentral/database:/data/db'

 meshcentral:
    restart: always
    container_name: meshcentral
    depends_on:
        - 'mongodb'
    image: typhonragewind/meshcentral:latest
    ports:
        - 8086:443  #MeshCentral will moan and try everything not to use port 80, but you can also use it if you so desire, just change the config.json according to your needs
    environment:
        - HOSTNAME=central.foo.com     #your hostname
        - REVERSE_PROXY=192.168.11.6     #set to your reverse proxy IP if you want to put meshcentral behind a reverse proxy
        - REVERSE_PROXY_TLS_PORT=
        - IFRAME=false    #set to true if you wish to enable iframe support
        - ALLOW_NEW_ACCOUNTS=false    #set to false if you want disable self-service creation of new accounts besides the first (admin)
        - WEBRTC=false  #set to true to enable WebRTC - per documentation it is not officially released with meshcentral, but is solid enough to work with. Use with caution
        - NODE_ENV=production
        - BACKUPS_PW=XYZXHHS!!@!#  #password for the autobackup function
        - BACKUP_INTERVAL=24 # Interval in hours for the autobackup function
        - BACKUP_KEEP_DAYS=10 #number of days of backups the function keeps
    volumes:
        - ./meshcentral/data:/opt/meshcentral/meshcentral-data    #config.json and other important files live here. A must for data persistence
        - ./meshcentral/user_files:/opt/meshcentral/meshcentral-files    #where file uploads for users live
        - ./meshcentral/backups:/opt/meshcentral/meshcentral-backups     #Backups location

this is my config.json

{
  "$schema": "http://info.meshcentral.com/downloads/meshcentral-config-schema.json",
  "settings": {
    "cert": "central.foo.com",
    "mongodb": "mongodb://mongodb:27017/mesh",
    "mongodbcol": "mesh",
    "_WANonly": true,
    "_LANonly": true,
    "_sessionKey": "MyReallySecretPassword1",
    "port": 443,
    "_aliasPort": 443,
    "redirPort": 80,
    "_redirAliasPort": 80,
    "AgentPong": 300,
    "TLSOffload": false,
    "SelfUpdate": false,
    "AllowFraming": "false",
    "WebRTC": "false",
    "AutoBackup": {
      "backupPath": "/opt/meshcentral/meshcentral-backups",
      "backupInvervalHours": "24",
      "keepLastDaysBackup": "10",
      "zippassword": "tpM#%"
    }
  },
  "domains": {
        "": {
        "title": "Central",
    "_title2": "Servername",
    "_minify": true,
    "NewAccounts": "false",
        "_userNameIsEmail": true,
    "certUrl": "https://192.168.11.1:"
        }
  },
  "_letsencrypt": {
    "__comment__": "Requires NodeJS 8.x or better, Go to https://letsdebug.net/ first before>",
    "_email": "myemail@mydomain.com",
    "_names": "myserver.mydomain.com",
        "production": false
  }
}
Pinkbyte commented 9 months ago

The problem is that Meshcentral fails to use mongodump from container as it is too old(3.4.14 if i remember correctly) for your database (problem is regarding with mongodb snapshots). Lowering mongodb version to 3.6 (minimum supported by current MeshCentral) will do the trick.

As a workaround you can dump your database and try to restore it on older mongodb version. I rolled back from mongodb 5.0 to 3.6, no issues so far.

But i suggest author to try updating base container image to later Debian version (currently it is node:lts-buster-slim, which is Debian 10)

Pinkbyte commented 7 months ago

@Typhonragewind, mind if i ask how did you fix this? main/builds/mongoDB/Dockerfile still references node:lts-buster-slim, so it is using ancient MongoDB, while builds/regular/Dockerfile using node:lts-slim, which is Debian 12

Update: apparently newer version of Debian does not ship mongo-tools package[1]

[1] - https://nspeaks.com/install-mongodb-on-debian-12

Typhonragewind commented 7 months ago

@Pinkbyte Hmm, it seems i forgot to save the changes on that one. Thanks for letting me know!