puppetlabs/puppetlabs-mysql

Initialize specified but the data directory exists

dtolj opened this issue · 1 comments

dtolj commented

Describe the Bug

I am unable to initialize the DB since puppet already creates the log file in /data/SQL/mysqld.err but mysqld expects an empty directory.

Notice: /Stage[main]/Mysql::Server::Installdb/File[/data/SQL/mysqld.err]/ensure: created (corrective)
Debug: Mysql_datadir[/data/SQL/](provider=mysql): Initializing MySQL data directory >= 5.7.6 with mysqld: --basedir=/usr --datadir=/data/SQL/ --user=mysql --log-error=/data/SQL/mysqld.err --initialize-insecure
Debug: Executing: '/sbin/mysqld --basedir=/usr --datadir=/data/SQL/ --user=mysql --log-error=/data/SQL/mysqld.err --initialize-insecure'
Error: Execution of '/sbin/mysqld --basedir=/usr --datadir=/data/SQL/ --user=mysql --log-error=/data/SQL/mysqld.err --initialize-insecure' returned 1:
Error: /Stage[main]/Mysql::Server::Installdb/Mysql_datadir[/data/SQL/]/ensure: change from 'absent' to 'present' failed: Execution of '/sbin/mysqld --basedir=/usr --datadir=/data/SQL/ --user=mysql --log-error=/data/SQL/mysqld.err --initialize-insecure' returned 1:
Debug: Class[Mysql::Server::Installdb]: Resource is being skipped, unscheduling all events

Expected Behavior

mysqld initializes the DB

Steps to Reproduce

Steps to reproduce the behavior:

Environment

AlmaLinux 9.1
puppet 6.28
puppetlabs-mysql 12.0.1

Additional Context

Add any other context about the problem here.

On the host that you are receiving this error, I'd suggest looking in the mysql error log for more details about why MySQL failed to start.