addons: MariaDB crash after unexpected system restart

Describe the issue you are experiencing

MariaDB crash in 95% cases after unexpected system restart recorder i set to record with:

commit_interval: 15

What type of installation are you running?

Home Assistant OS

Which operating system are you running on?

Home Assistant Operating System

Which add-on are you reporting an issue with?

MariaDB

What is the version of the add-on?

2.4.0

Steps to reproduce the issue

  1. cut the power

Anything in the Supervisor logs that might be useful for us?

No response

Anything in the add-on logs that might be useful for us?

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[21:02:51] INFO: Using existing mariadb initial system
[21:02:52] INFO: Starting MariaDB
220704 21:03:00 mysqld_safe Logging to '/data/databases/mariadb.err'.
220704 21:03:01 mysqld_safe Starting mysqld daemon with databases from /data/databases
220704 21:03:01 mysqld_safe Starting mysqld daemon with databases from /data/databases
2022-07-04 21:03:06 0 [Note] /usr/bin/mysqld (mysqld 10.4.19-MariaDB) starting as process 395 ...
2022-07-04 21:03:06 0 [Note] mysqld: Aria engine: starting recovery
recovered pages: 0% 32% 51% 80% 100% (0.0 seconds); tables to flush: 2 1 0
 (0.0 seconds); 
2022-07-04 21:03:07 0 [Note] mysqld: Aria engine: recovery done
2022-07-04 21:03:07 0 [Note] InnoDB: Using Linux native AIO
2022-07-04 21:03:07 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2022-07-04 21:03:07 0 [Note] InnoDB: Uses event mutexes
2022-07-04 21:03:07 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-07-04 21:03:07 0 [Note] InnoDB: Number of pools: 1
2022-07-04 21:03:07 0 [Note] InnoDB: Using SSE2 crc32 instructions
2022-07-04 21:03:07 0 [Note] mysqld: O_TMPFILE is not supported on /var/tmp (disabling future attempts)
2022-07-04 21:03:07 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2022-07-04 21:03:07 0 [Note] InnoDB: Completed initialization of buffer pool
2022-07-04 21:03:07 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2022-07-04 21:03:07 0 [ERROR] InnoDB: Missing MLOG_CHECKPOINT at 1173950695 between the checkpoint 1173932620 and the end 1173950464.
2022-07-04 21:03:07 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2022-07-04 21:03:07 0 [Note] InnoDB: Starting shutdown...
2022-07-04 21:03:07 0 [ERROR] Plugin 'InnoDB' init function returned error.
2022-07-04 21:03:07 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2022-07-04 21:03:07 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-07-04 21:03:08 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2022-07-04 21:03:08 0 [ERROR] Aborting
220704 21:03:08 mysqld_safe mysqld from pid file /data/databases/core-mariadb.pid ended
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Additional information

After restore preverious backup log say this

220704 21:55:46 mysqld_safe Starting mysqld daemon with databases from /data/databases
2022-07-04 21:55:46 0 [Note] /usr/bin/mysqld (mysqld 10.4.19-MariaDB) starting as process 397 ...
2022-07-04 21:55:46 0 [Note] mysqld: Aria engine: starting recovery
recovered pages: 0% 32% 51% 80% 100% (0.0 seconds); tables to flush: 2 1 0
 (0.0 seconds); 
