frappe.exceptions.DoesNotExistError: DocType Language not found

Error while running bench update --upgrade

erpnext@Backup-to-upgrade-to-V7:~/frappe-bench$ bench update --upgrade
INFO:bench.utils:updating bench
Already up-to-date.
Requirement already satisfied (use --upgrade to upgrade): Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
From https://github.com/frappe/frappe
 * branch            develop    -> FETCH_HEAD
Already up-to-date.
INFO:bench.app:pulling erpnext
From https://github.com/frappe/erpnext
 * branch            develop    -> FETCH_HEAD
Already up-to-date.
Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
Migrating site1.local
Executing frappe.patches.v6_2.ignore_user_permissions_if_missing in site1.local (site1.local)
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/site.py", line 206, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/migrate.py", line 29, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 26, in run_all
    if not run_single(patchmodule = patch):
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 60, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 80, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/patches/v6_2/ignore_user_permissions_if_missing.py", line 9, in execute
    system_settings.save()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 242, in save
    return self._save(*args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 272, in _save
    self._validate()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 388, in _validate
    self._validate_links()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 620, in _validate_links
    invalid_links, cancelled_links = self.get_invalid_links()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/base_document.py", line 440, in get_invalid_links
    if frappe.get_meta(doctype).issingle:
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 598, in get_meta
    return frappe.model.meta.get_meta(doctype, cached=cached)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/meta.py", line 29, in get_meta
    return frappe.cache().hget("meta", doctype, lambda: Meta(doctype))
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py", line 161, in hget
    value = generator()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/meta.py", line 29, in <lambda>
    return frappe.cache().hget("meta", doctype, lambda: Meta(doctype))
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/meta.py", line 61, in __init__
    super(Meta, self).__init__("DocType", doctype)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 80, in __init__
    self.load_from_db()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/meta.py", line 66, in load_from_db
    super(Meta, self).load_from_db()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 111, in load_from_db
    frappe.throw(_("{0} {1} not found").format(_(self.doctype), self.name), frappe.DoesNotExistError)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 302, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator='red')
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 295, in msgprint
    _raise_exception()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 268, in _raise_exception
    raise raise_exception, encode(msg)
frappe.exceptions.DoesNotExistError: DocType Language not found
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.1', 'console_scripts', 'bench')()
  File "/home/erpnext/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/bench-repo/bench/commands/update.py", line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
  File "/home/erpnext/bench-repo/bench/commands/update.py", line 90, in _update
    patch_sites(bench_path=bench_path)
  File "/home/erpnext/bench-repo/bench/utils.py", line 161, in patch_sites
    run_frappe_cmd('--site', 'all', 'migrate', bench_path=bench_path)
  File "/home/erpnext/bench-repo/bench/utils.py", line 501, in run_frappe_cmd
    raise CommandFailedError(args)
bench.utils.CommandFailedError: ('--site', 'all', 'migrate')

@atif_siddiqui pushed a fix. Can you check now?

@rmehta the previous issue sorted out. However another issue poped up related to language

Migrating site1.local
Executing frappe.patches.v7_1.rename_chinese_language_codes in site1.local (site1.local)
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/site.py", line 206, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/migrate.py", line 29, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 26, in run_all
    if not run_single(patchmodule = patch):
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 60, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 80, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/patches/v7_1/rename_chinese_language_codes.py", line 6, in execute
    frappe.rename_doc('Language', 'zh-tw', 'zh-TW', force=True)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 642, in rename_doc
    return rename_doc(doctype, old, new, force=force, merge=merge, ignore_permissions=ignore_permissions)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/rename_doc.py", line 32, in rename_doc
    new = validate_rename(doctype, new, meta, merge, force, ignore_permissions)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/rename_doc.py", line 103, in validate_rename
    frappe.msgprint(_("Another {0} with name {1} exists, select another name").format(doctype, new), raise_exception=1)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 295, in msgprint
    _raise_exception()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 270, in _raise_exception
    raise ValidationError, encode(msg)
frappe.exceptions.ValidationError: Another Language with name zh-TW exists, select another name
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.1', 'console_scripts', 'bench')()
  File "/home/erpnext/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/bench-repo/bench/commands/update.py", line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
  File "/home/erpnext/bench-repo/bench/commands/update.py", line 90, in _update
    patch_sites(bench_path=bench_path)
  File "/home/erpnext/bench-repo/bench/utils.py", line 161, in patch_sites
    run_frappe_cmd('--site', 'all', 'migrate', bench_path=bench_path)
  File "/home/erpnext/bench-repo/bench/utils.py", line 501, in run_frappe_cmd
    raise CommandFailedError(args)
