Bench update error v12.6 to v12.8

I am getting following error while migrating the site, can anybody help me to get resolved.

frappe@santosh:~/frappe-bench$ bench update --patch
Backing up sites…
Patching sites…
Migrating indipco
Updating DocTypes for frappe : [========================================]
Updating DocTypes for erpnext : [========================================]
Traceback (most recent call last):
File “/usr/lib/python3.6/”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/”, line 85, in _run_code
exec(code, run_globals)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 97, in
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 18, in main
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/”, line 764, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/”, line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/”, line 25, in _func
ret = f(frappe.dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/”, line 233, in migrate
migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip_failing)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 52, in migrate
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 24, in sync_fixtures
ignore_links=True, overwrite=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/”, line 56, in import_doc
frappe.modules.import_file.import_file_by_path(f, data_import=True, force=True, pre_process=pre_process, reset_permissions=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/”, line 66, in import_file_by_path
ignore_version=ignore_version, reset_permissions=reset_permissions)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/”, line 141, in import_doc
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 228, in insert
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 886, in run_before_save_methods
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 786, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 1055, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 1038, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 780, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/”, line 72, in validate
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/”, line 830, in validate_fields
check_unique_and_text(meta.get(“name”), d)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/”, line 659, in check_unique_and_text
(“{0}: Fieldtype {1} for {2} cannot be unique”).format(docname, d.fieldtype, d.label), NonUniqueError)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 360, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 346, in msgprint
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 315, in _raise_exception
raise raise_exception(msg)
frappe.core.doctype.doctype.doctype.NonUniqueError: OAuth Authorization Code: Fieldtype Text for Authorization Code cannot be unique

A fixture in your indipco custom app fails a validity check that you report as an issue site migrate with custom app error · Issue #18875 · frappe/erpnext · GitHub

To find the problem fixture maybe run bench export-fixtures


Thanks Clarkej, I have re-configured for fixtures and exported them, migration was successful.

Installed Apps

ERPNext: v13.0.0-dev (rebrand-ui)
Frappe Framework: v13.0.0-dev (rebrand-ui)
myerp: v0.0.1 (master)
I have not made anything customized in the doctype : OAuth Authorization Code

the error is OAuth Authorization Code: Fieldtype Text for Authorization Code cannot be unique
I tried.
frappe@vmi417656:~/erpnext$ bench export-fixtures
Exporting DocType app myerp filters None
Exporting Custom Script app myerp filters None
Exporting Custom Field app myerp filters None
Exporting Property Setter app myerp filters None
Exporting Print Format app myerp filters None

still bench update --patch failed with the same error :frowning:
please anyone knows how do I get to resolve? I appreciate your help in advance.

Resolved by the following step.

  1. Removing Doctype from fixtures in, and deleting the doctype.json file from the fixtures folder fixed the issue

  2. Switch from version-13 rebrand-ui to version-13-beta

    bench switch-to-branch version-13-beta frappe erpnext --upgrade
    sudo bench update --patch
  3. New error caught

      pymysql.err.InternalError: (1170, "BLOB/TEXT column 'authorization_code' used in key specification without a key length")
  4. Bypass Custom App and sync database

     sudo bench --site migrate
     sudo bench clear-cache
     sudo bench build

An update fixed this for me

bench update --reset

1 Like