[MXS-3436] Packet received out-of-order. Expected 1; got 3 Created: 2021-03-12  Updated: 2021-04-18  Resolved: 2021-03-18

Status: Closed
Project: MariaDB MaxScale
Component/s: Protocol
Affects Version/s: 2.5.7
Fix Version/s: 2.5.10

Type: Bug Priority: Major
Reporter: Allen Lee (Inactive) Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None
Environment:

Amazon EC2, CentOS


Attachments: Text File maxscale_dotnetconnector errors while using maxscale 2.5.7.txt    
Sprint: MXS-SPRINT-127

 Description   

customer reported the following error when connecting to maxscale 2.5.7 using MySqlConnector(https://www.nuget.org/packages/MySqlConnector/0.61.0) and mariadb version is 10.3.27,

from application server logs where it was using .net connector
---------------------------------------------------------------
 
MySql.Data.MySqlClient.MySqlProtocolException
  HResult=0x80131509
  Message=Packet received out-of-order. Expected 1; got 3.
  Source=mscorlib
  StackTrace:
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MySqlConnector.Protocol.Serialization.ProtocolUtility.DoReadPayloadAsync(BufferedByteReader bufferedByteReader, IByteHandler byteHandler, Func`1 getNextSequenceNumber, ArraySegmentHolder`1 previousPayloads, ProtocolErrorBehavior protocolErrorBehavior, IOBehavior ioBehavior) in C:\projects\mysqlconnector\src\MySqlConnector\Protocol\Serialization\ProtocolUtility.cs:line 470
   at MySqlConnector.Protocol.Serialization.StandardPayloadHandler.ReadPayloadAsync(ArraySegmentHolder`1 cache, ProtocolErrorBehavior protocolErrorBehavior, IOBehavior ioBehavior) in C:\projects\mysqlconnector\src\MySqlConnector\Protocol\Serialization\StandardPayloadHandler.cs:line 42
   at MySqlConnector.Core.ServerSession.ReceiveReplyAsync(IOBehavior ioBehavior, CancellationToken cancellationToken) in C:\projects\mysqlconnector\src\MySqlConnector\Core\ServerSession.cs:line 734
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MySqlConnector.Core.ServerSession.<ReceiveReplyAsyncAwaited>d__78.MoveNext() in C:\projects\mysqlconnector\src\MySqlConnector\Core\ServerSession.cs:line 769
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at MySqlConnector.Core.ServerSession.<TryResetConnectionAsync>d__69.MoveNext() in C:\projects\mysqlconnector\src\MySqlConnector\Core\ServerSession.cs:line 494
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at MySqlConnector.Core.ConnectionPool.<GetSessionAsync>d__10.MoveNext() in C:\projects\mysqlconnector\src\MySqlConnector\Core\ConnectionPool.cs:line 72
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at MySqlConnector.Core.ConnectionPool.<GetSessionAsync>d__10.MoveNext() in C:\projects\mysqlconnector\src\MySqlConnector\Core\ConnectionPool.cs:line 141
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at MySql.Data.MySqlClient.MySqlConnection.<CreateSessionAsync>d__109.MoveNext() in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlConnection.cs:line 645
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MySql.Data.MySqlClient.MySqlConnection.<OpenAsync>d__25.MoveNext() in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlConnection.cs:line 312
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MySql.Data.MySqlClient.MySqlConnection.Open() in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlConnection.cs:line 280
   at MPP.SessionMgr.GlobalSessionSettings.GetDbSessionSettings() in C:\Users\ballenal\source\repos\mpp_web_2_0\SessionMgr\GlobaSessionSettings.cs:line 64
   at MPP.SessionMgr.GlobalSessionSettings..ctor() in C:\Users\ballenal\source\repos\mpp_web_2_0\SessionMgr\GlobaSessionSettings.cs:line 25
   at MPP.SessionMgr.SessionManager..ctor() in C:\Users\ballenal\source\repos\mpp_web_2_0\SessionMgr\SessionManager.cs:line 30
 
  This exception was originally thrown at this call stack:
    [External Code]
    MPP.SessionMgr.GlobalSessionSettings.GetDbSessionSettings() in GlobaSessionSettings.cs
    MPP.SessionMgr.GlobalSessionSettings.GlobalSessionSettings() in GlobaSessionSettings.cs
    MPP.SessionMgr.SessionManager.SessionManager() in SessionManager.cs

Attaching shared log from customers.
When I searched error messages, it seems to be fixed in mariadb server side - https://jira.mariadb.org/browse/MDEV-16308, but I am not sure if it is maxscale issue or server issue.



 Comments   
Comment by markus makela [ 2021-03-12 ]

What were the commands that they executed that caused this? It looks like the connector is resetting the connection and it doesn't expect the response MaxScale sends it.

Generated at Thu Feb 08 04:21:24 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.