bench.utils.CommandFailedError: ('--site', 'all', 'migrate')

hi all,

same here just now

> Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
> Migrating deploy.local
> Executing frappe.patches.v7_1.sync_language_doctype in deploy.local (19a8bfb343)
> Success
> Executing frappe.patches.v7_1.rename_chinese_language_codes in deploy.local (19a8bfb343)
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
>     "__main__", fname, loader, pkg_name)
>   File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
>     exec code in run_globals
>   File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
>     main()
>   File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
>     click.Group(commands=commands)(prog_name='bench')
>   File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
>     return self.main(*args, **kwargs)
>   File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
>     rv = self.invoke(ctx)
>   File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
>     return _process_result(sub_ctx.command.invoke(sub_ctx))
>   File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
>     return _process_result(sub_ctx.command.invoke(sub_ctx))
>   File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
>     return ctx.invoke(self.callback, **ctx.params)
>   File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
>     return callback(*args, **kwargs)
>   File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
>     return f(get_current_context(), *args, **kwargs)
>   File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
>     ret = f(frappe._dict(ctx.obj), *args, **kwargs)
>   File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 206, in migrate
>     migrate(context.verbose, rebuild_website=rebuild_website)
>   File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 29, in migrate
>     frappe.modules.patch_handler.run_all()
>   File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 26, in run_all
>     if not run_single(patchmodule = patch):
>   File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 60, in run_single
>     return execute_patch(patchmodule, method, methodargs)
>   File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 80, in execute_patch
>     frappe.get_attr(patchmodule.split()[0] + ".execute")()
>   File "/home/frappe/frappe-bench/apps/frappe/frappe/patches/v7_1/rename_chinese_language_codes.py", line 6, in execute
>     frappe.rename_doc('Language', 'zh-tw', 'zh-TW', force=True)
>   File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 642, in rename_doc
>     return rename_doc(doctype, old, new, force=force, merge=merge, ignore_permissions=ignore_permissions)
>   File "/home/frappe/frappe-bench/apps/frappe/frappe/model/rename_doc.py", line 32, in rename_doc
>     new = validate_rename(doctype, new, meta, merge, force, ignore_permissions)
>   File "/home/frappe/frappe-bench/apps/frappe/frappe/model/rename_doc.py", line 103, in validate_rename
>     frappe.msgprint(_("Another {0} with name {1} exists, select another name").format(doctype, new), raise_exception=1)
>   File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 295, in msgprint
>     _raise_exception()
>   File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 270, in _raise_exception
>     raise ValidationError, encode(msg)
> frappe.exceptions.ValidationError: Another Language with name zh-TW exists, select another name
> Traceback (most recent call last):
>   File "/usr/local/bin/bench", line 9, in <module>
>     load_entry_point('bench==2.0.0', 'console_scripts', 'bench')()
>   File "/home/frappe/bench-repo/bench/cli.py", line 40, in cli
>     bench_command()
>   File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
>     return self.main(*args, **kwargs)
>   File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
>     rv = self.invoke(ctx)
>   File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
>     return _process_result(sub_ctx.command.invoke(sub_ctx))
>   File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
>     return ctx.invoke(self.callback, **ctx.params)
>   File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
>     return callback(*args, **kwargs)
>   File "/home/frappe/bench-repo/bench/commands/update.py", line 60, in update
>     _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
>   File "/home/frappe/bench-repo/bench/commands/update.py", line 90, in _update
>     patch_sites(bench_path=bench_path)
>   File "/home/frappe/bench-repo/bench/utils.py", line 161, in patch_sites
>     run_frappe_cmd('--site', 'all', 'migrate', bench_path=bench_path)
>   File "/home/frappe/bench-repo/bench/utils.py", line 501, in run_frappe_cmd
>     raise CommandFailedError(args)
> bench.utils.CommandFailedError: ('--site', 'all', 'migrate')
> frappe@erp:~$

Same error here when I run bench update after restoring my backup on a new VM, also my translations don’t work.

@applepipe , @spa you found any fix for this issue?

Now following error is coming

