Skip to main content
Solved

Upgrade failure due to missing tables in centreon database

  • August 22, 2024
  • 1 reply
  • 300 views

Forum|alt.badge.img+2

I’m trying to migrate an old Centreon 19.10.23 running on CentOS7 to 24.04 running on almalinux 8.

I have followed the procedure here : https://docs.centreon.com/fr/docs/migrate/migrate-from-el-to-el/

The problem occures during the web upgrade : 20.04.18 to 20.04.19    There is no active transaction

In the sql-error.log :
2024-08-22 14:00|0|0|TokenRemoval CRON: failed to delete old tokens
2024-08-22 15:00|0|0|Deleting expired refresh tokens
2024-08-22 15:00|0|0|SQLSTATE[42S02]: Base table or view not found: 1146 Table 'centreon.security_authentication_tokens' doesn't exist QUERY : DELETE st FROM security_token st
WHERE st.expiration_date < UNIX_TIMESTAMP(NOW())
AND EXISTS (
    SELECT 1
    FROM security_authentication_tokens sat
    WHERE sat.provider_token_refresh_id = st.id
    AND sat.token_type = 'auto'
    LIMIT 1
)

 

This table does not exist.

I tried to use the solution proposed here :

to create the missing tables. it works fine for security_token but there’s an error when I try to create security_authentication_tokens : ERROR 1005 (HY000): Can't create table `centreon`.`security_authentication_tokens` (errno: 150 "Foreign key constraint is incorrectly formed")

I’m blocked here. Any idea ?

Regards,

JF

 

Best answer by Jean-Francois

Hi,

finally I solve my problem with the database.

It seems there was a syntax problem in the sql command to drop a table from the database, in one step of the migration.

I drop the table manually, then comment the line in the php file and the upgrade goes to the end without any error.

 

JF

View original
Did this topic help you find an answer to your question?

1 reply

Forum|alt.badge.img+2
  • Author
  • Steward *
  • 4 replies
  • Answer
  • August 30, 2024

Hi,

finally I solve my problem with the database.

It seems there was a syntax problem in the sql command to drop a table from the database, in one step of the migration.

I drop the table manually, then comment the line in the php file and the upgrade goes to the end without any error.

 

JF


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings