Executing frappe.patches.v12_0.setup_tags throws pymysql.err.OperationalError: (2013, 'Lost connection to MySQL server during query')

UPDATE: I commented out but there is still another bug. It’s identical as this Move from v11 to 13 fails - #5 by leonp .

The command is Executing erpnext.patches.v13_0.patch_to_fix_reverse_linking_in_additional_salary_encashment_and_incentive in <site_name> (<db_name>)