Bug #78843 Aborted Connections/Access denied logging need to be more configurable
Submitted: 15 Oct 2015 9:32 Modified: 19 Oct 2015 8:31
Reporter: Simon Mudd (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Logging Severity:S4 (Feature request)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[15 Oct 2015 9:32] Simon Mudd
Description:
https://dev.mysql.com/doc/refman/5.7/en/communication-errors.html talks about some errors such as Aborted connection and Access denied type errors.

The default behaviour with log level 3 is good so that you can see issues of this type, but on busy systems it is quite easy to generate a lot of logging related to these messages. I'm seeing one or more log lines a second on some systems that were quiet with 5.6.

A real life example might be:

2015-10-15T09:15:13.240318Z 18462 [Note] Aborted connection 18462 to db: 'mydb' user: 'app' host: 'app-18.example.com' (Got timeout reading communication packets)
2015-10-15T09:15:13.327814Z 18467 [Note] Aborted connection 18467 to db: 'mydb' user: 'app' host: 'app-29.example.com' (Got timeout reading communication packets)
2015-10-15T09:15:13.770989Z 21938 [Note] Aborted connection 21938 to db: 'unconnected' user: 'check_dba' host: 'localhost' (Got an error reading communication packets)
2015-10-15T09:15:13.790774Z 21937 [Note] Aborted connection 21937 to db: 'unconnected' user: 'check_dba' host: 'localhost' (Got an error reading communication packets)
2015-10-15T09:15:14.986129Z 18478 [Note] Aborted connection 18478 to db: 'mydb' user: 'app' host: 'app-29.example.com' (Got timeout reading communication packets)
2015-10-15T09:15:16.982119Z 18504 [Note] Aborted connection 18504 to db: 'mydb' user: 'app' host: 'app-22.example.com' (Got timeout reading communication packets)
2015-10-15T09:15:17.126796Z 18503 [Note] Aborted connection 18503 to db: 'mydb' user: 'app' host: 'app-09.example.com' (Got timeout reading communication packets)
2015-10-15T09:15:19.002323Z 21973 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2015-10-15T09:15:19.089593Z 18526 [Note] Aborted connection 18526 to db: 'mydb' user: 'app' host: 'app-07.example.com' (Got timeout reading communication packets)
2015-10-15T09:15:20.424670Z 18525 [Note] Aborted connection 18525 to db: 'mydb' user: 'app' host: 'app-14.example.com' (Got timeout reading communication packets)

How to repeat:
Get some applications to talk to MySQL and wait for errors.

There may be a lot of reasons for this type of message.
The point here is that this sort of logging can happen quite frequently and is not under the DBA's control.

11:24:37 [me@myserver ~]$ sudo grep -c Aborted /var/log/mysqld.log
54036
11:25:26 [me@myserver ~]$ sudo head -1 /var/log/mysqld.log
2015-10-15T01:31:02.399506Z 56682 [Note] Aborted connection 56682 to db: 'mydb' user: 'app' host: 'app-02.example.com' (Got timeout reading communication packets)

That's for a period of 8 hours.

Suggested fix:
It's not reasonable to change the global log level for this type of logging from 3 to 2 as it basically makes a lot of other things that you may want to see invisible.

I would like to see a configuration option which allows me to silence these specific (and any other similar) warnings (though they're labelled as Note in the logging) if I want to.

There are counters indicating the number of such events that are happening.
Once I've identified whether I can ignore this I am likely to want to hide them and then just focus on the counters.
If these metrics from the counters change significantly then I might be tempted to "unhide" this type of message and investigate again.

Note: this is a general problem. The famous unsafe replication messages which can be even more verbose also fall in this category.  So coming up with a mechanism which might be a little more generic might be useful.
[19 Oct 2015 8:31] MySQL Verification Team
Hello Simon,

Thank you for the feature request!

Thanks,
Umesh
[9 May 2018 1:43] Ryan Brothers
I am running into the above issue too.  I would like to have log_error_verbosity = 3, so that Note's are logged, but do not need the "Aborted connection" errors.  MySQL 5.6 didn't have this issue.
[11 Jan 2019 10:03] lalit Choudhary
Using the new variable log-error-suppression-list  introduced in MySQL 8.0.13 we can suppress particular WARNING or INFORMATION.

https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_log_error_supp...

This variable enables specifying which diagnostics should not be written to the error log when they occur with a severity of WARNING or INFORMATION.