Error WPCreateBackup - database backup fails

Hi guys,

The Wordpress database-only backups are failing (silently…)
I’ve set up the remote backups to Wasabi, which is working for files+database but the database-only files are 500 bytes.
I checked the logs and found these errors:

Error WPCreateBackup … Error: YIKES! It looks like you’re running this as root. You probably meant to run this as the user that your WordPress installation exists under.

If you REALLY mean to run this as root, we won’t stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you’d like to continue as root, please run this again, adding this flag: --allow-root

If you’d like to run it as the user that this site is under, you can run the following to become the respective user:

sudo -u USER -i -- wp <command>

It seems though, that the command is already fires with the --allow-root parameter @ 2695:

command = ‘sudo -u %s %s -d error_reporting=0 /usr/bin/wp --allow-root --skip-plugins --skip-themes --path=%s db export %s/%s.sql’ % (
VHuser, FinalPHPPath, WPsitepath, self.tempPath, DataBaseName)

This is the same command as in the combined backup, in which it is working.

Any ideas?

I added –allow-root to all /usr/bin/wp calls in the file and now the DB backups work.

We have the same problem to 3m later. They didnt even fixed it. We are so dissapointed in CP alot is not working or bugged. ANd where did you add your dirty fix? And ofc this is not update proof. So each update we have re-edit this file. In out future project we will not advice our customers to use CP.

Nevermind we dont advice to add " --allow-root" thats a quick dirty fix and is not the solution and also like the message says: DANGEROUS.

The real fix is very easy (hint to CP)
CP forgot to add “sudo -u {VHuser}” please fix this. backups are so important. We payed 120$ for your addons and would like to have a working backup concept

file: /usr/local/CyberCP/plogical/

search for: #### Only Database === 3

you see 2 command

{FinalPHPPath} -d error_reporting=0 /usr/bin/wp config get DB_NAME --skip-plugins --skip-themes --path={WPsitepath}
{FinalPHPPath} -d error_reporting=0 /usr/bin/wp config get DB_USER --skip-plugins --skip-themes --path={WPsitepath}

it should be

sudo -u {VHuser} {FinalPHPPath} -d error_reporting=0 /usr/bin/wp config get DB_NAME --skip-plugins --skip-themes --path={WPsitepath}

sudo -u {VHuser} {FinalPHPPath} -d error_reporting=0 /usr/bin/wp config get DB_USER --skip-plugins --skip-themes --path={WPsitepath}