Hi all,

I'm setting Bacula up again after using in the 2000s now that it has it's native S3 cloud storage daemon. I'm hitting an issue with the initial setup with Baculum. When baculum-web tries to authenticate to baculum-api, I get the following error:

Problem with connection to remote host. cURL error 0: .
Prado\Exceptions\TPhpErrorException
Description
[Notice] Undefined index: auth_type (@line 100 in file 
/usr/share/baculum/htdocs/protected/API/Class/BaculumAPIServer.php).

Source File
/usr/share/baculum/htdocs/protected/API/Class/BaculumAPIServer.php (100)

0089:     // delete element
0090:     const DELETE_METHOD = 'DELETE';
0091:
0092:     /**
0093:      * API Server authentication.
0094:      *
0095:      * @return true if user is successfully authenticated, otherwise false
0096:      */
0097:     private function authenticate() {
0098:         $is_auth = false;
0099:         $config = $this->getModule('api_config')->getConfig('api');
0100:         if ($config['auth_type'] === 'basic' && 
$this->getModule('auth_basic')->isAuthRequest()) {
0101:             $is_auth = true;
0102:             $username = isset($_SERVER['PHP_AUTH_USER']) ? 
$_SERVER['PHP_AUTH_USER'] : null;
0103:             if ($username) {
0104:                 $props = 
$this->getModule('basic_config')->getConfig($username);
0105:                 $this->initAuthParams($props);
0106:             }
0107:
0108:         } elseif ($config['auth_type'] === 'oauth2' && 
$this->getModule('auth_oauth2')->isAuthRequest()) {
0109:             $is_auth = $this->authorize();
0110:         }
0111:         if (!$is_auth && is_null($this->error)) {
0112:             $this->output = 
AuthenticationError::MSG_ERROR_AUTHENTICATION_TO_API_PROBLEM;

Stack Trace
#0 /usr/share/baculum/htdocs/protected/API/Class/BaculumAPIServer.php(100): 
Prado\PradoBase::phpErrorHandler()
#1 /usr/share/baculum/htdocs/protected/API/Class/BaculumAPIServer.php(179): 
BaculumAPIServer->authenticate()
#2 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/UI/TControl.php(1318):
 BaculumAPIServer->onInit()
#3 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/UI/TCompositeControl.php(35):
 Prado\Web\UI\TControl->initRecursive()
#4 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/UI/TTemplateControl.php(244):
 Prado\Web\UI\TCompositeControl->initRecursive()
#5 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/UI/TPage.php(220):
 Prado\Web\UI\TTemplateControl->initRecursive()
#6 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/UI/TPage.php(208):
 Prado\Web\UI\TPage->processNormalRequest()
#7 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/Services/TPageService.php(528):
 Prado\Web\UI\TPage->run()
#8 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/Services/TPageService.php(465):
 Prado\Web\Services\TPageService->runPage()
#9 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/TApplication.php(1190):
 Prado\Web\Services\TPageService->run()
#10 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/TApplication.php(382):
 Prado\TApplication->runService()
#11 /usr/share/baculum/htdocs/index.php(32): Prado\TApplication->run()
#12 {main}

2023-06-21 05:09 Apache/2.4.41 (Ubuntu) PRADO/4.0.1

Problem with connection to remote host. cURL error 0: .
Prado\Exceptions\TPhpErrorException
Description
[Notice] Undefined index: auth_type (@line 100 in file 
/usr/share/baculum/htdocs/protected/API/Class/BaculumAPIServer.php).

Source File
/usr/share/baculum/htdocs/protected/API/Class/BaculumAPIServer.php (100)

0089:     // delete element
0090:     const DELETE_METHOD = 'DELETE';
0091:
0092:     /**
0093:      * API Server authentication.
0094:      *
0095:      * @return true if user is successfully authenticated, otherwise false
0096:      */
0097:     private function authenticate() {
0098:         $is_auth = false;
0099:         $config = $this->getModule('api_config')->getConfig('api');
0100:         if ($config['auth_type'] === 'basic' && 
$this->getModule('auth_basic')->isAuthRequest()) {
0101:             $is_auth = true;
0102:             $username = isset($_SERVER['PHP_AUTH_USER']) ? 
$_SERVER['PHP_AUTH_USER'] : null;
0103:             if ($username) {
0104:                 $props = 
$this->getModule('basic_config')->getConfig($username);
0105:                 $this->initAuthParams($props);
0106:             }
0107:
0108:         } elseif ($config['auth_type'] === 'oauth2' && 
$this->getModule('auth_oauth2')->isAuthRequest()) {
0109:             $is_auth = $this->authorize();
0110:         }
0111:         if (!$is_auth && is_null($this->error)) {
0112:             $this->output = 
AuthenticationError::MSG_ERROR_AUTHENTICATION_TO_API_PROBLEM;

Stack Trace
#0 /usr/share/baculum/htdocs/protected/API/Class/BaculumAPIServer.php(100): 
Prado\PradoBase::phpErrorHandler()
#1 /usr/share/baculum/htdocs/protected/API/Class/BaculumAPIServer.php(179): 
BaculumAPIServer->authenticate()
#2 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/UI/TControl.php(1318):
 BaculumAPIServer->onInit()
#3 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/UI/TCompositeControl.php(35):
 Prado\Web\UI\TControl->initRecursive()
#4 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/UI/TTemplateControl.php(244):
 Prado\Web\UI\TCompositeControl->initRecursive()
#5 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/UI/TPage.php(220):
 Prado\Web\UI\TTemplateControl->initRecursive()
#6 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/UI/TPage.php(208):
 Prado\Web\UI\TPage->processNormalRequest()
#7 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/Services/TPageService.php(528):
 Prado\Web\UI\TPage->run()
#8 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/Services/TPageService.php(465):
 Prado\Web\Services\TPageService->runPage()
#9 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/TApplication.php(1190):
 Prado\Web\Services\TPageService->run()
#10 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/TApplication.php(382):
 Prado\TApplication->runService()
#11 /usr/share/baculum/htdocs/index.php(32): Prado\TApplication->run()
#12 {main}
2023-06-21 05:09 Apache/2.4.41 (Ubuntu) PRADO/4.0.1

Problem with connection to remote host. cURL error 0: .
Prado\Exceptions\TPhpErrorException
Description
[Notice] Undefined index: auth_type (@line 100 in file 
/usr/share/baculum/htdocs/protected/API/Class/BaculumAPIServer.php).

Source File
/usr/share/baculum/htdocs/protected/API/Class/BaculumAPIServer.php (100)

0089:     // delete element
0090:     const DELETE_METHOD = 'DELETE';
0091:
0092:     /**
0093:      * API Server authentication.
0094:      *
0095:      * @return true if user is successfully authenticated, otherwise false
0096:      */
0097:     private function authenticate() {
0098:         $is_auth = false;
0099:         $config = $this->getModule('api_config')->getConfig('api');
0100:         if ($config['auth_type'] === 'basic' && 
$this->getModule('auth_basic')->isAuthRequest()) {
0101:             $is_auth = true;
0102:             $username = isset($_SERVER['PHP_AUTH_USER']) ? 
$_SERVER['PHP_AUTH_USER'] : null;
0103:             if ($username) {
0104:                 $props = 
$this->getModule('basic_config')->getConfig($username);
0105:                 $this->initAuthParams($props);
0106:             }
0107:
0108:         } elseif ($config['auth_type'] === 'oauth2' && 
$this->getModule('auth_oauth2')->isAuthRequest()) {
0109:             $is_auth = $this->authorize();
0110:         }
0111:         if (!$is_auth && is_null($this->error)) {
0112:             $this->output = 
AuthenticationError::MSG_ERROR_AUTHENTICATION_TO_API_PROBLEM;

Stack Trace
#0 /usr/share/baculum/htdocs/protected/API/Class/BaculumAPIServer.php(100): 
Prado\PradoBase::phpErrorHandler()
#1 /usr/share/baculum/htdocs/protected/API/Class/BaculumAPIServer.php(179): 
BaculumAPIServer->authenticate()
#2 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/UI/TControl.php(1318):
 BaculumAPIServer->onInit()
#3 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/UI/TCompositeControl.php(35):
 Prado\Web\UI\TControl->initRecursive()
#4 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/UI/TTemplateControl.php(244):
 Prado\Web\UI\TCompositeControl->initRecursive()
#5 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/UI/TPage.php(220):
 Prado\Web\UI\TTemplateControl->initRecursive()
#6 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/UI/TPage.php(208):
 Prado\Web\UI\TPage->processNormalRequest()
#7 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/Services/TPageService.php(528):
 Prado\Web\UI\TPage->run()
#8 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/Web/Services/TPageService.php(465):
 Prado\Web\Services\TPageService->runPage()
#9 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/TApplication.php(1190):
 Prado\Web\Services\TPageService->run()
#10 
/usr/share/baculum/htdocs/protected/vendor/pradosoft/prado/framework/TApplication.php(382):
 Prado\TApplication->runService()
#11 /usr/share/baculum/htdocs/index.php(32): Prado\TApplication->run()
#12 {main}

I've googled this error and it seemed like there was a bdirjson compile flag issue that seems VERY similar to this issue. There was a fix released for it in the bacula 9.x branch and the latest version of bacula 11.x was released 2 month later, so I'd assume that it was fixed in there too but I can't find any documentation/bug reports say it was. bdirjson runs fine and exits with 0 when run from the command line.

Environment:

I'm using the Bacula/Baculum Community 11.0.6-1 DEBs with Ubuntu 20.04 as my backup server. I need to stay in the 11.x branch because I need both support for Ubuntu 18.04 and 22.04 for bacula clients. Using the stock apache2 as my webserver for Baculum with mod_php. Postgresql is my SQL backend.

Any ideas of where to check next? I'm at a loss.
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to