# Randomly Getting "Got an error reading communication packets"

**URL:** <https://forums.percona.com/t/randomly-getting-got-an-error-reading-communication-packets/3639>\
**Category:** Other MySQL® Questions\
**Created:** [July 25, 2014, 3:33am UTC](https://forums.percona.com/t/randomly-getting-got-an-error-reading-communication-packets/3639 "2014-07-25T03:33:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![infdude666](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/infdude666/32/11425_2.png) [@infdude666](https://forums.percona.com/u/infdude666)\
**Post date:** [July 25, 2014, 3:33am UTC](https://forums.percona.com/t/randomly-getting-got-an-error-reading-communication-packets/3639/1 "2014-07-25T03:33:18Z")

</div>

I have been getting this error a dozen a day or so. I’ve googled for advice and don’t see anything helpful.

140725 1:45:29 [Warning] Aborted connection 406119665 to db: ‘XXX’ user: ‘trans\_user’ host: ‘XXX.XXX.X.XX’ (Got an error reading communication packets)

The client reports:  
Failed to get head revision: (OperationalError) (2013, “Lost connection to MySQL server at ‘reading authorization packet’, system error: 0”) None None

I have Percona 5.5.16 Version Runnig on Centos5  
It is fronted by HAProxy.

My CNF:

innodb\_log\_buffer\_size=64M  
innodb\_log\_file\_size=1G  
skip-name-resolve  
max\_connections=1000  
max\_allowed\_packet=64M  
net\_read\_timeout=1800  
net\_write\_timeout=1800  
connect\_timeout=60  
back\_log=1500

The question: where else can I look for the reason?

---

<div class="post-metadata">

**Author:** ![alaincraven](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@alaincraven](https://forums.percona.com/u/alaincraven)\
**Post date:** [July 29, 2014, 12:10am UTC](https://forums.percona.com/t/randomly-getting-got-an-error-reading-communication-packets/3639/2 "2014-07-29T00:10:55Z")

</div>

Is this on a slave?  
Do you have multiple slaves?

If yes to both, try change the slave server id in my.cnf to something else, and restart mysql

---

<div class="post-metadata">

**Author:** ![infdude666](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/infdude666/32/11425_2.png) [@infdude666](https://forums.percona.com/u/infdude666)\
**Post date:** [August 7, 2014, 10:37am UTC](https://forums.percona.com/t/randomly-getting-got-an-error-reading-communication-packets/3639/3 "2014-08-07T10:37:40Z")

</div>

[alaincraven](http://www.percona.com/forums/member/22285-alaincraven), No this is not slave. But for info all my Slave have different unique serverid’s. The error Failed to get head revision: (OperationalError) (2013, “Lost connection to MySQL server at ‘reading authorization packet’, system error: 0”) None None comes from the java/python application error log.

---

<div class="post-metadata">

**Author:** ![psong](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/psong/32/16894_2.png) [@psong](https://forums.percona.com/u/psong)\
**Post date:** [August 8, 2014, 4:40am UTC](https://forums.percona.com/t/randomly-getting-got-an-error-reading-communication-packets/3639/4 "2014-08-08T04:40:35Z")

</div>

The ‘reading authorization packet’ error indicated it was during the login/authorization step. However, the server error showed the client connection had already being made with a thread id. Can you verify that these client and server errors happened at the same time?

For the server side error, it is generally due to client program terminated abruptly, or didn’t call mysql\_close() before exiting, or idle for too long, or network failure. You can refer to the documentation at [url][http://dev.mysql.com/doc/refman/5.6/en/communication-errors.html[/url]](http://dev.mysql.com/doc/refman/5.6/en/communication-errors.html%5B/url%5D).

The server error log gives the aborted thread id. You may run “show processlist” periodically to check if the thread indeed idle for longer than (interactive\_timeout, wait\_timeout). Or turn on general query log to track the activity of the thread. And do a network audit as well.

---

<div class="post-metadata">

**Author:** ![infdude666](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/infdude666/32/11425_2.png) [@infdude666](https://forums.percona.com/u/infdude666)\
**Post date:** [August 13, 2014, 8:18am UTC](https://forums.percona.com/t/randomly-getting-got-an-error-reading-communication-packets/3639/5 "2014-08-13T08:18:58Z")

</div>

Thanks psong. I guess i have to check my network layer for the solution.
