[V13] Update from v12 to v13 beta crashes with MandatoryError

Hello,
I tried to update from version Erpnext v12.7 / Frappe v12.4 to version 13 beta 11. I have one custom app with some customization exported as a fixtures.

After executing

bench switch-to-branch version-13-beta frappe erpnext --upgrade

I got this error:

Migrating site1.local
Updating DocTypes for frappe        : [========================================] 100%
Updating DocTypes for erpnext       : [========================================] 100%
Updating DocTypes for ixcust        : [========================================] 100%
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/martin/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 99, in <module>
    main()
  File "/home/martin/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/martin/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/martin/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/martin/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/martin/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/martin/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/martin/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/martin/frappe-bench/env/lib/python3.8/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/martin/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 26, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/martin/frappe-bench/apps/frappe/frappe/commands/site.py", line 293, in migrate
    migrate(
  File "/home/martin/frappe-bench/apps/frappe/frappe/migrate.py", line 73, in migrate
    sync_fixtures()
  File "/home/martin/frappe-bench/apps/frappe/frappe/utils/fixtures.py", line 23, in sync_fixtures
    import_doc(frappe.get_app_path(app, "fixtures", fname),
  File "/home/martin/frappe-bench/apps/frappe/frappe/core/doctype/data_import/data_import.py", line 193, in import_doc
    frappe.modules.import_file.import_file_by_path(
  File "/home/martin/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 69, in import_file_by_path
    import_doc(doc, force=force, data_import=data_import, pre_process=pre_process,
  File "/home/martin/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 143, in import_doc
    doc.insert()
  File "/home/martin/frappe-bench/apps/frappe/frappe/model/document.py", line 239, in insert
    self._validate()
  File "/home/martin/frappe-bench/apps/frappe/frappe/model/document.py", line 493, in _validate
    self._validate_mandatory()
  File "/home/martin/frappe-bench/apps/frappe/frappe/model/document.py", line 798, in _validate_mandatory
    raise frappe.MandatoryError('[{doctype}, {name}]: {fields}'.format(
frappe.exceptions.MandatoryError: [Customize Form, Customize Form]: fields

What could be wrong? Updates between minor versions 12.x were OK.

This is content of customize_form.json file in fixtures folder:

[
 {
  "allow_auto_repeat": 0,
  "allow_copy": 0,
  "allow_import": 0,
  "default_print_format": null,
  "doc_type": null,
  "docstatus": 0,
  "doctype": "Customize Form",
  "editable_grid": 0,
  "fields": [],
  "image_field": null,
  "image_view": 0,
  "istable": 0,
  "label": null,
  "max_attachments": 0,
  "modified": null,
  "name": "Customize Form",
  "parent": null,
  "parentfield": null,
  "parenttype": null,
  "quick_entry": 1,
  "search_fields": null,
  "sort_field": null,
  "sort_order": "ASC",
  "title_field": null,
  "track_changes": 0,
  "track_views": 0
 }
]
1 Like

Not sure if it is a correct way of debugging, but I deleted file
apps/custom_app/custom_app/fixtures/customize_form.json
and tried update again the same way. MandatoryError disappeared, but now it results in this error message:

frappe.core.doctype.doctype.doctype.CannotCreateStandardDoctypeError: Not in Developer Mode! Set in site_config.json or make 'Custom' DocType.

But the site definitely is in developer mode. Repeating whole procedure gives the same result. Any idea how to solve this?

Full error log:

Executing erpnext.patches.v13_0.add_naming_series_to_old_projects # 1-02-2021 in site1.local (_1bd3e0294da19198)
Success: Done in 0.242s

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/martin/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 99, in <module>
    main()
  File "/home/martin/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/martin/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/martin/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/martin/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/martin/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/martin/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/martin/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/martin/frappe-bench/env/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/martin/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 26, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/martin/frappe-bench/apps/frappe/frappe/commands/site.py", line 296, in migrate
    skip_search_index=skip_search_index
  File "/home/martin/frappe-bench/apps/frappe/frappe/migrate.py", line 73, in migrate
    sync_fixtures()
  File "/home/martin/frappe-bench/apps/frappe/frappe/utils/fixtures.py", line 24, in sync_fixtures
    ignore_links=True, overwrite=True)
  File "/home/martin/frappe-bench/apps/frappe/frappe/core/doctype/data_import/data_import.py", line 194, in import_doc
    f, data_import=True, force=True, pre_process=pre_process, reset_permissions=True
  File "/home/martin/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 70, in import_file_by_path
    ignore_version=ignore_version, reset_permissions=reset_permissions)
  File "/home/martin/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 143, in import_doc
    doc.insert()
  File "/home/martin/frappe-bench/apps/frappe/frappe/model/document.py", line 238, in insert
    self.run_before_save_methods()
  File "/home/martin/frappe-bench/apps/frappe/frappe/model/document.py", line 950, in run_before_save_methods
    self.run_method("validate")
  File "/home/martin/frappe-bench/apps/frappe/frappe/model/document.py", line 848, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/martin/frappe-bench/apps/frappe/frappe/model/document.py", line 1135, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/martin/frappe-bench/apps/frappe/frappe/model/document.py", line 1118, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/martin/frappe-bench/apps/frappe/frappe/model/document.py", line 842, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/martin/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 62, in validate
    self.check_developer_mode()
  File "/home/martin/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 135, in check_developer_mode
    frappe.throw(_("Not in Developer Mode! Set in site_config.json or make 'Custom' DocType."), CannotCreateStandardDoctypeError)
  File "/home/martin/frappe-bench/apps/frappe/frappe/__init__.py", line 411, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable, wide=wide, as_list=as_list)
  File "/home/martin/frappe-bench/apps/frappe/frappe/__init__.py", line 390, in msgprint
    _raise_exception()
  File "/home/martin/frappe-bench/apps/frappe/frappe/__init__.py", line 344, in _raise_exception
    raise raise_exception(msg)
frappe.core.doctype.doctype.doctype.CannotCreateStandardDoctypeError: Not in Developer Mode! Set in site_config.json or make 'Custom' DocType.

this worked for me