Backup Error

Rob

Active Member
Hi

Backup manager is throwing this error:

"Missing linux binaries to create the backup"

Which binaries does it require to run?

Thanks
 
The user running the command has to have access to mysqldump and tar commands, so i would check those permissions.
This is the code that triggers the error, in case you're interested:
PHP:
$command = 'if command -v tar >/dev/null && command -v mysqldump >/dev/null; then echo 1; else echo 0; fi';
        $lastLine = exec($command, $output, $status);
        if ((int)$status !== 0 || (int)$lastLine !== 1) {
            $this->getBackupLogger()->add($this->getBackupLogStart() . Yii::t('ext_backup_manager', 'Missing linux binaries to create the backup!'));
            $this->onBackupError(new CEvent($this));
            Yii::app()->mutex->release($mutexKey);
            return false;
        }
 
PHP:
$command = 'if command -v tar >/dev/null && command -v mysqldump >/dev/null; then echo 1; else echo 0; fi';
        $lastLine = exec($command, $output, $status);
        if ((int)$status !== 0 || (int)$lastLine !== 1) {
            $this->getBackupLogger()->add($this->getBackupLogStart() . Yii::t('ext_backup_manager', 'Missing linux binaries to create the backup!'));
            $this->onBackupError(new CEvent($this));
            Yii::app()->mutex->release($mutexKey);
            return false;
        }

Hi,

I have the same problem on my server. (Backup-Manager-Error: "Missing linux binaries to create the backup")

The command "exec("/usr/local/...../bin/mysqldump");" works on my server.

But mailwizz triggers the error!

It would be helpful to see the orginal php-error-message, to get more informationen, which could help to delimit the error.

Is there a log-file where I can see the php-errors?
Or is there an another way to see the orginal php-errors?

Thanks
 
Hi,

I have the same problem on my server. (Backup-Manager-Error: "Missing linux binaries to create the backup")

The command "exec("/usr/local/...../bin/mysqldump");" works on my server.

But mailwizz triggers the error!

It would be helpful to see the orginal php-error-message, to get more informationen, which could help to delimit the error.

Is there a log-file where I can see the php-errors?
Or is there an another way to see the orginal php-errors?

Thanks

see server logs re errors

are u on a shared host?
 
see server logs re errors

are u on a shared host?

I am on a virtual managed server (without root privileges), so I am limited!

After a look into the error logs it seems that the command "mysqldump" is not in the path, therefore the error.

include_path (via php.ini) is not evaluated by exec(), so this do not work, if i would add the path to mysqldump.

Any further ideas?
 
After a look into the error logs it seems that the command "mysqldump" is not in the path, therefore the error.
It's not about being in the path, it's about the user that runs the command to have access to it, so it's all about permissions and it seems the current user does not have privileges to execute the command.
 
It's not about being in the path, it's about the user that runs the command to have access to it, so it's all about permissions and it seems the current user does not have privileges to execute the command.

in the error-logfile ...... sh: mysqldump: command not found

path-variable via phpinfo(): /command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin

destination of mysqldump in filesystem via "which mysqldump": /usr/local/pd-admin2/bin/mysqldump

Therefore I think mysqldump is not in the path!

Could you give me the filename and the directory of this code?
$command = 'if command -v tar >/dev/null && command -v mysqldump >/dev/null; then echo 1; else echo 0; fi';

Then I could add the absolute path of mysqldump in this code, to try it out to discover whether or not it works.
 
Could you give me the filename and the directory of this code?
$command = 'if command -v tar >/dev/null && command -v mysqldump >/dev/null; then echo 1; else echo 0; fi';
/apps/extensions/backup-manager/common/models/BackupManagerSnapshot.php line 184
 
Now it worked, after changing some code in the file BackupManagerSnapshot.php. It has nothing to do with permissions on my system.

The problem: The exec() command do not use the system path variable. Therefore the BackupManger do not work on my vserver. This problem is well known. (https://www.google.de/search?q=php+exec+path+problem&oq=php+exec+path+problem) There are a number of ways to solve this problem. e.g. changing apache config, ...

My workaround: I added the correct absolute path for all commands (e.g. rm, mkdir, wc, mysqldump, ....) in the file. Using the which command via ssh to determine the correct path. After this changes all worked smoothly!

Maybe this post will help other BackupManger-User.
 
Is there a better workaround for this? Like editing the paths in php.ini or apache itself?

It is possible that there may be better solutions. This also depends on the configuration of the server.

The solution has worked for me for 18 months without any problems.
 
It is possible that there may be better solutions. This also depends on the configuration of the server.

The solution has worked for me for 18 months without any problems.
Although this particular problem re commands not found / absolute paths did not happen to me, I guess it would be good for the KB to see your solution, so please feel encouraged to post it.
What I found was timeouts / 500 server error, and the normal php 'time' settings were not enough, it also needed all others to be increased (default_socket_timeout, mysql.connect_timeout) and same for nginx time settings. Besides, it seems to work no matter if the folder is set as ending with or without '/', and the directory owner must be root or account owner.
Hope this helps some who face similar problems.
 
Back
Top