Try ERPNext Try Frappe Cloud Buy Support Partners Foundation

V12 to v13 Migration Error

Hello,

I faced below error while doing migration from version 12 to version 13. if any one have solution then let me know.

Migrating site1.local
Fatal Python error: Cannot recover from stack overflow.

Current thread 0x00007fbcb01b4740 (most recent call first):
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/werkzeug/local .py”, line 309 in _get_current_object
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/werkzeug/local .py”, line 348 in getattr
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 196 in log_query
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 136 in sql
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 605 in _get_values_from_table
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 450 in get_values
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 406 in get_value
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 15 3 in load_from_db
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 88 in load_from_db
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 11 2 in init
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 83 in init
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 37 in get_meta
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 881 in g et_meta
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 1254 i n get_filter
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 40 6 in prepare_filter_condition
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 39 7 in build_filter_conditions
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 37 6 in build_conditions
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 15 1 in prepare_args
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 12 3 in build_and_run
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 10 6 in execute
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1408 in get_list
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1435 in get_all
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 348 in add_custom_links_and_actions
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 106 in process
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 84 in init
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 37 in get_meta
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 881 in g et_meta
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 1244 i n get_filter
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 40 6 in prepare_filter_condition
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 39 7 in build_filter_conditions
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 37 6 in build_conditions
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 15 1 in prepare_args
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 12 3 in build_and_run
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 10 6 in execute
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1408 in get_list
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1435 in get_all
File “/home/frappe/frappe-bench/apps/frappe/frappe/translate.py”, line 258 in get_user_translations
File “/home/frappe/frappe-bench/apps/frappe/frappe/translate.py”, line 199 in get_full_dict
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 92 in _
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 15 5 in load_from_db
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 88 in load_from_db
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 11 2 in init
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 83 in init
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 37 in get_meta
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 881 in g et_meta
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 1254 i n get_filter
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 40 6 in prepare_filter_condition
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 39 7 in build_filter_conditions
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 37 6 in build_conditions
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 15 1 in prepare_args
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 12 3 in build_and_run
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 10 6 in execute
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1408 in get_list
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1435 in get_all
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 348 in add_custom_links_and_actions
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 106 in process
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 84 in init
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 37 in get_meta
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 881 in g et_meta
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 1244 i n get_filter
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 40 6 in prepare_filter_condition
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 39 7 in build_filter_conditions
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 37 6 in build_conditions
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 15 1 in prepare_args
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 12 3 in build_and_run
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 10 6 in execute
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1408 in get_list
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1435 in get_all
File “/home/frappe/frappe-bench/apps/frappe/frappe/translate.py”, line 258 in get_user_translations
File “/home/frappe/frappe-bench/apps/frappe/frappe/translate.py”, line 199 in get_full_dict
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 92 in _
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 15 5 in load_from_db
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 88 in load_from_db
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 11 2 in init
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 83 in init
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 37 in get_meta
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 881 in g et_meta
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 1254 i n get_filter
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 40 6 in prepare_filter_condition
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 39 7 in build_filter_conditions
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 37 6 in build_conditions
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 15 1 in prepare_args
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 12 3 in build_and_run
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 10 6 in execute
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1408 in get_list
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1435 in get_all
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 348 in add_custom_links_and_actions
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 106 in process
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 84 in init
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 37 in get_meta
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 881 in g et_meta
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 1244 i n get_filter
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 40 6 in prepare_filter_condition
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 39 7 in build_filter_conditions
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 37 6 in build_conditions
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 15 1 in prepare_args
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 12 3 in build_and_run
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 10 6 in execute
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1408 in get_list
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1435 in get_all

Aborted (core dumped)

Thanks

1 Like

I’ve been experiencing the same issue.
Version v13.4.1

I “suspect” this is a recent bug, introduced in the past few Minor versions. But cannot confirm that. I’m reading through the latest commits, trying to see if I can find anything.

It’s easy to duplicate after the failure with bench console

import frappe
# any DocType has the same effect
frappe.reload_doc('selling','doctype','Customer')

Hey Brian,

yes might be it’s a recent bug as this type of bug I never faced during other ERP upgrades from version 12 to version 13.

Might be it’s bug into latest new version 13.4.1

Let me know have you resolved it or you have downgraded version.

Thanks

@saurabh6790 Can you help into this ?

So far, I have not found a solution.

There may be a recursion problem (infinite loop?)

Exception: maximum recursion depth exceeded

Here’s the point where this is happening:

  File "/home/user/frappe-bench/apps/frappe/frappe/database/database.py", line 152, in sql
    self._cursor.execute(query)
  File "/home/user/frappe-bench/env/lib/python3.7/site-packages/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
  File "/home/user/frappe-bench/env/lib/python3.7/site-packages/pymysql/cursors.py", line 310, in _query
    conn.query(q)
  File "/home/user/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 547, in query
    self._execute_command(COMMAND.COM_QUERY, sql)
  File "/home/user/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 793, in _execute_command
    raise err.InterfaceError(0, "")
pymysql.err.InterfaceError: (0, '')

I’ve checked the queries; they are fine.

Hello… I am facing similar problem when migrating my data from ERPNEXT.
Both my sites are hosted on Frappe Cloud.

I did raise an issue with FrappeCloud and Erpnext, but no resolution. Please HELP.

ERPNext: v12.21.0
Frappe Framework: v12.18.1
to
ERPNext: v13.5.1 (HEAD)
Frappe Framework: v13.5.0 (HEAD)

Success: Done in 0.26s
Executing erpnext.patches.v13_0.move_doctype_reports_and_notification_from_hr_to_payroll #22-06-2020 in windmillfans.frappe.cloud (_dc323e13e2855583)
Success: Done in 5.237s
Executing erpnext.patches.v13_0.move_payroll_setting_separately_from_hr_settings #22-06-2020 in windmillfans.frappe.cloud (_dc323e13e2855583)
Success: Done in 0.094s
Executing execute:frappe.reload_doc(“regional”, “doctype”, “e_invoice_settings”) in windmillfans.frappe.cloud (_dc323e13e2855583)
Success: Done in 0.271s
Executing erpnext.patches.v13_0.check_is_income_tax_component #22-06-2020 in windmillfans.frappe.cloud (_dc323e13e2855583)
Traceback (most recent call last):
File “/usr/lib/python3.7/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.7/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 104, in
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.7/site-packages/click/core.py”, line 829, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 782, in main
rv = self.invoke(ctx)
File “/home/frappe/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 “/home/frappe/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 “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.7/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
skip_search_index=skip_search_index
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 67, 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 91, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v13_0/check_is_income_tax_component.py”, line 31, in execute
setup(patch=True)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/india/setup.py”, line 15, in setup
setup_company_independent_fixtures(patch=patch)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/india/setup.py”, line 21, in setup_company_independent_fixtures
make_custom_fields()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/india/setup.py”, line 673, in make_custom_fields
create_custom_fields(custom_fields, update=update)
File “/home/frappe/frappe-bench/apps/frappe/frappe/custom/doctype/custom_field/custom_field.py”, line 169, in create_custom_fields
custom_field.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 285, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 320, in save
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 961, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 859, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1148, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1131, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 853, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/custom/doctype/custom_field/custom_field.py”, line 58, in validate
frappe.throw(
(“Fieldtype cannot be changed from {0} to {1}”).format(old_fieldtype, self.fieldtype))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 432, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable, wide=wide, as_list=as_list)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 411, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 365, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: Fieldtype cannot be changed from Data to Currency