Skip to main content

Hi,

It's my first time installing Centreon, I used the rpms to install on a CentOS 7, followed the procedures, get the token, but when I go to Administration->Extensions->Manager, there is no “Add Token” button, only “Update All” and “Install All” buttons, both disabled.

I saw at a screenshot, the Add Token and another buttons should be nearby, but there's no other button in my interface.

All the Extensions are installed, I tried to uninstall and reinstall License Manager without success.

Following troubleshooting, I accessed Administration->Parameters->Centreon UI, used the button “Test Internet Connection”, got the response “Connection Successful”.

At /var/log/centreon/license-manager.log I got the following error:

2022-11-29 12:27|0|0|2RestUnauthorizedException] https://api.imp.centreon.com/api/license-manager/instance/subscription : Please make sure your request has an Authorization header

 

Another issue, not know if it's related, when I open the Centreon Admin, before login, the message “Ops, something went wrong” appears, but there is no further explanations, nothing in the logs, but on Browser Console I got the error messages:

GET https://manager.REDACTED_FOR_PRIVACY/centreon/api/latest/configuration/users/current/parameters 403 (Forbidden)

GET https://manager.REDACTED_FOR_PRIVACY/centreon/modules/centreon-pp-manager/static/moduleFederation.json 404 (Not Found)

GET https://manager.REDACTED_FOR_PRIVACY/centreon/null 404 (Not Found)

After logon, the /centreon/api/latest/configuration/user/current/parameters works, but the other routes don't tries to read again.

Another issue, when I go to Poolers->Configure Poolers, it's says “Is running? NO”, I restarted the instances using the command line:

systemctl restart cbd centengine gorgoned

But got no success.

I know that the other issues maybe not related to the real problem, but I listed it here, just in case.

I'm using:

  • Centreon 22.10.1 (commit  8682f9a714)
  • Centos 7.5
  • PHP 8.1.12
  • MariaDB 10.5.15

 

 

HI @ferulisses can you add a print screen of the “Administration->Extensions->Manager” page.

Do you have error in /var/log/centreon/sql-error.log?

Regards,


Hi,

There is no file /var/log/centreon/sql-error.log 

I lookup all files in this directory searching for errors, got the following error at centAcl.log:

PHP Warning:  Undefined variable $conf_centreon in /usr/share/centreon/cron/centAcl.php on line 45

PHP Warning:  Trying to access array offset on value of type null in /usr/share/centreon/cron/centAcl.php on line 45

PHP Fatal error:  Uncaught Error: Undefined constant "hostCentreon" in /usr/share/centreon/www/class/centreonDB.class.php:142

Stack trace:

#0 /usr/share/centreon/cron/centAcl.php(72): CentreonDB->__construct()

#1 {main}

  thrown in /usr/share/centreon/www/class/centreonDB.class.php on line 142

 

I'm not sure when this error occurred, since there is no timestamp, but it occurred several times, the file was modified two days ago, when I installed it, it's not generating new entries.

Bellow is the requested screenshot:


 

 

 


Can you try to regenerate Symfony cache using:

sudo -u apache php /usr/share/centreon/bin/console cache:clear

Then refresh the page


Hi, the command works fine:


[root@manager centreon]# sudo -u apache php /usr/share/centreon/bin/console cache:clear

 // Clearing the cache for the prod environment with debug                      
 // false                                                                       

                                                                                
  OK] Cache for the "prod" environment (debug=false) was successfully cleared.


But I still don't have other buttons at Extensions → Manager

Ps. I figured out how to make the Poller start, I was missing at least one Host and one Service to start it.

I still got the error “Ops, something went wrong” when I reload any page.


Hi @ferulisses 

So you have only “Ops, something went wrong” error when you access to Administration->Extensions->Manager”?

And error is?

PHP Fatal error:  Uncaught Error: Undefined constant "hostCentreon" in /usr/share/centreon/www/class/centreonDB.class.php:142

Stack trace:
#0 /usr/share/centreon/cron/centAcl.php(72): CentreonDB->__construct()
#1 {main}
thrown in /usr/share/centreon/www/class/centreonDB.class.php on line 142

Can you confirm?


No, the “Ops, something went wrong” appears everytime that I close and open again the Centreon web interface or Reload the page, in any page, it may occours in the Login page, or in List of Hosts and also at the Extensions Manager. 

In Console appear these errors:

7297.382e8a31.chunk.js:1 ​​x API Request              i {message: 'Request failed with status code 404', name: 'AxiosError', code: 'ERR_BAD_REQUEST', config: {…}, request: XMLHttpRequest, …}

(anonymous) @ 7297.382e8a31.chunk.js:1

(anonymous) @ 7297.382e8a31.chunk.js:1

Promise.catch (async)

sendRequest @ 7297.382e8a31.chunk.js:1

(anonymous) @ 3550.0426da9e.chunk.js:1

(anonymous) @ 3550.0426da9e.chunk.js:1

(anonymous) @ 3550.0426da9e.chunk.js:1

ei @ 3935.515aa59f.chunk.js:2

ws @ 3935.515aa59f.chunk.js:2

(anonymous) @ 3935.515aa59f.chunk.js:2

S @ 3935.515aa59f.chunk.js:2

T @ 3935.515aa59f.chunk.js:2

main.php:1 Uncaught (in promise) i {message: 'Request failed with status code 404', name: 'AxiosError', code: 'ERR_BAD_REQUEST', config: {…}, request: XMLHttpRequest, …}

The only files that fails to load, with error 404, are:

/centreon/modules/centreon-pp-manager/static/moduleFederation.json

/centreon/include/common/javascript/charts/www/Themes/Generic-theme/Variables-css/variables.css

/centreon/include/common/javascript/jquery/plugins/select2/css/www/Themes/Generic-theme/Variables-css/variables.css

The PHP errors about hostCentreon appeared at /var/log/centreon/centAcl.log, also appeared at downtimeManager.log, knowledgebase.log, but these log files are not incrementing, these errors are 3 days old, I think that they logged these errors before finishing the installation.

 

 


Wow, I fixed… 

I installed the Centreon Virtual Machine, everything was working as expected.

I checked the missing files, I was planning to copy them, but checking it, all the three of them was returning the default HTML.

My installation also returned the default HTML, but with 404 code, the Centreon Virtual Machine returns 200 code.

Well, I created the 

/usr/share/centreon/www/modules/centreon-pp-manager/static/moduleFederation.json file, empty, adjusted permissions to apache.apache, reloaded the interface, and everything worked fine.

The message “Ops, something went wrong” disappeared, and the button “Add Token” at Extensions → Manager appeared.

I don't know why my installation returns 404 while Centreon's VM returns 200, I use Apache 2.4, like Centreon's VM.

I will check the configuration, if there is anything that I can do.


Reply