Skip to main content
Solved

API error 500

  • Mar 29, 2024 1:19 PM UTC
  • 7 replies
  • 484 views

Forum|alt.badge.img+6

Hello,

I have an issue with API, I tried to list all host on my central with :
<url_centreon>/centreon/api/index.php?action=action&object=centreon_clapi

Body:

{

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

 

Thx

Best answer by nicnictout

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

View original

7 replies

Forum|alt.badge.img+5
  • Centreonian
  • Mar 29, 2024 1:22 PM UTC

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


Forum|alt.badge.img+6
  • Author
  • Steward ***
  • Mar 29, 2024 1:23 PM UTC

Hi,

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
 


Forum|alt.badge.img+6
  • Author
  • Steward ***
  • Mar 29, 2024 1:25 PM UTC

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


lpinsivy
Centreonian
Forum|alt.badge.img+21
  • Centreonian
  • Mar 29, 2024 1:49 PM UTC

Ok this error is about legacy form in Centreon.

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


Forum|alt.badge.img+6
  • Author
  • Steward ***
  • Mar 29, 2024 2:56 PM UTC

Hello,

no error found in sql log :(


Forum|alt.badge.img+6
  • Author
  • Steward ***
  • Mar 29, 2024 3:12 PM UTC

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


Forum|alt.badge.img+6
  • Author
  • Steward ***
  • Answer
  • Mar 29, 2024 4:16 PM UTC

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