Bug #108017 Init does not provide helpful errors when InnoDB undo/redo log dirs don't exist
Submitted: 28 Jul 2022 18:24 Modified: 1 Aug 2022 11:34
Reporter: Matt Lord Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Errors Severity:S4 (Feature request)
Version:8.0.30 OS:Any
Assigned to: CPU Architecture:Any

[28 Jul 2022 18:24] Matt Lord
Description:
This is a follow-up to: https://bugs.mysql.com/bug.php?id=108016

These very helpful error messages are printed when initializing the server, if the innodb-data-home-dir does not already exist:

$ mysqld --initialize-insecure --datadir=/tmp/mysql/data --innodb-data-home-dir=/tmp/innodb/data

2022-07-28T18:09:06.936680Z 0 [System] [MY-013169] [Server] /usr/local/mysql-8.0.30-macos12-arm64/bin/mysqld (mysqld 8.0.30) initializing of server in progress as process 35686
2022-07-28T18:09:06.938147Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /tmp/mysql/data/ is case insensitive
2022-07-28T18:09:06.940207Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-07-28T18:09:06.947855Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2022-07-28T18:09:06.947871Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2022-07-28T18:09:06.947875Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2022-07-28T18:09:06.947880Z 1 [ERROR] [MY-012646] [InnoDB] File /tmp/innodb/data/ibdata1: 'create' returned OS error 71. Cannot continue operation
2022-07-28T18:09:06.947887Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.

These same kinds of helpful messages, however, are NOT printed for the other innodb directories:
innodb-log-group-home-dir
innodb-undo-directory
...

How to repeat:
mkdir /tmp/mysql /tmp/innodb

mysqld --initialize-insecure --datadir=/tmp/mysql/data --innodb-innodb-undo-directory=/tmp/innodb/undo

rm -rf /tmp/innodb /tmp/mysql; mkdir -p /tmp/innodb/ /tmp/mysql

mysqld --initialize-insecure --datadir=/tmp/mysql/data --innodb-data-home-dir=/tmp/innodb/data

Suggested fix:
Provide the same helpful error messages for the redo and undo directories that we do for the data dir.
[29 Jul 2022 11:55] MySQL Verification Team
Hi Mr. Lord,

How are you ???

Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments to the original bug instead.

You can always do as instructed in the bug #108016 and create a documentation bug for your issue.

Thank you for your interest in MySQL.
[29 Jul 2022 15:59] Matt Lord
Hi!

I tried re-opening this but apparently I can not. You marked this as a duplicate but did not say what existing bug report it's duplicating. It's not a duplicate of https://bugs.mysql.com/bug.php?id=108017. That bug report was my mistake.

And this is not a documentation request. You do note that the directory must be created here: https://dev.mysql.com/doc/refman/8.0/en/innodb-init-startup-configuration.html#innodb-star...

This bug report is a low priority feature request to log helpful error messages when the non innodb data dir directories don't exist, like you already do for the data dir. For the innodb-data-dir you have these helpful messages:
2022-07-28T18:09:06.947855Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2022-07-28T18:09:06.947871Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2022-07-28T18:09:06.947875Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2022-07-28T18:09:06.947880Z 1 [ERROR] [MY-012646] [InnoDB] File /tmp/innodb/data/ibdata1: 'create' returned OS error 71. Cannot continue operation

For the other dirs for redo/undo logs and double write files, you do NOT have similar log messages. That's in fact what led to me opening https://bugs.mysql.com/bug.php?id=108017 in the first place as it seemed to just fail oddly, and I mistakenly assumed it was related to the redo log changes in 8.0.30, which is what I was trying to test. 

Can you please re-open this or note what existing bug made this same request? I'll then mark that one as affecting me and subscribe to it.

Thanks!
[1 Aug 2022 11:34] MySQL Verification Team
Hi Mr. Lord,

This is a feature request that we can accept as useful one ........

Verified as a feature request.
[1 Aug 2022 14:18] MySQL Verification Team
Proper category.