I am trying to migrate database from version 11 to version 13. During migration I get this error when Executing frappe.patches.v12_0.setup_tags
is running
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 91, in execute_patch
frappe.get_attr(patchmodule.split()[0] + ".execute")()
File "/home/frappe/frappe-bench/apps/frappe/frappe/patches/v12_0/setup_tags.py", line 15, in execute
if not frappe.db.count(doctype.name) or not frappe.db.has_column(doctype.name, "_user_tags"):
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 882, in count
count = self.sql("""select count(*)
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 152, in sql
self._cursor.execute(query)
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/cursors.py", line 148, in execute
result = self._query(query)
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/cursors.py", line 310, in _query
conn.query(q)
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/connections.py", line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/connections.py", line 775, in _read_query_result
result.read()
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/connections.py", line 1156, in read
first_packet = self.connection._read_packet()
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/connections.py", line 692, in _read_packet
packet_header = self._read_bytes(4)
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/connections.py", line 748, in _read_bytes
raise err.OperationalError(
pymysql.err.OperationalError: (2013, 'Lost connection to MySQL server during query')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 104, in <module>
main()
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 19, in main
click.Group(commands=commands)(prog_name='bench')
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 27, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 309, in migrate
migrate(
File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 69, in migrate
frappe.modules.patch_handler.run_all(skip_failing)
File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 41, in run_all
run_patch(patch)
File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 30, in run_patch
if not run_single(patchmodule = patch):
File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 71, in run_single
return execute_patch(patchmodule, method, methodargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 97, in execute_patch
frappe.db.rollback()
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 810, in rollback
self.sql("rollback")
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 152, in sql
self._cursor.execute(query)
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/cursors.py", line 148, in execute
result = self._query(query)
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/cursors.py", line 310, in _query
conn.query(q)
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/connections.py", line 547, in query
self._execute_command(COMMAND.COM_QUERY, sql)
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/connections.py", line 793, in _execute_command
raise err.InterfaceError(0, "")
pymysql.err.InterfaceError: (0, '')
Not sure why it fails to connect to the database.