-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The message "Session 1.126 expected to read 4 bytes but only read 0" is being logged at the Error level every 5 minutes. #1526
Comments
Please enable "Trace"-level logging for MySqlConnector and upload a section of the logs that show this error. |
The following message was printed out
|
This seems to be the crux of the issue:
The server advertises that it supports "reset connection", but it looks like it actually doesn't. Are you connecting directly to MySQL Server 8.0.28, or using ProxySQL or some other proxy? Looks like you might be using Amazon RDS Proxy; is that correct? It claims to be "fully compatible with the protocols of supported database engines" but that may not actually be the case. I would recommend grabbing a Wireshark packet capture and opening a support ticket with AWS about failing to implement COM_RESET_CONNECTION properly. |
Secondly, the presence of "Pool 7" and "Pool 8" in your logs could be a potential red flags. It's certainly unusual to have that many distinct connection pools in one application. Why are so many separate pools being created? |
I am using Amazon RDS proxy. I will ask aws for COM_RESET_CONNECTION |
We are accessing 10 databases. |
We are wondering when support for COM_RESET_CONNECTION began, and whether it was added after version 2.2.1. Through various tests, we have found that version 2.2.1 does not produce errors, while version 2.4.0 does. |
Connection resetting has been present since v0.x, but is conditional based on whether the server returns a version number that should support it (>= 5.7.3): https://github.com/mysql-net/MySqlConnector/blob/master/src/MySqlConnector/Core/ServerVersions.cs#L9 My guess is that your server/proxy recently started claiming to be MySQL 5.7 (or later) but doesn't actually support |
What is puzzling is that MySqlConnector version 2.2.1 does not produce any errors, while version 2.4.0 does. This difference occurs even though we are connecting to the same proxy. We suspect that there might be differences in protocol parsing between the versions. |
I asked Amazon, and they said that they support COM_RESET_CONNECTION properly. |
If you can capture a Wireshark packet capture (of an unencrypted connection), that would show whether it does or not. |
It seems difficult to use Wireshark on a server connected to an RDS proxy. Ultimately, the only option is to downgrade the version. |
Software versions
MySqlConnector version: 2.4.0
Server type (MySQL, MariaDB, Aurora, etc.) and version: Aurora, 8.0.mysql_aurora.3.04.3, rds proxy
.NET version: net6.0
(Optional) ORM NuGet packages and versions: Dapper 2.1.35
Describe the bug
A clear and concise description of what the bug is.
The message "Session 1.126 expected to read 4 bytes but only read 0" is being logged at the Error level every 5 minutes. This message does not appear in version 2.2.1.
The text was updated successfully, but these errors were encountered: