Hi all,
I am new to bareos but did run bacula for some time in the past. I'm
preparing backup solution for RHV/oVirt with bareos and just stumbled
upon a strange error - after changing FileSet name to
SomethingSometingSelected suddenly WebUI started complaining
Error: No backups of client _ClientName_ found.
when trying to make restore.
Cause of this is match for string "Select" in
module/Client/src/Client/Model/ClientModel.php
function getClientBackups
...
$result = $bsock->send_command($cmd, 2, null);
if(preg_match("/Select/", $result)) {
return null;
}
else {
$backups = \Zend\Json\Json::decode($result,
\Zend\Json\Json::TYPE_ARRAY);
return $backups['result']['backups'];
}
...
Why is this needed? On no backups for a job result reads:
{"jsonrpc":"2.0","id":null,"result":{"backups":[]}}
which works just fine without before mentioned test.
When I change code to:
...
$result = $bsock->send_command($cmd, 2, null);
//if(preg_match("/Select/", $result)) {
// return null;
//}
//else {
$backups = \Zend\Json\Json::decode($result,
\Zend\Json\Json::TYPE_ARRAY);
return $backups['result']['backups'];
//}
}
else {
throw new \Exception('Missing argument.');
}
...
everything works again. But I guess match for "Select" was there for a reason ?!
Can somebody please explain if this quick fix is ok or am I missing something
here.
best regards,
dori
--
You received this message because you are subscribed to the Google Groups
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.