ansible-role-mysql icon indicating copy to clipboard operation
ansible-role-mysql copied to clipboard

Slow query log no such file or directory

Open phknot opened this issue 6 months ago • 0 comments

When mysql_slow_query_log_enabled: true is set, the setup of a new MariaDB server fails with error:

TASK [geerlingguy.mysql : Create slow query log file (if configured).] *********
fatal: [peters-zandbak]: FAILED! => {"changed": true, "cmd": ["touch", "/var/log/mysql/mariadb-slow.log"], "delta": "0:00:00.004930", "end": "2025-05-22 10:35:32.806447", "msg": "non-zero return code", "rc": 1, "start": "2025-05-22 10:35:32.801517", "stderr": "touch: cannot touch '/var/log/mysql/mariadb-slow.log': No such file or directory", "stderr_lines": ["touch: cannot touch '/var/log/mysql/mariadb-slow.log': No such file or directory"], "stdout": "", "stdout_lines": []}

I checked my server and it seems there is no mysql directory in /var/log. Probably an mkdir step is needed to create this beforehand.

phknot avatar May 22 '25 10:05 phknot