Hi,
Any idea why I get this error? “(2013, ‘Lost connection to MySQL server during query’)”
Its an almost empty site, the sql db backup uncompressed is 8mb, private/public files just 1 jpg.
I run this command to restore DB and its public/private files from the backup created within ERPNext, but it takes something like 20 minutes until the error appears.
Will try to restore manually, restoring db with phpmyadmin and coping the files manually… but would be good to be able to restore with bench commands.
bench --site site1-test.local restore ../DB-Backups/Backups_Manuales/20180318_132828-site1_local-database.sql --with-public-files ../DB-Backups/Backups_Manuales/20180318_132828-site1_local-files.tar --with-private-files ../DB-Backups/Backups_Manuales/20180318_132828-site1_local-private-files.tar
frappe@erpnext:~/frappe-bench$ bench --site site1-test.local restore …/DB-Backups/Backups_Manuales/20180318_132828-site1_local-database.sql --with-public-files …/DB-Backups/Backups_Manuales/20180318_132828-site1_local-files.tar --with-private-files …/DB-Backups/Backups_Manuales/20180318_132828-site1_local-private-files.tar
MySQL root password:
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
“main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 115, in restore
force=context.force)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 65, in _new_site
admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 43, in install_db
if not ‘tabDefaultValue’ in frappe.db.get_tables():
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 784, in get_tables
return [d[0] for d in self.sql(“show tables”)]
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 176, in sql
self._cursor.execute(query)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py”, line 165, in execute
result = self._query(query)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py”, line 321, in _query
conn.query(q)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 860, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1061, in _read_query_result
result.read()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1349, in read
first_packet = self.connection._read_packet()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 991, in _read_packet
packet_header = self._read_bytes(4)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1037, in _read_bytes
CR.CR_SERVER_LOST, “Lost connection to MySQL server during query”)
pymysql.err.OperationalError: (2013, ‘Lost connection to MySQL server during query’)