67751: Acronis Cyber Cloud: "Error 2020: Got packet bigger than 'max_allowed_packet' when dumping table wp_options"

use Google Translate

Last update: 31-05-2021

Symptoms

You try to recover or download MySQL database from cPanel backup, but the operation fails.

Under failure details in cPanel you see:

{ "Command": "export HOME=/var/lib/Acronis/mount/c88902d8_0_1605674619_26/root && mysqldump --host=localhost --protocol=SOCKET --socket=/usr/local/cpanel/base/3rdparty/acronisbackup/srv/tmp/dbms/11/mysql/mysql.sock --triggers --routines --events happybin_yFoFegV5RKQ6 > /usr/local/cpanel/base/3rdparty/acronisbackup/srv/tmp/dbms/11/dumps/happybin_yFoFegV5RKQ6.sql", "Error": "mysqldump: Error 2020: Got packet bigger than 'max_allowed_packet' when dumping table wp_options at row: 6367" }

Cause

To recover or download a database, cPanel plugin deploys a separate instance of MySQL and performs database dump. This dump is done with default parameters and the default value of max_allowed_packet might be insufficient.

Solution

  1. Edit /usr/local/cpanel/base/3rdparty/acronisbackup/python/site-packages/acronis_backup_srv/async_tasks/executors/databases.py
  2. Find line that contains the following piece of code:
    connection_options += [
    '--host=localhost',
    '--protocol=SOCKET',
    '--socket={}'.format(shlex.quote(mysql_conn_opts['socket'])),
    ]
  3. Add max_allowed_packet required to operate with selected DB, e.g.:
    connection_options += [
    '--host=localhost',
    '--protocol=SOCKET',
    '--max_allowed_packet=500M',
    '--socket={}'.format(shlex.quote(mysql_conn_opts['socket'])),
    ]
  4. Restart the service:
    # /usr/local/cpanel/base/3rdparty/acronisbackup/scripts/acronis-backup-srv.sh restart