php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74320 mysqli_fetch_array(): Malformed server packet & Error while reading a row...
Submitted: 2017-03-27 21:57 UTC Modified: -
From: kelvin dot middleton at gmail dot com Assigned:
Status: Open Package: MySQLi related
PHP Version: 7.0.17 OS: Ubuntu 16.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
42 + 28 = ?
Subscribe to this entry?

 
 [2017-03-27 21:57 UTC] kelvin dot middleton at gmail dot com
Description:
------------
Initially found a problem with phpMyAdmin not returning slave information in a master/slave replication configuration.  Issue raised their concluded the problem likely resided in PHP somewhere (https://github.com/phpmyadmin/phpmyadmin/issues/13117).  
Was using stock php package from ubuntu ppa (ver 7.0.15-0ubuntu0.16.04.4) so I raised a launchpad bug (https://bugs.launchpad.net/ubuntu/+source/php7.0/+bug/1675117) which progressed to providing me with a ppa to test php 7.0.17.  Testing still has the same errors when using the test script.

Test script:
---------------
Script is included in my bug submission here https://bugs.launchpad.net/ubuntu/+source/php7.0/+bug/1675117

Actual result:
--------------
Two errors return, excerpt below...

kelvin@xxx-server:~$ php php_test.php 
PHP Warning:  mysqli_fetch_array(): Malformed server packet. Field length pointing 0 bytes after end of packet in /home/kelvin/php_test.php on line 16
PHP Warning:  mysqli_fetch_array(): Error while reading a row in /home/kelvin/php_test.php on line 16
Array
(
    [Server_id] => 2
    [Host] => xxx
    [Port] => 3306
    [Master_id] => 1
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-03-27 22:06 UTC] spam2 at rhsoft dot net
https://bugs.php.net/bug.php?id=74021 but this should be fixed with 7.0.17 / 7.1.3 (and i was able to confirm the fix)
 [2017-03-27 22:15 UTC] kelvin dot middleton at gmail dot com
I can't technically challenge but am happy to test as instructed to confirm.  Further excerpt below from my testing this evening...

user@xxx-server:~$ /usr/bin/php --version
PHP 7.0.17-0ubuntu0.16.04.1~ppa1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.17-0ubuntu0.16.04.1~ppa1, Copyright (c) 1999-2017, by Zend Technologies

user@xxx-server:~$ /usr/bin/php php_test.php 
PHP Warning:  mysqli_fetch_array(): Malformed server packet. Field length pointing 0 bytes after end of packet in /home/kelvin/php_test.php on line 16
PHP Warning:  mysqli_fetch_array(): Error while reading a row in /home/kelvin/php_test.php on line 16
Array
(
    [Server_id] => 2
    [Host] => xxx
    [Port] => 3306
    [Master_id] => 1
)
 [2017-03-27 22:20 UTC] kelvin dot middleton at gmail dot com
Shot in the dark from my perspective but when I access mysql via the cli and ask it to show slave hosts; it returns only 3 out of the 4 shown data points i.e. its missing a value for the column slave uuid.  Could it be this missing data that the mysqli error is referring to?
 [2017-03-28 12:25 UTC] kelvin dot middleton at gmail dot com
So I think I am likely on the right track with the missing server_uuid value.  I span up test slave container and started replicating to it and disabled my production slave.  The error didn't present here either via the test script or in phpMyAdmin.  Looking here (https://mariadb.com/kb/en/mariadb/system-variable-differences-between-mariadb-100-and-mysql-56/) it would seem MariaDB doesn't provide a server_uuid function.

Should the mysqli extension be expected to handle is difference?
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Nov 17 00:01:34 2019 UTC