API error 500

  • 29 March 2024
  • 7 replies

Userlevel 1
Badge +6


I have an issue with API, I tried to list all host on my central with :



    "action": "show",

    "object": "host"



I generate a token for my user, if I test it on my second central it works like a charm, but if I tried on my other central, I have an error 500 and I have no clue how to find the root cause.
If I do a clapi request to list all hosts, it’s working.
Any help to find what could going wrong would be appreciated.




Best answer by nicnictout 29 March 2024, 17:16

View original

7 replies

Badge +5

Hi @nicnictout can you have a look in /var/log/php-fpm/centreon-error.log when you call this endpoint?

Userlevel 1
Badge +6


only repeated errors are:
[29-Mar-2024 14:22:53 Europe/Paris] PHP Warning:  Undefined array key "orderby" in /usr/share/centreon/GPL_LIB/SmartyCache/compile/483356bf66061e547b8753551a133b246744ddb6_0.file.table.ihtml.php on line 285
[29-Mar-2024 14:22:53 Europe/Paris] PHP Warning:  Attempt to read property "value" on null in /usr/share/centreon/GPL_LIB/SmartyCache/compile/483356bf66061e547b8753551a133b246744ddb6_0.file.table.ihtml.php on line 285

Userlevel 1
Badge +6

I already tried to restart all centreon services, plus httpd and php.

Forgot to precise:
centreon 22.10.18

It was working since monthes without any issue before

Userlevel 6
Badge +18

Ok this error is about legacy form in Centreon.

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

Userlevel 1
Badge +6


no error found in sql log :(

Userlevel 1
Badge +6

I continue my tests and if I try to do a getmember of hostgroup with GET method, it’s working...

Userlevel 1
Badge +6

OK we found the root cause, there was an entry in host DB corrupted. Once host added has been identified with logs and deleted from centreon, API works again.

Thx for your help