[ERROR] Unexpected packet from client <IP> . Session_status: 6 , client_status: 0 Disconnecting it

43 views
Skip to first unread message

Lubomir Budzak

unread,
Jul 30, 2025, 5:01:50 AMJul 30
to proxysql
Hello,

I'm experiencing very strange behavior from ProxySQL.
I've got application which have to connect to MariaDB but app can't connect through proxysql as connections are keep killed by proxysql. 
If I point app directly to MariaDB server, it works fine without dropped connections.
I also tried to switch on fast_forward and in this case app works fine. 
Multiplexing has been switched off and on but without any difference in behavior.

Does any of you gurus experienced such behavior?
ProxySQL ver.: 3.0.1
MariaDB ver.: 10.3.

Below messages are repeating in the logs. 
Proxysql.log
2025-07-30 10:29:28 MySQL_Session.cpp:3688:handler___status_NONE_or_default(): [ERROR] Unexpected packet from client <IP> . Session_status: 6 , client_status: 0 Disconnecting it
2025-07-30 10:29:33 MySQL_Session.cpp:3688:handler___status_NONE_or_default(): [ERROR] Unexpected packet from client  <IP>  . Session_status: 6 , client_status: 0 Disconnecting it
2025-07-30 10:29:33 MySQL_Session.cpp:3688:handler___status_NONE_or_default(): [ERROR] Unexpected packet from client  <IP>  . Session_status: 10 , client_status: 0 Disconnecting it
2025-07-30 10:29:33 MySQL_Session.cpp:269:kill_query_thread(): [WARNING] KILL CONNECTION 55202 on db-server-01:3306 

MariaDB.log
2025-07-30 10:31:56 55295 [Warning] Aborted connection 55295 to db: 'dev' user: 'dev' host: 'proxy-01' (Got an error reading communication packets)
2025-07-30 10:31:56 55295 [Warning] Aborted connection 55295 to db: 'dev' user: 'dev' host: 'proxy-01' (CLOSE_CONNECTION)

Thank you in advance.
Best Regards
Lubo

René Cannaò

unread,
Jul 30, 2025, 5:14:54 AMJul 30
to Lubomir Budzak, proxysql
Hi Lubo,

Thank you for using ProxySQL.

ProxySQL internally has a state machine, and the error you are seeing means that proxysql received a packet from the client while it was not expecting it (according to its state machine).
In the past we identified multiple scenarios when this happened, for example:
* haproxy sends a QUIT command before authentication is completed : proxysql handles this
* a client can send a QUIT command while waiting for a query to complete: proxysql handles this
* a client can send a query before authentication is completed: we have seen this with mariadb connector/J and it is a configuration setting (I don't remember the name), proxysql doesn't handle this
* mariadb connector/J with useBatchMultiSend enabled , where multiple queries can be sent without waiting for them to complete : proxysql doesn't support it

Can you share the output of tcpdump (or equivalent) so we can understand what is happening?

Thanks,
René

--
You received this message because you are subscribed to the Google Groups "proxysql" group.
To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/proxysql/16356b32-61f7-4a16-995d-13e45b7d0b9an%40googlegroups.com.

Lubomir Budzak

unread,
Jul 31, 2025, 3:33:14 AMJul 31
to proxysql
Hi Rene,

Thank you for your answer.
I'm suspecting that the problem is described in your last point.
I'm in touch with vendor of the application to clarify this.

Are there plans for ProxySQL to support those batchmultisend transactions?

Thanks,
Lubo

René Cannaò

unread,
Jul 31, 2025, 6:00:38 AMJul 31
to Lubomir Budzak, proxysql
Hi Lubo,

No, there is no plan to support useBatchMultiSend, as we believe it is a good practice and we don't want to encourage it.
Setting useBatchMultiSend can make sending data to the server (or ProxySQL in this case) more efficient, but it is a nightmare for error handling.
A query may fail, and the client would have already sent more data without knowing that a previous query failed.

We have seen useBatchMultiSend being used mostly for INSERT statements. In that case, using multi-rows INSERT statements would be way more efficient in term of performance (1 INSERT with 100 rows is more efficient than 100 INSERTs with 1 row each even if useBatchMultiSend is used), and it completely remove the error handling nightmare.
For reference:

René Cannaò

unread,
Jul 31, 2025, 6:03:37 AMJul 31
to Lubomir Budzak, proxysql
Typo in my previous email:

as we believe it is not a good practice and we don't want to encourage it.

Lubomir Budzak

unread,
Jul 31, 2025, 9:32:50 AMJul 31
to proxysql
Hi Rene,

I had a meeting with software vendor and they will fix this issue with useBatchMultiSend.
One question arise during meeting. How should be preset continueBatchOnError as it is enabled by default.
My understanding is that, this option should be disabled. Am I right?
Is the option continueBatchOnError restricted by ProxySQL?

Best Regards
Lubo
Reply all
Reply to author
Forward
0 new messages