After I successfully restored a backup dump to my local development, I enter ‘bench migrate’ then it suddenly throws an error “pymysql.err.OperationalError: (2013, ‘Lost connection to MySQL server during query’)”. For your reference, here’s the full traceback:
Traceback (most recent call last):
File "/usr/local/opt/python@3.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/local/opt/python@3.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/dev/bench/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 110, in <module>
main()
File "/Users/dev/bench/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
click.Group(commands=commands)(prog_name="bench")
File "/Users/dev/bench/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/Users/dev/bench/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/dev/bench/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/dev/bench/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/dev/bench/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/dev/bench/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/dev/bench/frappe-bench/env/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/dev/bench/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 31, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File "/Users/dev/bench/frappe-bench/apps/frappe/frappe/commands/site.py", line 433, in migrate
migrate(context.verbose, skip_failing=skip_failing, skip_search_index=skip_search_index)
File "/Users/dev/bench/frappe-bench/apps/frappe/frappe/migrate.py", line 77, in migrate
sync_customizations()
File "/Users/dev/bench/frappe-bench/apps/frappe/frappe/modules/utils.py", line 112, in sync_customizations
sync_customizations_for_doctype(data, folder)
File "/Users/dev/bench/frappe-bench/apps/frappe/frappe/modules/utils.py", line 165, in sync_customizations_for_doctype
sync("property_setters", "Property Setter", "doc_type")
File "/Users/dev/bench/frappe-bench/apps/frappe/frappe/modules/utils.py", line 158, in sync
sync_single_doctype(doc_type)
File "/Users/dev/bench/frappe-bench/apps/frappe/frappe/modules/utils.py", line 139, in sync_single_doctype
_insert(d)
File "/Users/dev/bench/frappe-bench/apps/frappe/frappe/modules/utils.py", line 131, in _insert
doc.db_insert()
File "/Users/dev/bench/frappe-bench/apps/frappe/frappe/model/base_document.py", line 418, in db_insert
list(d.values()),
File "/Users/dev/bench/frappe-bench/apps/frappe/frappe/database/database.py", line 187, in sql
self._cursor.execute(query, values)
File "/Users/dev/bench/frappe-bench/env/lib/python3.7/site-packages/pymysql/cursors.py", line 148, in execute
result = self._query(query)
File "/Users/dev/bench/frappe-bench/env/lib/python3.7/site-packages/pymysql/cursors.py", line 310, in _query
conn.query(q)
File "/Users/dev/bench/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/Users/dev/bench/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 775, in _read_query_result
result.read()
File "/Users/dev/bench/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 1156, in read
first_packet = self.connection._read_packet()
File "/Users/dev/bench/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 692, in _read_packet
packet_header = self._read_bytes(4)
File "/Users/dev/bench/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 749, 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')
frappe version: 13.50.3
bench: 5.4.1
mariadb: 10.4.31
machine: Mac M1
dump size in gz: 1.37gb