mgob
mgob copied to clipboard
Validation of scheduled backup fails with 'failed to execute restore command'
I'm running mgob in my Kubernetes cluster and noticed that my backups weren't uploading as expected. It appears that validation fails with an exception running the restore command, but I cannot seem to figure out what the issue is.
time="2024-09-30T11:54:32+02:00" level=info msg="Validation: connect to mongodb://mongodb:27017"
time="2024-09-30T11:54:32+02:00" level=info msg="new dump" archive=/tmp/backup-1727690072.gz err="backup validation failed: failed to execute restore command: mongorestore log 2024-09-30T11:54:32.202+0200\terror parsing command line options: error parsing positional arguments: provide only one polling interval in seconds and only one MongoDB connection string. Connection strings must begin with mongodb:// or mongodb+srv:// schemes 2024-09-30T11:54:32.202+0200\ttry 'mongorestore --help' for more information : exit status 1" mlog=/tmp/backup-1727690072.log plan=backup
time="2024-09-30T11:54:32+02:00" level=error msg="On demand backup failed backup validation failed: failed to execute restore command: mongorestore log 2024-09-30T11:54:32.202+0200\terror parsing command line options: error parsing positional arguments: provide only one polling interval in seconds and only one MongoDB connection string. Connection strings must begin with mongodb:// or mongodb+srv:// schemes 2024-09-30T11:54:32.202+0200\ttry 'mongorestore --help' for more information : exit status 1" plan=backup
My backup plan looks like this:
scheduler:
cron: "0 5 */1 * *"
retention: 5
timeout: 60 # In minutes
target:
host: mongodb
port: 27017
#params: "--ssl --authenticationDatabase admin" # Additional mongodump params, leave blank if not needed
noGzip: false # Disable gzip compression (false means compression is enabled)
retry:
attempts: 3
backoffFactor: 60 # backoff factor * (2 ^ attemptCount) seconds
# NOTE: I had the validation block here before, same issue as with commenting it out.
#validation:
# database:
# host: mongodb
# port: 27017
# noGzip: false
# database: test_restore # Database name for restore operation
s3:
url: https://s3.us-west-002.backblazeb2.com
bucket: "home-k8s-mongodb"
accessKey: "****"
secretKey: "****"
api: S3v4
As far as I saw in the code, the validation shouldn't even be triggered when commenting out the validation block, but for some reason it still triggers and fails. Also, triggering an on-demand backup via the REST api works just fine while the scheduled backup fails.
It appears that it has trouble connecting with the specified connection string, but creating the backup works just fine, so I'm not sure what the issue is here. Help would be greatly appreciated! :)
I agree, it shouldn't get triggered if you commenting it out. Not sure why tho.
same here