Skip to main content
Solved

API error 500

  • March 29, 2024
  • 7 replies
  • 378 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

7 replies

Forum|alt.badge.img+5
  • Centreonian
  • 225 replies
  • March 29, 2024

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 ***
  • 12 replies
  • March 29, 2024

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 ***
  • 12 replies
  • March 29, 2024

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
  • 1120 replies
  • March 29, 2024

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 ***
  • 12 replies
  • March 29, 2024

Hello,

no error found in sql log :(


Forum|alt.badge.img+6
  • Author
  • Steward ***
  • 12 replies
  • March 29, 2024

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 ***
  • 12 replies
  • Answer
  • March 29, 2024

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