'MySQL server has gone away' when configure openstack juno with mariadb-galera

asked 2015-04-25 03:06:04 -0600

Tung Nguyen gravatar image

updated 2015-04-25 03:36:44 -0600

SGPJ gravatar image

Hi All, I'm implement openstack HA with database using mariadb-galera and i have issue 'MySQL server has gone away'.

2015-04-25 14:44:50.871 2216 TRACE keystone.common.wsgi DBConnectionError: (OperationalError) (2006, 'MySQL server has gone away') 'SELECT user.id AS user_id, user.name AS user_name, user.domain_id AS user_domain_id, user.password AS user_password, user.enabled AS user_enabled, user.extra AS user_extra, user.default_project_id AS user_default_project_id \nFROM user \nWHERE user.name = %s AND user.domain_id = %s' ('nova', 'default')

All openstack service get same error.

Can you help me ?


edit retag flag offensive close merge delete

4 answers

Sort by » oldest newest most voted

answered 2015-04-27 04:50:35 -0600

Nicholas I gravatar image

updated 2015-04-27 04:52:37 -0600

Option 1:

It clearly says "2015-04-25 14:44:50.871 2216 TRACE keystone.common.wsgi DBConnectionError: (OperationalError) (2006, 'MySQL server has gone away'"

You have dbconnectionerror, check the username and password, if everything is correct try to restart the mysql and mariadb. Hope this will fix your problem.

Option 2:

a. Server timed out and closed the connection. To fix, check that “wait_timeout” mysql variable in your my.cnf configuration file is large enough.

b. Server dropped an incorrect or too large packet. If mysqld gets a packet that is too large or incorrect, it assumes that something has gone wrong with the client and closes the connection. To fix, you can increase the maximal packet size limit “max_allowed_packet” in my.cnf file, eg. set max_allowed_packet = 128M, then sudo /etc/init.d/mysql restart.

Option 3:

Check whether all your services are running or not? especially check for rabbitmq status. If its stoped restart it and restart other services.

edit flag offensive delete link more


Hi Nicolas,

I tried all options as you recommend, but issue still happen. MySQL warning: 150503 13:12:47 [Warning] Aborted connection 31028 to db: 'keystone' user: 'keystone' host: 'localhost' (Unknown error)

Tung Nguyen gravatar imageTung Nguyen ( 2015-05-03 21:14:30 -0600 )edit

answered 2015-04-25 08:15:54 -0600

jdexter gravatar image

If you are running an HA setup where there are multiple mysql servers, then you can see the error

2006, 'MySQL server has gone away

as it refers to the fact that the connection has been closed for some reason. This can be for a variety of reasons including haproxy moving the connection to another endpoint, or that the connection idle long enough that the socket was closed.


edit flag offensive delete link more


hi @jdexter: i have 2 node but i active one node only.

Tung Nguyen gravatar imageTung Nguyen ( 2015-04-26 11:14:23 -0600 )edit

answered 2015-04-29 05:21:56 -0600

capsali gravatar image

As Nicholas said try increasing wait_timeout to something like 28800 in my.cnf . Also if using haproxy increase the timeout in haproxy aswell!

edit flag offensive delete link more

answered 2015-04-25 06:32:09 -0600

Ashish Chandra gravatar image

Can you check, whether the galera cluster exists, please run this command on any of cluster node: mysql -u root -p<password> -e "show status like 'wsrep%’"

Also, how are you referring to nodes in galera cluster in, conf file. Can you put, sql_connection of any conf file.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2015-04-25 03:06:04 -0600

Seen: 2,816 times

Last updated: Apr 29 '15