MySQL Error Log: Got packets out of order

Some users, myself included, have noticed that their MySQL error log contains many lines like this one:

2024-09-06T09:28:40.522161Z 17 [Note] [MY-010914] [Server] Got packets out of order

Where does that error come from?

The error MY-010914 is part of the Server Network issues like:

  • Aborted connection XX to db: …
  • Bad handshake
  • Got an error reading communication packets
  • Access denied for user…
  • Got an error writing communication packets

Those are usually more problematic than the ones we are covering today. The list is not exhaustive and in the source code it’s linked to the code 08S01 (see messages_to_clients.txt).

We can also find these error messages directly in SQL using the Performance_Schema.error_log table:

select logged, error_code, data 
from performance_schema.error_log 
where error_code='MY-010914' and data like 'Got pac%';
+----------------------------+------------+--------------------------+
| logged                     | error_code | data                     |
+----------------------------+------------+--------------------------+
| 2022-11-23 09:27:57.883811 | MY-010914  | Got packets out of order |
| 2022-11-23 09:28:43.344445 | MY-010914  | Got packets out of order |
| 2022-11-23 09:28:55.084487 | MY-010914  | Got packets out of order |
| 2022-11-23 09:41:07.709642 | MY-010914  | Got packets out of order |
| 2022-11-23 09:41:37.818513 | MY-010914  | Got packets out of order |
| 2022-11-23 09:42:05.204045 | MY-010914  | Got packets out of order |
| 2022-11-23 19:48:19.330805 | MY-010914  | Got packets out of order |
| 2022-11-23 19:48:48.315551 | MY-010914  | Got packets out of order |
| 2022-11-23 19:54:57.199975 | MY-010914  | Got packets out of order |
| 2023-01-10 20:10:48.468668 | MY-010914  | Got packets out of order |
| 2023-01-10 20:10:51.805285 | MY-010914  | Got packets out of order |
| 2023-01-10 20:10:53.709311 | MY-010914  | Got packets out of order |
| 2023-01-10 20:10:55.449370 | MY-010914  | Got packets out of order |
| 2023-01-10 20:10:58.566038 | MY-010914  | Got packets out of order |
| 2023-01-10 20:11:02.172487 | MY-010914  | Got packets out of order |
| 2023-01-10 20:11:31.530352 | MY-010914  | Got packets out of order |
| 2023-01-10 20:11:31.553191 | MY-010914  | Got packets out of order |
| 2023-01-10 20:11:31.576344 | MY-010914  | Got packets out of order |
| 2023-01-10 20:11:31.599065 | MY-010914  | Got packets out of order |
| 2023-01-10 20:11:31.621616 | MY-010914  | Got packets out of order |
| 2023-01-10 20:11:33.153894 | MY-010914  | Got packets out of order |
| 2023-01-10 20:11:35.185318 | MY-010914  | Got packets out of order |
| 2023-01-10 20:11:38.216721 | MY-010914  | Got packets out of order |
| 2023-01-10 20:11:42.247996 | MY-010914  | Got packets out of order |
| 2023-01-10 20:11:47.279218 | MY-010914  | Got packets out of order |
| 2023-01-10 21:18:47.471577 | MY-010914  | Got packets out of order |
| 2023-01-10 21:18:47.495377 | MY-010914  | Got packets out of order |
| 2023-01-10 21:18:47.518553 | MY-010914  | Got packets out of order |
| 2023-01-10 21:18:47.540924 | MY-010914  | Got packets out of order |
| 2023-01-10 21:18:47.563095 | MY-010914  | Got packets out of order |
| 2023-01-10 21:18:49.095117 | MY-010914  | Got packets out of order |
| 2023-01-10 21:18:51.126462 | MY-010914  | Got packets out of order |
| 2023-01-10 21:18:54.150369 | MY-010914  | Got packets out of order |
| 2023-01-10 21:18:58.182722 | MY-010914  | Got packets out of order |
| 2023-01-10 21:19:03.250865 | MY-010914  | Got packets out of order |
| 2023-01-10 21:20:06.621526 | MY-010914  | Got packets out of order |
| 2023-01-10 21:20:13.688208 | MY-010914  | Got packets out of order |
| 2023-01-10 21:20:21.711720 | MY-010914  | Got packets out of order |
| 2023-01-10 21:20:30.735161 | MY-010914  | Got packets out of order |
| 2023-01-10 21:20:40.766047 | MY-010914  | Got packets out of order |
| 2023-01-10 21:20:51.792418 | MY-010914  | Got packets out of order |
| 2023-01-10 21:21:03.825029 | MY-010914  | Got packets out of order |
| 2023-01-10 21:21:16.852271 | MY-010914  | Got packets out of order |
| 2023-01-10 21:21:30.879313 | MY-010914  | Got packets out of order |
| 2023-01-10 21:21:45.903695 | MY-010914  | Got packets out of order |
| 2023-01-11 00:34:51.461460 | MY-010914  | Got packets out of order |
| 2023-01-11 00:35:08.492683 | MY-010914  | Got packets out of order |
| 2023-01-11 00:35:26.524584 | MY-010914  | Got packets out of order |
| 2023-01-11 00:35:45.548196 | MY-010914  | Got packets out of order |
| 2023-01-11 00:36:05.572190 | MY-010914  | Got packets out of order |
| 2023-01-11 00:36:26.599265 | MY-010914  | Got packets out of order |
| 2023-01-11 00:36:48.628772 | MY-010914  | Got packets out of order |
| 2023-01-11 00:37:11.655052 | MY-010914  | Got packets out of order |
| 2023-01-11 00:37:35.686823 | MY-010914  | Got packets out of order |
| 2023-01-11 00:38:00.715854 | MY-010914  | Got packets out of order |
| 2024-03-20 08:44:47.223223 | MY-010914  | Got packets out of order |
| 2024-09-06 11:22:47.741612 | MY-010914  | Got packets out of order |
| 2024-09-06 11:28:32.494030 | MY-010914  | Got packets out of order |
| 2024-09-06 11:28:40.522161 | MY-010914  | Got packets out of order |
+----------------------------+------------+--------------------------+
59 rows in set (0.0058 sec)

Who/what’s is responsible?

So, now that we see all these error messages, where are they from?

There is a good chance these errors are caused by MySQL Shell!

If you use MySQL Shell to connect to MySQL providing the port but not the protocol, MySQL Shell will first try to use the X protocol and if it fails, it will use the classic protocol.

For example, this command will produce a Got packets out of order in the MySQL error log:

$ mysqlsh root@localhost:3306

This problem has been fixed in MySQL Shell 9.0.

If you use MySQL Shell 8.0 or 8.4, even if it’s always recommended to use the very last MySQL Shell, there is no need to use the same MySQL Shell version as the MySQL Server version, specifying the protocol will fix this issue:

$ mysqlsh mysql://root@localhost:3306

MySQL Shell supports URI like protocol://user@host:port where the protocol can by mysql or mysqlx.

Conclusion

If you saw those errors in your logs and couldn’t explain them, it was likely due to a connection with MySQL Shell using the Classic protocol port without specifying the protocol.

I recommend always using the latest version of MySQL Shell, even if it’s an Innovation Release and you’re using an older or LTS version of the server.

Enjoy MySQL & MySQL Shell!

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Leave a Reply

Your email address will not be published. Required fields are marked *

As MySQL Community Manager, I am an employee of Oracle and the views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

You can find articles I wrote on Oracle’s blog.