[MDEV-30068] Confusing error message when encryption is not available on recovery Created: 2022-11-22  Updated: 2022-11-22  Resolved: 2022-11-22

Status: Closed
Project: MariaDB Server
Component/s: Encryption, Storage Engine - InnoDB
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
Fix Version/s: 10.11.2, 10.5.19, 10.6.12, 10.7.8, 10.8.7, 10.9.5, 10.10.3

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: recovery

Attachments: File data.tar.xz     Text File encryption_keys.txt    
Issue Links:
Relates
relates to MDEV-30069 InnoDB: Trying to write ... bytes at ... Closed

 Description   

When attempting to recover an encrypted database with an incorrectly configured encryption plugin, fil_ibd_load() may return FIL_LOAD_INVALID to fil_name_process(), which will output confusing messages like this, while not mentioning the affected file name:

2022-11-22  9:57:54 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=48561117,48561117
2022-11-22  9:57:54 0 [Warning] InnoDB: We do not continue the crash recovery, because the table may become corrupt if we cannot apply the log records in the InnoDB log to it. To fix the problem and start mysqld:
2022-11-22  9:57:54 0 [Note] InnoDB: 1) If there is a permission problem in the file and mysqld cannot open the file, you should modify the permissions.
2022-11-22  9:57:54 0 [Note] InnoDB: 2) If the tablespace is not needed, or you can restore an older version from a backup, then you can remove the .ibd file, and use --innodb_force_recovery=1 to force startup without this file.
2022-11-22  9:57:54 0 [Note] InnoDB: 3) If the file system or the disk is broken, and you cannot remove the .ibd file, you can set --innodb_force_recovery.
2022-11-22  9:57:54 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1462] with error Generic error
2022-11-22  9:57:54 0 [Note] InnoDB: Starting shutdown...

This can be reproduced on 10.5, 10.6, 10.7 using the attached data.tar.xz and an incorrect invocation that fails to specify the full pathname of encryption_keys.txt:

tar xJf data.tar.xz
mariadbd --plugin-dir=$BUILD_DIR/plugin/file_key_management --plugin-load-add=file_key_management.so --file-key-management-filename=encryption_keys.txt --innodb_page_size=64K --innodb-buffer-pool-size=24M --datadir $(pwd)/data


Generated at Thu Feb 08 10:13:23 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.