2022-07-04 21:55:46 0 [Note] mysqld: Aria engine: recovery done
2022-07-04 21:55:46 0 [Note] InnoDB: Using Linux native AIO
2022-07-04 21:55:46 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2022-07-04 21:55:46 0 [Note] InnoDB: Uses event mutexes
2022-07-04 21:55:46 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-07-04 21:55:46 0 [Note] InnoDB: Number of pools: 1
2022-07-04 21:55:46 0 [Note] InnoDB: Using SSE2 crc32 instructions
2022-07-04 21:55:46 0 [Note] mysqld: O_TMPFILE is not supported on /var/tmp (disabling future attempts)
2022-07-04 21:55:46 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2022-07-04 21:55:46 0 [Note] InnoDB: Completed initialization of buffer pool
2022-07-04 21:55:46 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2022-07-04 21:55:46 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=1036771302
2022-07-04 21:55:46 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2022-07-04 21:55:46 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2022-07-04 21:55:46 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-07-04 21:55:46 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-07-04 21:55:46 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-07-04 21:55:46 0 [Note] InnoDB: Waiting for purge to start
2022-07-04 21:55:46 0 [Note] InnoDB: 10.4.19 started; log sequence number 1036771311; transaction id 256447
2022-07-04 21:55:46 0 [Note] InnoDB: Loading buffer pool(s) from /data/databases/ib_buffer_pool
2022-07-04 21:55:46 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-07-04 21:55:46 0 [Note] Server socket created on IP: '::'.
2022-07-04 21:55:46 0 [Note] InnoDB: Buffer pool(s) load completed at 220704 21:55:46
2022-07-04 21:55:46 0 [Note] Reading of all Master_info entries succeeded
2022-07-04 21:55:46 0 [Note] Added new Master_info '' to hash table
2022-07-04 21:55:46 0 [Note] /usr/bin/mysqld: ready for connections.
Version: '10.4.19-MariaDB'  socket: '/run/mysqld/mysqld.sock'  port: 3306  MariaDB Server
[21:55:47] INFO: Check data integrity and fix corruptions
mysql.column_stats                                 OK
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.global_priv                                  OK
mysql.gtid_slave_pos                               OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.index_stats                                  OK
mysql.innodb_index_stats                           OK
mysql.innodb_table_stats                           OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.roles_mapping                                OK
mysql.servers                                      OK
mysql.table_stats                                  OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.transaction_registry                         OK
homeassistant.event_data                           OK
homeassistant.events                               OK
homeassistant.recorder_runs                        OK
homeassistant.schema_changes                       OK
homeassistant.state_attributes                     OK
homeassistant.states                               OK
homeassistant.statistics                           OK
homeassistant.statistics_meta                      OK
homeassistant.statistics_runs                      OK
homeassistant.statistics_short_term                OK
phpmyadmin.pma__bookmark                           OK
phpmyadmin.pma__central_columns                    OK
phpmyadmin.pma__column_info                        OK
phpmyadmin.pma__designer_settings                  OK
phpmyadmin.pma__export_templates                   OK
phpmyadmin.pma__favorite                           OK
phpmyadmin.pma__history                            OK
phpmyadmin.pma__navigationhiding                   OK
phpmyadmin.pma__pdf_pages                          OK
phpmyadmin.pma__recent                             OK
phpmyadmin.pma__relation                           OK
phpmyadmin.pma__savedsearches                      OK
phpmyadmin.pma__table_coords                       OK
phpmyadmin.pma__table_info                         OK
phpmyadmin.pma__table_uiprefs                      OK
phpmyadmin.pma__tracking                           OK
phpmyadmin.pma__userconfig                         OK
phpmyadmin.pma__usergroups                         OK
phpmyadmin.pma__users                              OK
[21:55:47] INFO: Ensuring internal database upgrades are performed
This installation of MariaDB is already upgraded to 10.4.19-MariaDB, use --force if you still need to run mysql_upgrade
[21:55:47] INFO: Ensure databases exists
[21:55:48] INFO: Create database homeassistant
[21:55:48] INFO: Ensure users exists and are updated
[21:55:48] INFO: Update user homeassistant
[21:55:48] INFO: Init/Update rights
[21:55:48] INFO: Granting all privileges to homeassistant on homeassistant
[21:55:49] INFO: Successfully send service information to Home Assistant.

other solution is to restore from snapshot but data loosting is 100% garanted, no mater restore type

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (8 by maintainers)

Most upvoted comments

@Saentist

  1. Make a backup of the MariaDB addon without a password
  2. Move the tar file of the backup to the new server
  3. Unzip the tar file
  4. Grab the datadir from within there
  5. Proceed with the remaining directions

I have exactly the same issue running HA in a VM. If the electricity is disabled MariaDB breaks and I have to restore.