Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MeshCentral v1.1.37 | Linux | k3s/Container | PostgreSQL: autobackup not working since v1.1.34 #6676

Open
v3DJG6GL opened this issue Jan 9, 2025 · 5 comments
Labels

Comments

@v3DJG6GL
Copy link

v3DJG6GL commented Jan 9, 2025

Describe the bug
Since v1.1.34, my MeshCentral instance doesn't makes any further backups.
I do see following server error message:
WARNING: Unable to find pg_dump, PostgreSQL database auto-backup will not be performed.
Nothing has been changed on my side, a pg_dump location wasn't specified before. But even after setting the default value (see below), the backups doesn't work anymore.

To Reproduce
Steps to reproduce the behavior:

Expected behavior
I would expect a working backup as it was before.

Screenshots
Screenshot 2025-01-09 at 12-45-17 MeshCentral

Server Software (please complete the following information):

  • OS: Linux (TrueNAS Scale)
  • Virtualization: k3s/Container
  • Network: -
  • Version: v1.1.37
  • Node: v22.11.0
  • Arch: x64
  • database: PostgreSQL

Additional context
I have tried configuring additional values that seems to be introduced with e58d659

Here are my autobackup configurations:

    autobackup:
      pgDumpPath: pg_dump
      backupIntervalHours: 24
      keepLastDaysBackup: 10
      zipCompression: 5
      zipPassword: ""
      backupPath: /opt/meshcentral/meshcentral-backup
      backupName: meshcentral-autobackup-
      backupWebFolders: true
      backupOtherFolders: true

Before, my backups were working flawlessly. It seems that with the introducion of these new values, something got messed up on my server...?

here the console output of backupconfig:

DB Name: meshcentral
DB Type: PostgreSQL
BackupPath: /opt/meshcentral/meshcentral-backup
BackupFile: meshcentral-autobackup-2025-01-09-14-02.zip
Backup Interval (Hours): 24
Keep Last Backups (Days): 30
Backup other folders: /opt/meshcentral/meshcentral-files, /opt/meshcentral/meshcentral-recordings
Backup webfolders: 
Backup IgnoreFilesGlob: 
Backup SkipFoldersGlob:

Some values - e.g. pgDumpPath - are not visible here. Is this normal?
Your config.json file

