Bug #108197 Mysql server cannot be initialized if the component keyring file is in data dir
Submitted: 19 Aug 2022 12:20 Modified: 22 Aug 2022 11:39
Reporter: Manish Chawla Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:8.0 OS:Any (Bionic)
Assigned to: CPU Architecture:Any

[19 Aug 2022 12:20] Manish Chawla
Mysql server does not initialize and displays errors for keyring component initialization if the component keyring file lies in the data directory

How to repeat:
Release tarball used: mysql-8.0.30-linux-glibc2.12-x86_64.tar.xz

1. Create global manifest file(mysqld.my) in mysql bin directory.
  "components": "file://component_keyring_file"

2. Create global configuration file, component_keyring_file.cnf in lib/plugin directory. Set the path of component_keyring_file in the mysql data directory.
  "path": "/home/manish.chawla/MS_8_0_30/data/component_keyring_file",
    "read_only": false

3. Initialize mysqld with encryption options
/home/manish.chawla/MS_8_0_30/bin/mysqld --no-defaults --initialize-insecure --basedir=/home/manish.chawla/MS_8_0_30 --datadir=/home/manish.chawla/MS_8_0_30/data --server-id=100 --log-bin=binlog --innodb-undo-log-encrypt --innodb-redo-log-encrypt --binlog-encryption --binlog-rotate-encryption-master-key-at-startup --default-table-encryption=ON --log-replica-updates --gtid-mode=ON --enforce-gtid-consistency --binlog-format=row --source_verify_checksum=ON --binlog_checksum=CRC32

4. The server displays the following errors:
2022-08-19T09:42:14.812073Z 0 [ERROR] [MY-013714] [Server] Component component_keyring_file reported: 'The component is not initialized properly. Make sure that configuration is proper and use ALTER INSTANCE RELOAD KEYRING to reinitialize the component.'
2022-08-19T09:42:14.812288Z 0 [System] [MY-013169] [Server] /home/manish.chawla/MS_8_0_30/bin/mysqld (mysqld 8.0.30) initializing of server in progress as process 5595
2022-08-19T09:42:14.827553Z 0 [ERROR] [MY-012676] [InnoDB] Check keyring fail, please check the keyring is loaded.
2022-08-19T09:42:14.827580Z 0 [ERROR] [MY-010202] [Server] Plugin 'InnoDB' init function returned error.
2022-08-19T09:42:14.827590Z 0 [ERROR] [MY-010734] [Server] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2022-08-19T09:42:14.827601Z 0 [ERROR] [MY-010168] [Server] Failed to initialize builtin plugins.
2022-08-19T09:42:14.827612Z 0 [ERROR] [MY-013455] [Server] The newly created data directory /home/manish.chawla/MS_8_0_30/data/ by --initialize is unusable. You can remove it.
2022-08-19T09:42:14.827621Z 0 [ERROR] [MY-010119] [Server] Aborting

Note: The issue is reproducible in 8.0.29 version also. This issue is not there in 8.0.28 version.

Suggested fix:
Mysql server should be able to initialize, when the component keyring file is in the data directory. If there is any restriction, then it can be added in the documentation.
[22 Aug 2022 11:39] MySQL Verification Team
Hi Mr. Chawla,

Thank you for your bug report.

However, this is not a bug in our server, since it behaves how it is designed to.

This is, however, a proper documentation bug, which is why this is now a fully verified bug. During documentation phase, we shall inspect whether any code changes might be necessary.

Thank you for your report.