Solved

22.04 : Table 'centreon_storage.logs' doesn't exist

  • 1 March 2023
  • 4 replies
  • 644 views

Badge +2

Hi the community,

I’m currently experiencing a strange issue (don’t know exactly when it started).

In the service tab, I can’t access the “Timeline” tab anymore for any service or host. 

I get the following error message 

Symfony\Component\HttpFoundation\Response::__construct(): Argument #2 ($status) must be of type int, string given, called in /usr/share/centreon/src/EventSubscriber/CentreonEventSubscriber.php on line 422

In the centreon-error.log log file I saw this error

[01-Mar-2023 16:29:02 Europe/Paris] CRITICAL: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'centreon_storage.logs' doesn't exist {"context":"[object] (PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'centreon_storage.logs' doesn't exist at /usr/share/centreon/src/Centreon/Infrastructure/Monitoring/Timeline/TimelineRepositoryRDB.php:228)"}

[01-Mar-2023 16:29:02 Europe/Paris] CRITICAL: Uncaught Error: Symfony\Component\HttpFoundation\Response::__construct(): Argument #2 ($status) must be of type int, string given, called in /usr/share/centreon/src/EventSubscriber/CentreonEventSubscriber.php on line 422 {"exception":"[object] (TypeError(code: 0): Symfony\\Component\\HttpFoundation\\Response::__construct(): Argument #2 ($status) must be of type int, string given, called in /usr/share/centreon/src/EventSubscriber/CentreonEventSubscriber.php on line 422 at /usr/share/centreon/vendor/symfony/http-foundation/Response.php:215)"}

[01-Mar-2023 16:29:02 Europe/Paris] CRITICAL: Symfony\Component\HttpFoundation\Response::__construct(): Argument #2 ($status) must be of type int, string given, called in /usr/share/centreon/src/EventSubscriber/CentreonEventSubscriber.php on line 422 {"context":"[object] (TypeError(code: 0): Symfony\\Component\\HttpFoundation\\Response::__construct(): Argument #2 ($status) must be of type int, string given, called in /usr/share/centreon/src/EventSubscriber/CentreonEventSubscriber.php on line 422 at /usr/share/centreon/vendor/symfony/http-foundation/Response.php:215)"}

After checking the database, indeed, the table 'centreon_storage.logs' is missing.

How can I resolve this issue ?

Thank you

icon

Best answer by davidc 2 March 2023, 15:29

View original

4 replies

Userlevel 1
Badge +4

Hello @davidc,

I think this URL can help you.

In the conversation he talks about the logs table which has disappeared

Badge +2

Hello @Wisonic , thanks that helped me to recreate the table. But now I have trouble recreating the partitioning.
But I will manage to do it ;-)

Userlevel 6
Badge +18

@davidc this can help you: https://docs.centreon.com/docs/administration/database-partitioning/

Badge +2

Hi,
just to inform that the issue has been fixed. 
I was not able to partition the “logs” table, because of some remaining entries in mysql information_schema.

My workaround was :

  • Dump “centreon_storage” database
  • Drop “centreon_storage” database
  • Restore “centreon_storage” database from previous dump
  • Create “logs” table (not partitioned)
  • Partition “logs” table with the script (/usr/bin/php /usr/share/centreon/cron/centreon-partitioning.php -m logs)

Everything is now OK.

Still don’t know what create this initial situation, but now I have a solution :-)

Reply