[MDEV-24134] 10.4.16 update breaks python Created: 2020-11-05  Updated: 2020-12-16  Resolved: 2020-11-06

Status: Closed
Project: MariaDB Server
Component/s: Binary Protocol
Affects Version/s: 10.4.16
Fix Version/s: 10.2.36, 10.3.27, 10.4.17, 10.5.8

Type: Bug Priority: Blocker
Reporter: Frank Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 0
Labels: None
Environment:

CentOS7


Issue Links:
PartOf
includes MDEV-24146 latest update (10.5.7) breaks communi... Closed
is part of MDEV-24121 Recent MariaDB update appears to have... Closed
Relates
relates to MDBF-203 Ecosystem CI - mysql-connector-python Open
relates to MDEV-15148 Protocol regression testing for the s... Open

 Description   

With the update from 10.4.15 to 10.4.16, python apps can't access the database from localhost anymore.
The connection fails with:
1835 (HY000): Malformed communication packet

Downgrading to 10.4.15 will solve it.



 Comments   
Comment by Daniel Black [ 2020-11-05 ]

seems likely that its the same cause as MDEV-24121

Comment by Daniel Black [ 2020-11-05 ]

can you include which python interface you are using and its version?

Sample code also welcome.

Comment by Frank [ 2020-11-05 ]

I use python 3.6 and the mysql-connector 8.0.18 on CentOS7.8
here some sample code:

import mysql.connector as db_connector
db_connection = db_connector.connect(user="root", password=root_pw, unix_socket=socket_path, database="mysql",use_pure=True)
db_cursor = db_connection.cursor(prepared=True)
#Here the error will thrown.
db_cursor.execute("select version()")

Comment by Frank [ 2020-11-05 ]

Using the the maraidb python connector build with the mariadb C client lib will work, but needs some source modification, because "use_pure" for example is unknown to the mariadb implementation. So an simple replace of "import mysql.connector as db_connector" to "import mariadb as db_connector" does not work in all cases.

Comment by Sergei Golubchik [ 2020-11-05 ]

This is a bug in mysql-connector-python. I've reported it as https://bugs.mysql.com/bug.php?id=101479

Latest MariaDB releases have stricter packet validation as a security measure and these broken packets are now rejected.
Meanwhile we're currently discussing whether to relax the packet validation to allow these invalid packets as a special exception.

Comment by RedVirus [ 2020-11-05 ]

After many workarounds i tried today this the solutions i got

1- upgrade to php 7.3 or 7.4
(many websites will be down after php upgrades )

2- downgrade to minor version ( EX: mariadb 10.4.16 to 10.4.15)

yum downgrade MariaDB-server MariaDB-common MariaDB-shared MariaDB-client MariaDB-compat MariaDB-devel    

Generated at Thu Feb 08 09:27:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.