Uploaded image for project: 'FreePBX'
  1. FreePBX
  2. FREEPBX-21594

UCP error: MySQL server has gone away code: 2006

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Asterisk Version:
      16.9.0
    • Distro Version:
      15.0.16.53
    • Distro:
      FreePBX Distro

      Description

      UCP Version: 15.0.6.14
      MariaDB Version: 5.5.60-MariaDB

      The file /var/log/asterisk/ucp_err.log is filled with "{ Error: MySQL server has gone away code: 2006 } There was an error with MySQL Connection" every eight hours.

      2020-06-03 07:44 -03:00: Error: MySQL server has gone away code: 2006
      2020-06-03 07:44 -03:00: There was an error with MySQL Connection
      2020-06-03 15:44 -03:00: Error: MySQL server has gone away code: 2006
      2020-06-03 15:44 -03:00: There was an error with MySQL Connection
      2020-06-03 23:44 -03:00: Error: MySQL server has gone away code: 2006
      2020-06-03 23:44 -03:00: There was an error with MySQL Connection
      2020-06-04 07:44 -03:00: Error: MySQL server has gone away code: 2006
      2020-06-04 07:44 -03:00: There was an error with MySQL Connection
      2020-06-04 15:44 -03:00: Error: MySQL server has gone away code: 2006
      2020-06-04 15:44 -03:00: There was an error with MySQL Connection
      2020-06-04 23:44 -03:00: Error: MySQL server has gone away code: 2006
      2020-06-04 23:44 -03:00: There was an error with MySQL Connection
      2020-06-05 07:44 -03:00: Error: MySQL server has gone away code: 2006
      2020-06-05 07:44 -03:00: There was an error with MySQL Connection
      2020-06-05 15:44 -03:00: Error: MySQL server has gone away code: 2006
      2020-06-05 15:44 -03:00: There was an error with MySQL Connection
      2020-06-05 23:44 -03:00: Error: MySQL server has gone away code: 2006
      2020-06-05 23:44 -03:00: There was an error with MySQL Connection
      2020-06-06 07:44 -03:00: Error: MySQL server has gone away code: 2006
      2020-06-06 07:44 -03:00: There was an error with MySQL Connection
      2020-06-06 15:44 -03:00: Error: MySQL server has gone away code: 2006
      2020-06-06 15:44 -03:00: There was an error with MySQL Connection
      2020-06-06 23:44 -03:00: Error: MySQL server has gone away code: 2006
      2020-06-06 23:44 -03:00: There was an error with MySQL Connection

      It also happens on fresh installs (SNG7-FPBX-64bit-2002-2).
       
      Looking at mysql documentation, it appears to be the server closing the connection after eight hours of nothing happening:
       
      By default, the server closes the connection after eight hours if nothing has happened. You can change the time limit by setting the wait_timeout variable when you start mysqld . See Section 5.1.8, “Server System Variables”.

      The wait_time variable is set (by default) to eight hours (28800 seconds):

      [root@freepbx ~]# mysqladmin variables | grep -i wait_timeout
      innodb_lock_wait_timeout 50
      lock_wait_timeout 31536000
      wait_timeout 28800

      So I guess it is a matter of the connection getting automatically closed due to no queries being made.

      The solution proposed by the documentation is “to issue the query again for the client to do an automatic reconnection.”

      But I don´t know which client is making the connection in the first place.

      Since the system works, there should be a way of avoiding these endeless error log messages.

      Thanks!

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mmishra Mohit Mishra
                Reporter:
                duli duli
              • Votes:
                2 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  NextupJiraPlusStatus

                  Error rendering 'slack.nextup.jira:nextup-jira-plus-status'. Please contact your Jira administrators.