Hello Marcin

Thanks very much for that explanation. I hadn’t realised this was essentially a 
working directory for Baculum.

Having got the API and WEB set up, I’ve run into a strange error with WEB. If I 
set up a very simple pool definition Baculum can save it correctly. As soon as 
I add a ‘MaximumVolumeBytes = 10GB’, WEB crashes out with an error. Smaller 
values such as 500M are OK.

Following some advice you once gave me about another error, I have enabled 
logging in the API. The relevant extract is below.

The error appears to be that a parameter is being assigned an unsupported value 
of type ‘double’. WEB is writing this value back to the config via the process 
you described.

Is it possible to deduce from this output, the offending config file line?

>>
Mar 14 08:40:10 [Debug] [Application] Command=formatDirectiveValue, 
Output=Attemp to format a directive value with not supported value type 
'double'., File=/var/www/baculum/protected/API/Class/BaculaSetting.php, 
Line=516 (line 74, /var/www/baculum/protected/Common/Class/Logging.php)
Mar 14 08:40:10 [Debug] [Execute] Command=sudo /usr/lib/bacula/bdirjson -c 
/var/www/baculum/configs/config_4W8e6b "-t" 2>&1, Output=Array
(
    [0] => bacula-dir: ERROR TERMINATION at parse_conf.c:805
    [1] => Config error: expected a size, got: }
    [2] =>             : line 172, col 1 of file 
/var/www/baculum/configs/config_4W8e6b
    [3] => }
    [4] => 
    [5] => 14-Mar 08:40 bacula-dir: ERROR TERMINATION at parse_conf.c:805
    [6] => Config error: expected a size, got: }
    [7] =>             : line 172, col 1 of file 
/var/www/baculum/configs/config_4W8e6b
    [8] => }
    [9] => 
)
, File=/var/www/baculum/protected/API/Class/JSONTools.php, Line=114 (line 74, 
/var/www/baculum/protected/Common/Class/Logging.php)
Mar 14 08:40:10 [Debug] [Application] Command=validateConfig, Output=ERROR 
[dir] JSON tool returned wrong exitcode.
 Output:bacula-dir: ERROR TERMINATION at parse_conf.c:805
Config error: expected a size, got: }
            : line 172, col 1 of file /var/www/baculum/configs/config_4W8e6b
}

14-Mar 08:40 bacula-dir: ERROR TERMINATION at parse_conf.c:805
Config error: expected a size, got: }
            : line 172, col 1 of file /var/www/baculum/configs/config_4W8e6b
}
, File=/var/www/baculum/protected/API/Class/BaculaConfig.php, Line=110 (line 
74, /var/www/baculum/protected/Common/Class/Logging.php)
>>

Best
-Chris-




