Solved

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

  • 1 March 2023
  • 6 replies
  • 941 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

6 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 +19

@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 :-)

Badge +1

Hello I have the same problem I would like to know how to create the logs table. Is there a script?

Thank you in advance.

Badge +1

I found the solution in https://thewatch.centreon.com/platform-7/database-updates-not-active-pollers-not-running-get-stack-545

Many thanks to @itoussies 

Reply