XF 2.0 MariaDB 10.3.26-1 Breaks PHP < 7.2

MattW

Well-known member
Just wanting to post this here, as I've spent the last 2 hours fault finding an issue on my servers this morning.

cPanel servers, all the latest updates. MariaDB automatically updated to 10.3.26-1 over night as part of the cPanel yum update.

As soon as this happened, any XenForo site running on PHP7.2 or below broke!

Code:
[04-Nov-2020 08:24:41 UTC] PHP Fatal error:  Uncaught XF\Db\Exception: MySQL query error [1835]: Malformed communication packet in /home/XXX/public_html/community/src/XF/Db/AbstractStatement.php:212
Stack trace:
#0 /home/XXX/public_html/community/src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1835, 'HY000')
#1 /home/XXX/public_html/community/src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1835, 'HY000')
#2 /home/XXX/public_html/community/src/XF/Db/AbstractAdapter.php(79): XF\Db\Mysqli\Statement->execute()
#3 /home/XXX/public_html/community/src/XF/Db/AbstractAdapter.php(116): XF\Db\AbstractAdapter->query('\n\t\t\tSELECT data...', Array)
#4 /home/XXX/public_html/community/src/XF/DataRegistry.php(137): XF\Db\AbstractAdapter->fetchPairs('\n\t\t\tSELECT data...')
#5 /home/XXX/public_html/community/src/XF/DataRegistry.php(82): XF\DataRegistry->readFromDb(Array, Array)
#6 /home/XXX/public_html/community/src/XF/DataRegistry.php(225): XF\DataRegistry- in /home/XXX/public_html/community/src/XF/Db/AbstractStatement.php on line 212

Swapping to 7.3 or 7.4 works.

I've had to downgrade MariaDB back to the previous version:

Code:
# yum history info 264
Loaded plugins: fastestmirror, universal-hooks
Transaction ID : 264
Begin time     : Wed Nov  4 05:35:28 2020
Begin rpmdb    : 1964:269d3e2a5fc59faed15b162386618da46afe3e28
End time       :            05:36:05 2020 (37 seconds)
End rpmdb      : 1964:7aac4ca2ee1e5c81b04babc4f774126e1254d10d
User           : root <root>
Return-Code    : Success
Command Line   : --assumeyes --color=never --config /etc/yum.conf update --disablerepo=epel
Transaction performed with:
    Installed     rpm-4.11.3-43.el7.x86_64                        @base
    Installed     yum-3.4.3-167.el7.centos.noarch                 @base
    Installed     yum-metadata-parser-1.1.4-10.el7.x86_64         @anaconda
    Installed     yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch @updates
Packages Altered:
    Updated MariaDB-client-10.3.25-1.el7.centos.x86_64 @MariaDB103
    Update                 10.3.26-1.el7.centos.x86_64 @MariaDB103
    Updated MariaDB-common-10.3.25-1.el7.centos.x86_64 @MariaDB103
    Update                 10.3.26-1.el7.centos.x86_64 @MariaDB103
    Updated MariaDB-compat-10.3.25-1.el7.centos.x86_64 @MariaDB103
    Update                 10.3.26-1.el7.centos.x86_64 @MariaDB103
    Updated MariaDB-devel-10.3.25-1.el7.centos.x86_64  @MariaDB103
    Update                10.3.26-1.el7.centos.x86_64  @MariaDB103
    Updated MariaDB-server-10.3.25-1.el7.centos.x86_64 @MariaDB103
    Update                 10.3.26-1.el7.centos.x86_64 @MariaDB103
    Updated MariaDB-shared-10.3.25-1.el7.centos.x86_64 @MariaDB103
    Update                 10.3.26-1.el7.centos.x86_64 @MariaDB103
    Updated galera-25.3.30-1.el7.centos.x86_64         @MariaDB103
    Update         25.3.31-1.el7.centos.x86_64         @MariaDB103
history info

And this fixes the issue. So, I don't know if it's a PHP issue, a MariaDB issue, or something combining everything! I've excluded MariaDB and Galera now from automatic updates on my servers.
 