> On 13 Mar 2022, at 07:18, Marcin Haba <ganius...@gmail.com> wrote:
> 
> Hello Chris,
> 
> Yes, I think we are talking about the same field.
> 
> In this path Baculum saves Bacula config files, validates them and if they 
> are valid, saves them to the destination path (in your case it is 
> /etc/bacula).
> 
> The configuration sent to API is merged with existing configuration, the 
> result is temporarily saved in the Baculum API working directory, there it is 
> validated by Bacula tools and if it is valid, next the Bacula config is saved 
> to the destination Bacula configuration path. This process is for saving only 
> valid configuration. In case of unexpected errors in the config file, the 
> configuration will not be saved.
> 
> It is the main task realized in this directory, but not the only one. If 
> Baculum API needs to save something, it uses this directory. I would suggest 
> to treat it just as a Baculum API working directory.
> 
> Best regards,
> Marcin Haba (gani)
> 
> On Sat, 12 Mar 2022 at 18:08, Chris Wilkinson <winstonia...@gmail.com 
> <mailto:winstonia...@gmail.com>> wrote:
> Not exactly,  the field I was referring to is at the top of the API wizard 
> step 4 under 'General Configuration. It is a directory path for 'new config 
> files'.
> 
> I'm unclear if this refers to the path where Baculum will save new config 
> files or save mods to files taken from /etc/bacula.
> 
> Perhaps you are referring to v11? I'm using v9.6.
> 
> Best
> Chris
> 
> 
> On Sat, 12 Mar 2022, 4:30 pm Marcin Haba, <ganius...@gmail.com 
> <mailto:ganius...@gmail.com>> wrote:
> Hello Chris,
> 
> If you mean the field in API install wizard labeled "Baculum working 
> directory for Bacula config", here you can find full answer:
> 
> https://sourceforge.net/p/bacula/mailman/message/37359134/ 
> <https://sourceforge.net/p/bacula/mailman/message/37359134/>
> 
> Best regards,
> Marcin Haba (gani)
> 
> On Sat, 12 Mar 2022 at 09:59, Chris Wilkinson <winstonia...@gmail.com 
> <mailto:winstonia...@gmail.com>> wrote:
> What is the purpose of the 'new configs' path? Should this point to the 
> default /etc/bacula?
> 
> Best
> Chris
> 
> On Sat, 12 Mar 2022, 5:16 am Marcin Haba, <ganius...@gmail.com 
> <mailto:ganius...@gmail.com>> wrote:
> Hello Chris,
> 
> Thanks for reporting this problem.
> 
> Yes, the b*json and bconsole paths can be different in various operating 
> systems. It is the reason why those fields are editable that everybody can 
> adjust paths to own needs.
> 
> Best regards,
> Marcin Haba (gani)
> 
> On Fri, 11 Mar 2022 at 15:43, Chris Wilkinson <winstonia...@gmail.com 
> <mailto:winstonia...@gmail.com>> wrote:
> I should have realised this sooner but I found that the pre-populated fields 
> in the API wizard point to incorrect locations for the jsons.
> 
> The jsons are located at /usr/lib/bacula/.. not /usr/sbin/..
> 
> pi@raspberrypi-b:~ $ locate bsdjson
> /usr/lib/bacula/bsdjson
> etc..
> 
> This means that the file /etc/sudoers.d/bacula-api should be:
> 
>> Defaults:www-data !requiretty
>> www-data ALL=NOPASSWD: /usr/sbin/bconsole     <==Note that bconsole is still 
>> @ /usr/sbin/..
>> www-data ALL=NOPASSWD: /usr/lib/bacula/bdirjson
>> www-data ALL=NOPASSWD: /usr/lib/bacula/bsdjson
>> www-data ALL=NOPASSWD: /usr/lib/bacula/bfdjson
>> www-data ALL=NOPASSWD: /usr/lib/bacula/bbconsjson
> 
> The API wizard needs these paths too.
> 
> With these changes, the API wizard now proceeds without error and the 
> remainder of the setup goes OK.
> 
> Best
> -Chris-
> 
> 
> 
> 
>> On 11 Mar 2022, at 12:48, Chris Wilkinson <winstonia...@gmail.com 
>> <mailto:winstonia...@gmail.com>> wrote:
>> 
>> Hello Marcin
>> 
>> I ran into a difficulty with the PI sudo set up when using the API wizard at 
>> step 4. 
>> 
>> General configuration
>> Directory path for new config files:
>> 
>> Use sudo:
>> x
>> 
>> I checked the ‘use sudo’ box. One example is below but the other fields are 
>> the same.
>> Director
>> bdirjson binary file path:
>> 
>> Main Director config file path (usually bacula-dir.conf):
>> 
>> We trust you have received the usual lecture from the local System 
>> Administrator. It usually boils down to these three things: #1) Respect the 
>> privacy of others. #2) Think before you type. #3) With great power comes 
>> great responsibility. sudo: no tty present and no askpass program specified
>> 
>> The error is in the last sentence. I am also unclear on what is expected in 
>> the directory path for new configs at the top of this page. This appears to 
>> require a path that is writeable by www-data (for Apache2).
>> 
>> This is the /etc/sudoers file (unmodified from stock)
>> '
>> #
>> # This file MUST be edited with the 'visudo' command as root.
>> #
>> # Please consider adding local content in /etc/sudoers.d/ instead of
>> # directly modifying this file.
>> #
>> # See the man page for details on how to write a sudoers file.
>> #
>> Defaults     env_reset
>> Defaults     mail_badpass
>> Defaults     
>> secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
>> 
>> # Host alias specification
>> 
>> # User alias specification
>> 
>> # Cmnd alias specification
>> 
>> # User privilege specification
>> root ALL=(ALL:ALL) ALL
>> 
>> # Allow members of group sudo to execute any command
>> %sudo        ALL=(ALL:ALL) ALL
>> 
>> # See sudoers(5) for more information on "#include" directives:
>> 
>> #includedir /etc/sudoers.d
>> ‘
>> 
>> www-data is a member of the sudo group.
>> 
>> I created a new file /etc/sudoers.d/baculum-api containing:
>> 
>> Defaults:www-data !requiretty
>> www-data ALL=NOPASSWD: /usr/sbin/bconsole
>> www-data ALL=NOPASSWD: /usr/sbin/bdirjson
>> www-data ALL=NOPASSWD: /usr/sbin/bsdjson
>> www-data ALL=NOPASSWD: /usr/sbin/bfdjson
>> www-data ALL=NOPASSWD: /usr/sbin/bbconsjson
>> 
>> The above are the same as I have in a Debian/Apache2 configuration that 
>> works just fine.
>> 
>> Any suggestions where I went wrong ?
>> 
>> Best
>> -Chris-
>> 
>> 
>> 
>> 
>>> On 7 Mar 2022, at 05:36, Marcin Haba <ganius...@gmail.com 
>>> <mailto:ganius...@gmail.com>> wrote:
>>> 
>>> Hello Chris,
>>> 
>>> In bacula.org <http://bacula.org/> repositories we don't provide Baculum 
>>> packages for Raspbian. But you can try manual installation using source tar 
>>> archive. Here you can find install instruction:
>>> 
>>> https://baculum.app/doc/brief/installation.html#manual-installation 
>>> <https://baculum.app/doc/brief/installation.html#manual-installation>
>>> 
>>> Best regards,
>>> Marcin Haba (gani)
>>> 
>>> On Sat, 5 Mar 2022 at 22:49, Chris Wilkinson <winstonia...@gmail.com 
>>> <mailto:winstonia...@gmail.com>> wrote:
>>> Is it feasible to install Baculum (v9.x) on Raspbian? It is not listed in 
>>> the official packages list (Bacula is). This is armf so the Debian repo 
>>> package will not work. 
>>> 
>>> I have Bacula running with reasonable performance backing up to a local USB 
>>> disk.
>>> 
>>> Regards
>>> Chris Wilkinson 
>>> _______________________________________________
>>> Bacula-users mailing list
>>> Bacula-users@lists.sourceforge.net 
>>> <mailto:Bacula-users@lists.sourceforge.net>
>>> https://lists.sourceforge.net/lists/listinfo/bacula-users 
>>> <https://lists.sourceforge.net/lists/listinfo/bacula-users>
>>> 
>>> 
>>> -- 
>>> "Greater love hath no man than this, that a man lay down his life for his 
>>> friends." Jesus Christ
>>> 
>>> "Większej miłości nikt nie ma nad tę, jak gdy kto życie swoje kładzie za 
>>> przyjaciół swoich." Jezus Chrystus
>> 
> 
> 
> 
> -- 
> "Greater love hath no man than this, that a man lay down his life for his 
> friends." Jesus Christ
> 
> "Większej miłości nikt nie ma nad tę, jak gdy kto życie swoje kładzie za 
> przyjaciół swoich." Jezus Chrystus
> 
> 
> -- 
> "Greater love hath no man than this, that a man lay down his life for his 
> friends." Jesus Christ
> 
> "Większej miłości nikt nie ma nad tę, jak gdy kto życie swoje kładzie za 
> przyjaciół swoich." Jezus Chrystus
> 
> 
> -- 
> "Greater love hath no man than this, that a man lay down his life for his 
> friends." Jesus Christ
> 
> "Większej miłości nikt nie ma nad tę, jak gdy kto życie swoje kładzie za 
> przyjaciół swoich." Jezus Chrystus

_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to