Am 15.05.2017 um 14:24 schrieb Dori Seliskar:
> 
> 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
>
If I remember correctly it should be an artefact from development (to
catch an issue with bcommands switching into interactive mode), which
has not been removed yet.

Your fix should work and 'cause no further problems, I already applied
it on an internal branch, a quick test showed no issues so far.

Thanks and regards
Frank

-- 
Frank Bergkemper                   [email protected]
Bareos GmbH & Co. KG               Phone: +49-221-630693-94
http://www.bareos.com

Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
Komplementär: Bareos Verwaltungs-GmbH
Geschäftsführer: Stephan Dühr, M. Außendorf, J. Steffens, P. Storz

-- 
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.

Reply via email to