I have one site still on PHP 7.1.x. Fortunately, I don't think that server has been auto-upgraded but upgrading isn't an option for vBulletin 4.2.5. My hope would be that they relax the insistence on strict packet validation.
Yeah, I think they have just stated in there they are going to release an update with relaxed checking. Otherwise, they just pretty much killed off anything prior to PHP7.3
 
Well fix that ;)
Ideally, the best option, yes.

But in the case of my last remaining vBulletin site, sometimes traffic and/or COVID and/or other financial concerns don't make the upgrade feasible at this time. I would love to leave vBulletin behind forever. :)

The same would be true of some large or heavily customized XF 1.5 forums. It's not just a matter of upgrading to XF 2.x. There may be additional costs for upgrading custom addons and styles.
 
As soon as this happened, any XenForo site running on PHP7.2 or below broke!

Apparently issue is with <=7.2 mysqlnd which doesn't have fixes 7.3+ have [MDEV-24121] Recent MariaDB update appears to have introduced a DB connection issue for PHP < 7.3 (or anything using PDO) - Jira

I am testing for Centmin Mod PHP-FPM backported mysqlnd fixes from 7.3 to 5.6.40, 7.0.33, 7.1.33 and 7.2.x and they seem to work on Wordpress and Xenforo 2.1 so far from quick testing linked below
Xenforo 2.1 with PHP 7.2.34 backported patch fixes for mysqlnd from PHP 7.3

xf21-php7234-mariadb-10.3.26-01.webp

And Xenforo 2.1 with PHP 7.1.33 backported patch fixes for mysqlnd from PHP 7.3

xf21-php7133-mariadb-10.3.26-01.webp

However, from that Jira link, cPanel and other web apps have other PHP and other MySQL client/connectors which may not work with MariaDB's new 10.5.7, 10.4.16, 10.3.26, 10.2.35 and 10.1.48 releases' stricter packet validation requirements.
 
The issue was resolved on MariaDB's side and the new releases (10.2.36, 10.3.27, 10.4.17, 10.5.8) should be out within days.

I'm on the 10.3 branch of MariaDB and I'd read elsewhere that even 10.3.27 is flawed, but 10.3.28 should fix it all.

I hit this error last night when I was upgrading various things on my servers. I don't use yum so I had to find a way to roll back to 10.3.25. Luckily, this worked using apt:

apt install mariadb-client-10.3=1:10.3.25+maria~bionic mariadb-client-core-10.3=1:10.3.25+maria~bionic mariadb-server-10.3=1:10.3.25+maria~bionic mariadb-server-core-10.3=1:10.3.25+maria~bionic mariadb-server=1:10.3.25+maria~bionic mariadb-client=1:10.3.25+maria~bionic

(Use at your own risk if you decide to try the code above. I won't guarantee it works for anyone else.)

Changing PHP versions did nothing. This got me back online. No data issues with this downgrade either--I run a backup script that dumps my databases a few times per day via cron, so I ran it manually just prior to the downgrade. I haven't had to use the backup. 😉
 
I'm on the 10.3 branch of MariaDB and I'd read elsewhere that even 10.3.27 is flawed, but 10.3.28 should fix it all.

I hit this error last night when I was upgrading various things on my servers. I don't use yum so I had to find a way to roll back to 10.3.25. Luckily, this worked using apt:

apt install mariadb-client-10.3=1:10.3.25+maria~bionic mariadb-client-core-10.3=1:10.3.25+maria~bionic mariadb-server-10.3=1:10.3.25+maria~bionic mariadb-server-core-10.3=1:10.3.25+maria~bionic mariadb-server=1:10.3.25+maria~bionic mariadb-client=1:10.3.25+maria~bionic

(Use at your own risk if you decide to try the code above. I won't guarantee it works for anyone else.)

Changing PHP versions did nothing. This got me back online. No data issues with this downgrade either--I run a backup script that dumps my databases a few times per day via cron, so I ran it manually just prior to the downgrade. I haven't had to use the backup. 😉
Just tried it and can confirm that 10.3.27 fixes the issue, so I'm assuming the new 10.2.36, 10.4.17 and 10.5.8 releases also fix the issue
 
Top Bottom