The year 2023 isn’t a good year for home assistant for me. After the 2 updates I did the database becomes corrupted.
.pma__users OK
sys.sys_config OK
[19:44:20] INFO: Ensuring internal database upgrades are performed
[19:44:20] INFO: Ensure databases exists
[19:44:21] INFO: Create database HomeAssistant
[19:44:21] INFO: Ensure users exists and are updated
[19:44:21] INFO: Update user homeass
[19:44:21] INFO: Init/Update rights
[19:44:22] INFO: Granting all privileges to homeass on HomeAssistant
[19:44:22] INFO: Successfully send service information to Home Assistant.
2023-03-06 22:20:12 60 [ERROR] InnoDB: We detected index corruption in an InnoDB type table. You have to dump + drop + reimport the table or, in a case of widespread corruption, dump all InnoDB tables and recreate the whole tablespace. If the mysqld server crashes after the startup or when you dump the tables. Please refer to https://mariadb.com/kb/en/library/innodb-recovery-modes/ for information about forcing recovery.
2023-03-06 22:20:12 60 [ERROR] mariadbd: Index for table 'states' is corrupt; try to repair it
2023-03-06 22:20:24 61 [ERROR] InnoDB: We detected index corruption in an InnoDB type table. You have to dump + drop + reimport the table or, in a case of widespread corruption, dump all InnoDB tables and recreate the whole tablespace. If the mysqld server crashes after the startup or when you dump the tables. Please refer to https://mariadb.com/kb/en/library/innodb-recovery-modes/ for information about forcing recovery.
2023-03-06 22:20:24 61 [ERROR] mariadbd: Index for table 'states' is corrupt; try to repair it
2023-03-06 22:20:32 60 [ERROR] InnoDB: We detected index corruption in an InnoDB type table. You have to dump + drop + reimport the table or, in a case of widespread corruption, dump all InnoDB tables and recreate the whole tablespace. If the mysqld server crashes after the startup or when you dump the tables. Please refer to https://mariadb.com/kb/en/library/innodb-recovery-modes/ for information about forcing recovery.
2023-03-06 22:20:32 60 [ERROR] mariadbd: Index for table 'states' is corrupt; try to repair it
2023-03-06 22:20:58 61 [ERROR] InnoDB: We detected index corruption in an InnoDB type table. You have to dump + drop + reimport the table or, in a case of widespread corruption, dump all InnoDB tables and recreate the whole tablespace. If the mysqld server crashes after the startup or when you dump the tables. Please refer to https://mariadb.com/kb/en/library/innodb-recovery-modes/ for information about forcing recovery.
Do I have to start AGAIN (sorry for a little frustration here… ) with a clean database?? Why is this happening? And how can I stop this from happening?
Turned on recovery mode ‘innodb_force_recovery = 1’ in the MariaDB docker , which resolved the issue. But this does not explain why it happens.