Server crashes on startup if plugin is unable to create file pointed by --audit_log_file

Bug #1666496 reported by Sergei Glushchenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
Invalid
Undecided
Unassigned
5.6
Fix Released
High
Sergei Glushchenko
5.7
Fix Released
High
Sergei Glushchenko

Bug Description

Thanks to Krunal for pointing me out in comments to the bug 1641910

First, set up datadir as follows:

./sql/mysqld --initialize-insecure --datadir=./data-dir --basedir=./

Then, run mysql with the command:

./sql/mysqld --datadir=./data-dir --basedir=. --port=29993 --socket=/tmp/mysql.sock --skip-grant-tables --plugin-dir=./plugin/audit_log --plugin-load=audit_log=audit_log.so --audit_log_file=./data-dir/mysql-audit.json --audit_log_strategy=PERFORMANCE --audit_log_format=JSON --audit_log_exclude_accounts='info'@'127.0.0.1'

It will report an error

2017-02-21T11:58:41.387852Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170221 18:58:41
mysqld: File './data-dir/mysql-audit.json' not found (Errcode: 2 - No such file or directory)
2017-02-21T11:58:42.392280Z 0 [ERROR] Plugin audit_log reported: 'Cannot open file ./data-dir/mysql-audit.json.'
2017-02-21T11:58:42.392350Z 0 [ERROR] Plugin audit_log reported: 'Error: No such file or directory'
2017-02-21T11:58:42.392355Z 0 [ERROR] Plugin 'audit_log' init function returned error.
2017-02-21T11:58:42.392360Z 0 [ERROR] Plugin 'audit_log' registration as a AUDIT failed.

and then crash in audit_log_plugin_deinit

The error message is correct since 'audit_log_file' is relative to datadir in this context, but crash should not happen. Server must shutdown correctly.

Tags: audit
affects: percona-xtradb-cluster → percona-server
tags: added: audit
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1064

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.