{         
  "$schema": "http://info.meshcentral.com/downloads/meshcentral-config-schema.json",   
  "domains": {       
    "": { 
      "agentConfig": [          
        "webSocketMaskOverride=1"          
      ],  
      "agentCustomization": {   
        "backgroundColor": "#ffffff",      
        "companyName": "REDACTED Mesh Agent",   
        "description": "REDACTED | Mesh Agent Background Service",    
        "displayName": "REDACTED | MeshCentral Agent",     
        "fileName": "REDACTED_meshagent",       
        "foregroundColor": "#000000",      
        "image": "meshcentral_agent_logo.png",       
        "serviceName": "REDACTED Mesh Agent"    
      },  
      "certUrl": "https://meshcentral.REDACTED",
      "clipboardGet": true,     
      "clipboardSet": true,     
      "deviceMeshRouterLinks": {
        "rdp": true, 
        "scp": true, 
        "ssh": true  
      },  
      "geoLocation": true,      
      "ipkvm": false,
      "localSessionRecording": true,       
      "minify": false,          
      "mobileSite": true,       
      "mstsc": true, 
      "myServer": {  
        "Backup": true,         
        "Console": true,        
        "ErrorLog": true,       
        "Restore": true,        
        "Trace": true,          
        "Upgrade": false        
      },  
      "newAccounts": false,     
      "nightMode": 0,
      "novnc": true, 
      "siteStyle": 3,
      "ssh": true,   
      "title": "MeshCentral | REDACTED",        
      "title2": "REDACTED",          
      "userNameIsEmail": false, 
      "welcomeText": "Welcome to REDACTED's MeshCentral"   
    }     
  },      
  "settings": {      
    "LANonly": false,
    "WANonly": false,
    "agentCoreDump": false,     
    "agentIdleTimeout": 120,    
    "agentLogDump": false,      
    "agentPing": 60, 
    "agentPong": 60, 
    "agentWsCompression": true, 
    "aliasPort": 443,
    "allowFraming": false,      
    "allowHighQualityDesktop": true,       
    "allowLoginToken": false,   
    "autobackup": {  
      "backupIntervalHours": 24,
      "backupName": "meshcentral-autobackup-",         
      "backupOtherFolders": true,          
      "backupPath": "/opt/meshcentral/meshcentral-backup",       
      "backupWebFolders": true, 
      "keepLastDaysBackup": 30, 
      "pgDumpPath": "pg_dump",  
      "zipCompression": 5       
    },    
    "browserPing": 60,          
    "browserPong": 60,          
    "cert": "meshcentral.REDACTED",  
    "cleanNpmCacheOnUpdate": false,        
    "compression": true,        
    "dbExpire": {    
      "events": 1728000,        
      "powerevents": 864000,    
      "statsevents": 2592000    
    },    
    "keepCerts": false,         
    "maxInvalid2fa": {          
      "coolofftime": 360,       
      "count": 10,   
      "time": 120    
    },    
    "maxInvalidLogin": {        
      "coolofftime": 360,       
      "count": 10,   
      "time": 120    
    },    
    "newAccounts": false,       
    "nice404": true, 
    "plugins": {     
      "enabled": true
    },    
    "port": 10205,   
    "postgres": {    
      "database": "meshcentral",
      "host": "meshcentral-cnpg-main-rw",  
      "password": "REDACTED",   
      "port": 5432,  
      "user": "app"  
    },    
    "selfUpdate": false,        
    "sessionKey": "REDACTED", 
    "sessionSameSite": "lax",   
    "sessionTime": 60,          
    "tlsOffload": "172.16.0.0/16",         
    "webRTC": true,  
    "wsCompression": true          

EDIT:
Here the console ouptut of autobackup:

> autobackup
Starting auto-backup...
Creating a NON-ENCRYPTED ZIP
Backup failed (100)
Creating a NON-ENCRYPTED ZIP
Backup failed (100)
@v3DJG6GL v3DJG6GL added the bug label Jan 9, 2025
@si458
Copy link
Collaborator

si458 commented Jan 9, 2025

This will be because you haven't set the path correctly, but also, u shouldn't need to set it?

You currently have it set to "pgDumpPath": "pg_dump"

The path needs to be absolute, not just a file name.

Have u tried removing that line, restarting the container, and then seeing if it can do the autobackup ?

If so what container image are u using? As im sure the pg_dump is included in our image for this reason

@v3DJG6GL
Copy link
Author

v3DJG6GL commented Jan 9, 2025

Have u tried removing that line, restarting the container, and then seeing if it can do the autobackup ?

I'll just try that - but that seems to be like it was before...?
I've added "pgDumpPath": "pg_dump" just today. Before, it didn't worked either since v1.1.34

If so what container image are u using? As im sure the pg_dump is included in our image for this reason

That's what I thought too. But I couldn't find pg_dump anywhere...
I am using your official container:

repo: ghcr.io/ylianst/meshcentral
tag:  1.1.37@sha256:caca1ee285c77909d0802343f19162920d73010ed7803a2576ec4cd20b4b9d6e

@v3DJG6GL
Copy link
Author

v3DJG6GL commented Jan 9, 2025

Have u tried removing that line, restarting the container, and then seeing if it can do the autobackup ?

Just removed this config line and tried it again: autobackup is still not working and the same error ouptut as before.

@si458
Copy link
Collaborator

si458 commented Jan 9, 2025

Oh I've just realised! We include mongodb in the docker image And not the postgres! This has to be installed manually inside the container!!!
I will have a look when I get home see what we can sort out including the postgres backup cli tools etc

@v3DJG6GL
Copy link
Author

v3DJG6GL commented Jan 9, 2025

Great, thanks a lot :)

But it seemed to be working until v1.1.33 - were these postgres files included until then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants