Bug #81507 Variable name Connection_errors_peer_address truncated in documentation
Submitted: 19 May 2016 12:29 Modified: 29 Oct 2017 23:38
Reporter: Przemyslaw Malkowski Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.6,5.7 OS:Any
Assigned to: CPU Architecture:Any
Tags: Connection_errors_peer_address

[19 May 2016 12:29] Przemyslaw Malkowski
Description:
In the documentation we can see:
http://dev.mysql.com/doc/refman/5.6/en/server-status-variables.html#statvar_Connection_err...

" Connection_errors_peer_addr

The number of errors that occurred while searching for connecting client IP addresses."

While the actual variable name is:

mysql [localhost] {msandbox} (test) > SHOW GLOBAL STATUS LIKE 'connection_errors_p%';
+--------------------------------+-------+
| Variable_name                  | Value |
+--------------------------------+-------+
| Connection_errors_peer_address | 0     |
+--------------------------------+-------+
1 row in set (0.00 sec)

Also, the description is a bit confusing. I guess it means failed rev-DNS lookups (when skip_name_resolve=off), or maybe it also means failed rev-DNS and DNS lookup non-match occurrences? 

From http://dev.mysql.com/doc/refman/5.7/en/host-cache.html we can read:
"For each new client connection, the server uses the client IP address to check whether the client host name is in the host cache. If not, the server attempts to resolve the host name. First, it resolves the IP address to a host name and resolves that host name back to an IP address. Then it compares the result to the original IP address to ensure that they are the same."

So will that counter increase only if rev-DNS lookup failed to find hostname for IP, or will it also increase when for the found hostname the DNS lookup result IP does not match the connecting IP?

How to repeat:
Compare the var name in documentation and real one.

Suggested fix:
Correct the var name and extend it's description.
[19 May 2016 13:18] MySQL Verification Team
Hello Przemyslaw,

Thank you for the report!

Thanks,
Umesh
[20 May 2016 8:43] Przemyslaw Malkowski
It seems also that Connection_errors_peer_address is not related to the skip_name_resolve setting, and it may increase even if DNS lookups are disabled. In my tests, the nmap TCP port scan always increments this status variable:

mysql> select @@version,@@version_comment;
+-----------------------------+-------------------+
| @@version                   | @@version_comment |
+-----------------------------+-------------------+
| 5.6.30-0ubuntu0.14.04.1-log | (Ubuntu)          |
+-----------------------------+-------------------+
1 row in set (0.00 sec)

mysql> select @@port,@@bind_address,@@skip_name_resolve;
+--------+----------------+---------------------+
| @@port | @@bind_address | @@skip_name_resolve |
+--------+----------------+---------------------+
|   3306 | *              |                   1 |
+--------+----------------+---------------------+
1 row in set (0.00 sec)

mysql> SHOW GLOBAL STATUS  where Variable_name like 'Connection_errors_%' or Variable_name like 'Abort%';
+-----------------------------------+-------+
| Variable_name                     | Value |
+-----------------------------------+-------+
| Aborted_clients                   | 0     |
| Aborted_connects                  | 0     |
| Connection_errors_accept          | 0     |
| Connection_errors_internal        | 0     |
| Connection_errors_max_connections | 0     |
| Connection_errors_peer_address    | 0     |
| Connection_errors_select          | 0     |
| Connection_errors_tcpwrap         | 0     |
+-----------------------------------+-------+
8 rows in set (0.01 sec)

przemek@lap:~$ mysql -h10.90.0.23 -P 3306 -pfoobar
Warning: Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'przemek'@'10.90.0.23' (using password: YES)

mysql> SHOW GLOBAL STATUS  where Variable_name like 'Connection_errors_%' or Variable_name like 'Abort%';
+-----------------------------------+-------+
| Variable_name                     | Value |
+-----------------------------------+-------+
| Aborted_clients                   | 0     |
| Aborted_connects                  | 1     |
| Connection_errors_accept          | 0     |
| Connection_errors_internal        | 0     |
| Connection_errors_max_connections | 0     |
| Connection_errors_peer_address    | 0     |
| Connection_errors_select          | 0     |
| Connection_errors_tcpwrap         | 0     |
+-----------------------------------+-------+
8 rows in set (0.00 sec)

przemek@lap:~$ telnet 10.90.0.23 3306
Trying 10.90.0.23...
Connected to 10.90.0.23.
Escape character is '^]'.
_
5.6.30-0ubuntu0.14.04.1-log&t~>X";B�aYwj1S-(}`I-mysql_native_passwordaa
!#08S01Got packets out of orderConnection closed by foreign host.

mysql> SHOW GLOBAL STATUS  where Variable_name like 'Connection_errors_%' or Variable_name like 'Abort%';
+-----------------------------------+-------+
| Variable_name                     | Value |
+-----------------------------------+-------+
| Aborted_clients                   | 0     |
| Aborted_connects                  | 2     |
| Connection_errors_accept          | 0     |
| Connection_errors_internal        | 0     |
| Connection_errors_max_connections | 0     |
| Connection_errors_peer_address    | 0     |
| Connection_errors_select          | 0     |
| Connection_errors_tcpwrap         | 0     |
+-----------------------------------+-------+
8 rows in set (0.00 sec)

przemek@lap:~$ nmap -sT -p 3306 10.90.0.23

Starting Nmap 6.40 ( http://nmap.org ) at 2016-05-20 10:34 CEST
Nmap scan report for 10.90.0.23
Host is up (0.000031s latency).
PORT     STATE SERVICE
3306/tcp open  mysql

Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds

mysql> SHOW GLOBAL STATUS  where Variable_name like 'Connection_errors_%' or Variable_name like 'Abort%';
+-----------------------------------+-------+
| Variable_name                     | Value |
+-----------------------------------+-------+
| Aborted_clients                   | 0     |
| Aborted_connects                  | 3     |
| Connection_errors_accept          | 0     |
| Connection_errors_internal        | 0     |
| Connection_errors_max_connections | 0     |
| Connection_errors_peer_address    | 1     |
| Connection_errors_select          | 0     |
| Connection_errors_tcpwrap         | 0     |
+-----------------------------------+-------+
8 rows in set (0.00 sec)
[29 Oct 2017 23:38] Paul DuBois
Posted by developer:
 
Variable name corrected:
https://dev.mysql.com/doc/refman/5.6/en/server-status-variables.html#statvar_Connection_er...

No change to description, which comes as the spec defines it.