Executing execute:frappe.create_folder(os.path.join(frappe.local.site_path, 'private', 'files')) in site1.local (site1.local)
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/site.py", line 206, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/migrate.py", line 29, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 26, in run_all
    if not run_single(patchmodule = patch):
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 60, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 78, in execute_patch
    exec patchmodule.split("execute:")[1] in globals()
  File "<string>", line 1, in <module>
NameError: name 'os' is not defined
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.1', 'console_scripts', 'bench')()
  File "/home/erpnext/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/bench-repo/bench/commands/update.py", line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
  File "/home/erpnext/bench-repo/bench/commands/update.py", line 90, in _update
    patch_sites(bench_path=bench_path)
  File "/home/erpnext/bench-repo/bench/utils.py", line 161, in patch_sites
    run_frappe_cmd('--site', 'all', 'migrate', bench_path=bench_path)
  File "/home/erpnext/bench-repo/bench/utils.py", line 501, in run_frappe_cmd
    raise CommandFailedError(args)
bench.utils.CommandFailedError: ('--site', 'all', 'migrate')

Nothing yet, still having issues with translations

@atif_siddiqui pushed another fix, can you try again?

@rmehta still not solved.

Executing frappe.patches.v7_0.desktop_icons_hidden_by_admin_as_blocked in site1.local (site1.local)
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/site.py", line 206, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/migrate.py", line 29, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all
    if not run_single(patchmodule = patch):
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/patches/v7_0/desktop_icons_hidden_by_admin_as_blocked.py", line 9, in execute
    frappe.db.sql('update `tabDesktop Icon` set blocked = 1 where standard=1 and hidden=1')
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/database.py", line 148, in sql
    self._cursor.execute(query)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1146, "Table 'site1.local.tabDesktop Icon' doesn't exist")
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.1', 'console_scripts', 'bench')()
  File "/home/erpnext/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/bench-repo/bench/commands/update.py", line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
  File "/home/erpnext/bench-repo/bench/commands/update.py", line 90, in _update
    patch_sites(bench_path=bench_path)
  File "/home/erpnext/bench-repo/bench/utils.py", line 161, in patch_sites
    run_frappe_cmd('--site', 'all', 'migrate', bench_path=bench_path)
  File "/home/erpnext/bench-repo/bench/utils.py", line 501, in run_frappe_cmd
    raise CommandFailedError(args)
bench.utils.CommandFailedError: ('--site', 'all', 'migrate')

Any update on this? I am stuck here…

Any workaround for this issue?

hello @atif_siddiqui

I don’t know if this is related to your issue, but @rmehta helped me on this issue on github: https://github.com/frappe/translator/issues/89

For me everything works fine now.

Hello @applepipe

Now error is not related to translator. Error is now coming in finally:frappe.patches.v6_24.sync_desktop_icons

Executing finally:frappe.patches.v6_24.sync_desktop_icons in site1.local (site1.local)
Success
Executing erpnext.patches.v6_3.convert_applicable_territory in site1.local (site1.local)
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/site.py", line 206, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/migrate.py", line 29, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all
    if not run_single(patchmodule = patch):
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/erpnext/frappe-bench/apps/erpnext/erpnext/patches/v6_3/convert_applicable_territory.py", line 8, in execute
    frappe.reload_doctype("Shopping Cart Settings")
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 625, in reload_doctype
    reload_doc(scrub(db.get_value("DocType", doctype, "module")), "doctype", scrub(doctype), force=force)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 650, in scrub
    return txt.replace(' ','_').replace('-', '_').lower()
AttributeError: 'NoneType' object has no attribute 'replace'
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.1', 'console_scripts', 'bench')()
  File "/home/erpnext/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/bench-repo/bench/commands/update.py", line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
  File "/home/erpnext/bench-repo/bench/commands/update.py", line 90, in _update
    patch_sites(bench_path=bench_path)
  File "/home/erpnext/bench-repo/bench/utils.py", line 161, in patch_sites
    run_frappe_cmd('--site', 'all', 'migrate', bench_path=bench_path)
  File "/home/erpnext/bench-repo/bench/utils.py", line 501, in run_frappe_cmd
    raise CommandFailedError(args)
bench.utils.CommandFailedError: ('--site', 'all', 'migrate')

try this

bench --sitename console
frappe.reload_doctype("shopping_cart", "doctype", "shopping_cart_settings")
exit()

then run bench migrate again

1 Like