Skip to main content
Solved

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

  • March 1, 2023
  • 6 replies
  • 1564 views

Forum|alt.badge.img+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

Best answer by davidc

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

6 replies

Forum|alt.badge.img+4
  • Steward *
  • 19 replies
  • March 1, 2023

Hello @davidc,

I think this URL can help you.

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


Forum|alt.badge.img+2
  • Author
  • Steward *
  • 2 replies
  • March 2, 2023

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 ;-)


lpinsivy
Centreonian
Forum|alt.badge.img+21
  • Centreonian
  • 1120 replies
  • March 2, 2023

Forum|alt.badge.img+2
  • Author
  • Steward *
  • 2 replies
  • Answer
  • March 2, 2023

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


Forum|alt.badge.img+1
  • Steward *
  • 3 replies
  • July 10, 2024

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.


Forum|alt.badge.img+1
  • Steward *
  • 3 replies
  • July 10, 2024

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