puppetlabs / puppetlabs-mysql

MySQL Puppet Module / Manifests + Types & Providers
Apache License 2.0
380 stars 792 forks source link

Initialize specified but the data directory exists #1562

Open dtolj opened 1 year ago

dtolj commented 1 year ago

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.

Jericon commented 8 months ago

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.