General error: 1835 Malformed communication packet [duplicate]
Asked Answered
T

1

7

Suddenly I got this error in my Laravel web application.

PDOException in MySqlConnector.php line 38:

SQLSTATE[HY000]: General error: 1835 Malformed communication packet

Can you help me out to solve this?

Thrice answered 4/11, 2020 at 9:4 Comment(8)
Could you please add the query / statement / code that causes this error?Notion
Maybe add some details about versions of your stack.Evolution
Happened to two of our apps today, too. It seems that is happened after upgrading MariaDB-server-10.2.31-1.el7.centos.x86_64 -> MariaDB-server-10.2.35-1.el7.centos.x86_64. Might there be some similarity?Parlando
I have the same problem this morning I think it's because of auto-update that happened in MariaDB or maybe centos 6 was upgraded to centos 7 because CentOS-6 will reach End of Life on November 30th, 2020. End of Life means a product is no longer supportedBolen
Experienced the same issue. Found an answer from here -> #64678336Liponis
Same on Ubuntu mate for mariadb-server-10.4.16 (version 1:10.4.16+maria~focal). I downgraded to 10.4.15Schematize
@Schematize is it working after downgrading the version?Thrice
@ThilakRaman it works. Stop the service systemctl stop mariadb, apt remove mariadb-server and all other installed packeages mariadb*, install old version sudo apt install mariadb-server=1:10.4.15+maria~focal and all other related packages with =version add to end, you must specify all packages mannualy. Test it with sudo apt install -s mariadb-server=1:10.4.15+maria~focal to see if version are ok on other depended packages.Schematize
T
0

With reference to another post, I have added the below line in db connection and its working for now.

'options' => [PDO::ATTR_EMULATE_PREPARES => true]

Thrice answered 4/11, 2020 at 13:34 Comment(4)
This is not a solution, nor an explanation, it's rather a workaround with implications not mentioned in your answer.Bridge
@DanielW. Is there any permanent solution for this issue? Please suggest.Thrice
Have you tried upgrading the client driver to the same version as the server ugpraded to? Can you share your client and server versions pleaseBridge
I did that but in my laravel, although the above error went away, it started causing errors in some other PDO queries. so this line in config only caused other unknown problems.Kaiserism

© 2022 - 2024 — McMap. All rights reserved.