Repository navigation
Description
CloudPanel version(s) affected
2.5.4
Description
The nightly database backup job produces empty files for every database on the host. Each .sql.gz is exactly 20 bytes — a valid gzip header wrapping a zero-byte payload:
1f8b 0800 0000 0000 0003 0300 0000 0000 0000 0000
i.e. gzip compressing empty input. No database is backed up, and nothing is reported in the UI or in any log.
The failure is not in mysqldump. Running the backup command manually surfaces the real error, which originates in cleanUpBackups():
Command " : /usr/bin/sudo /usr/bin/find /home/<user>/backups/databases -mindepth 1 -type d -mtime +7 -exec rm -rf {} \; > /dev/null 2>&1" failed, error message: ,
#0 CommandExecutor->execute()
#1 DatabaseBackupCommand->cleanUpBackups()
#2 DatabaseBackupCommand->createDatabaseDump()
Two things stand out:
- The failing command is the retention cleanup (
sudo find … -mtime +7 -exec rm -rf), not the dump itself. error message: ,is empty — because the command redirects its own stderr to/dev/null, so the actual cause is discarded before it can be reported. This makes the failure undiagnosable from the logs.
Scope: this affects every user on the host, not one site. The error log lists all 17 accounts in my case.
The databases themselves are fine — dumping them manually succeeds with exit 0 and full output.
How to reproduce
-
On a host with CloudPanel 2.5.4, wait for the nightly job (
/etc/cron.d/clp,15 3 * * *) or run it directly as root:su -s /bin/bash -c '/usr/bin/clpctl db:backup' clp -
Observe the
Command " : /usr/bin/sudo /usr/bin/find …" failed, error message: ,output. -
Check the resulting file:
ls -l /home/<user>/backups/databases/<db>/$(date +%F)/Every file is 20 bytes.
zcatreturns nothing. -
Confirm the database itself is dumpable, proving the fault is in the cleanup step rather than the dump:
mysqldump -hlocalhost -u<user> -p<pass> <db> --skip-comments | wc -cThis returns the full size and exit 0.
Possible Solution
-
Do not discard the error. The
> /dev/null 2>&1on the cleanup command means the failure reason is thrown away and then reported as an empty string. Capturing stderr (or logging it before discarding) would make this class of failure diagnosable. -
Make the cleanup non-fatal. A failure to prune old backups should not prevent the database dump from being written. Currently
cleanUpBackups()is called fromcreateDatabaseDump(), so a cleanup error appears to abort the whole operation. -
Consider whether
sudois required for the cleanup at all, given the files are owned by the site user.
Additional Context
-
This is not new. Issue Cloudpanel stopped automatically backing up Mysql to Dropbox, it is only backing up the files in the htdocs folder #595 (Feb 2025, CloudPanel 2.5.0) reports the identical failing command and the same
error message: ,output. That thread was closed with a redirect to Discord, so no public resolution exists. -
Related reports: Backups created, but not repecting retention setting #715 (retention not respected), Backup schedule creates stale database dumps - no UI option to fix this #751 (stale dumps), Backup not work correctly #807 (always the 03:15 dump), Automated Backups to Google Drive Not Working #819 (remote backups silently stopped).
-
The
sudobinary on this host was updated on 2026-10-06 (1.9.9-1ubuntu2.7, CVE-2026-96512) and the failures began 2026-10-07 — but since Cloudpanel stopped automatically backing up Mysql to Dropbox, it is only backing up the files in the htdocs folder #595 shows the same failure in Feb 2025, the sudo update is unlikely to be the root cause. Noted only for completeness. -
visudo -cparses all sudoers files OK, and/etc/sudoers.d/cloudpanelcontainsclp ALL=(ALL) NOPASSWD: ALL, so this is not a sudoers syntax or permission problem. -
Impact: CloudPanel is the only backup route for some databases on this host, so those currently have no restore point at all. With
--retentionPeriod=7, each failing night is lost.
Additional Context
No response
Activity
jacmaes commentedon Oct 16, 2026
Update — correcting one claim, and adding new evidence
Two corrections and some new data after further investigation.
1. The sudo timing in my original report was wrong — please disregard it
I noted that
sudowas updated 2026-10-06 and that failures began 2026-10-07. That was a misreading on my part: the binary mtime is the build date, not the install date. The changelog and the binaries share the same timestamp:The actual install was:
The empty backups began 2026-10-07, a week before that upgrade. So the sudo version is not the cause. Apologies for the noise.
2. Retention appears to be working — the cleanUpBackups() error may be spurious
I reported the
sudo find ... -mtime +7 -exec rm -rffailure as the cause. But checking the directories themselves:Old directories are being pruned. So the logged failure does not prevent cleanup from working, and it is probably not what produces the empty files. The empty
error message: ,is still a genuine diagnosability problem worth fixing, but I no longer believe it is the root cause.3. New: the same CloudPanel version works on another host
Host B's most recent backup succeeded today: 169,124 bytes, decompressing to 894,581 bytes. So this appears to be host-specific rather than a universal defect in 2.5.4.
4. Workaround
For anyone else hitting this, an independent
mysqldumpcron running as the site user works around it entirely, without touching CloudPanel:5. Root cause?
CloudPanel's master credential fails with ERROR 1045
The site's own user dumps fine — proving the database is healthy
The failure is silent because the error is discarded
Suggested fix: validate the master credential before dumping, and surface the error rather than swallowing it