ERPNext.com Frappe Cloud Support Partners Foundation

No module named navbar settings

Hello!
Trying a
bench update

but I get
ModuleNotFoundError: No module named ‘frappe.core.doctype.navbar_settings’

During handling of the above exception, another exception occurred:

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 99, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 1137, 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 1137, 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 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.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 26, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 287, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip_failing)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 48, 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/add_standard_navbar_items.py", line 7, in execute
    add_standard_navbar_items()
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/setup/install.py", line 121, in add_standard_navbar_items
    navbar_settings = frappe.get_single("Navbar Settings")
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 773, in get_single
    return get_doc(doctype, doctype)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 753, in get_doc
    doc = frappe.model.document.get_doc(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 69, in get_doc
    controller = get_controller(doctype)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 48, in get_controller
    module = load_doctype_module(doctype, module_name)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py", line 206, in load_doctype_module
    raise ImportError('Module import failed for {0} ({1})'.format(doctype, module_name + ' Error: ' + str(e)))
ImportError: Module import failed for Navbar Settings (frappe.core.doctype.navbar_settings.navbar_settings Error: No module named 'frappe.core.doctype.navbar_settings')

How can I solve this?
Any troubleshooting tips are greatly welcome too :slight_smile:

Your app erpnext is on develop branch, switch it to version-12 using

cd apps/erpnext
git fetch upstream version-12:version-12
git checkout version-12
cd …/…
bench update

I am getting the same error as follows:

>     > Migrating site-name
>     > Executing execute:frappe.reload_doc("HR", "doctype", "HR Settings") #2020-01-16 #2020-07-24 in site-name (_c90f9e636683bb70)
>     > Success: Done in 0.265s
>     > Executing erpnext.patches.v12_0.generate_leave_ledger_entries #04-11-2020 in site-name (_c90f9e636683bb70)
>     > Success: Done in 1.728s
>     > Executing erpnext.patches.v13_0.update_old_loans in site-name (_c90f9e636683bb70)
>     > Success: Done in 1.077s
>     > Executing execute:frappe.reload_doctype('Dashboard') in site-name(_c90f9e636683bb70)
>     > Success: Done in 0.009s
>     > Executing execute:frappe.reload_doc('desk', 'doctype', 'number_card_link') in site-name (_c90f9e636683bb70)
>     > Success: Done in 0.008s
>     > Executing erpnext.patches.v13_0.replace_pos_page_with_point_of_sale_page in site-name (_c90f9e636683bb70)
>     > Success: Done in 0.009s
>     > Executing erpnext.patches.v13_0.add_standard_navbar_items #4 in site-name (_c90f9e636683bb70)
>     > Traceback (most recent call last):
>     >   File "/opt/erpnext/erpnext/apps/frappe/frappe/modules/utils.py", line 204, in load_doctype_module
>     >     doctype_python_modules[key] = frappe.get_module(module_name)
>     >   File "/opt/erpnext/erpnext/apps/frappe/frappe/__init__.py", line 854, in get_module
>     >     return importlib.import_module(modulename)
>     >   File "/opt/erpnext/erpnext/env/lib/python3.6/importlib/__init__.py", line 126, in import_module
>     >     return _bootstrap._gcd_import(name[level:], package, level)
>     >   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
>     >   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
>     >   File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
>     >   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
>     >   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
>     >   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
>     >   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
>     > ModuleNotFoundError: No module named 'frappe.core.doctype.navbar_settings'
>     > 
>     > During handling of the above exception, another exception occurred:
>     > 
>     > 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 "/opt/erpnext/erpnext/apps/frappe/frappe/utils/bench_helper.py", line 99, in <module>
>     >     main()
>     >   File "/opt/erpnext/erpnext/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
>     >     click.Group(commands=commands)(prog_name='bench')
>     >   File "/opt/erpnext/erpnext/env/lib/python3.6/site-packages/click/core.py", line 764, in __call__
>     >     return self.main(*args, **kwargs)
>     >   File "/opt/erpnext/erpnext/env/lib/python3.6/site-packages/click/core.py", line 717, in main
>     >     rv = self.invoke(ctx)
>     >   File "/opt/erpnext/erpnext/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
>     >     return _process_result(sub_ctx.command.invoke(sub_ctx))
>     >   File "/opt/erpnext/erpnext/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
>     >     return _process_result(sub_ctx.command.invoke(sub_ctx))
>     >   File "/opt/erpnext/erpnext/env/lib/python3.6/site-packages/click/core.py", line 956, in invoke
>     >     return ctx.invoke(self.callback, **ctx.params)
>     >   File "/opt/erpnext/erpnext/env/lib/python3.6/site-packages/click/core.py", line 555, in invoke
>     >     return callback(*args, **kwargs)
>     >   File "/opt/erpnext/erpnext/env/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
>     >     return f(get_current_context(), *args, **kwargs)
>     >   File "/opt/erpnext/erpnext/apps/frappe/frappe/commands/__init__.py", line 26, in _func
>     >     ret = f(frappe._dict(ctx.obj), *args, **kwargs)
>     >   File "/opt/erpnext/erpnext/apps/frappe/frappe/commands/site.py", line 287, in migrate
>     >     migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip_failing)
>     >   File "/opt/erpnext/erpnext/apps/frappe/frappe/migrate.py", line 67, in migrate
>     >     frappe.modules.patch_handler.run_all(skip_failing)
>     >   File "/opt/erpnext/erpnext/apps/frappe/frappe/modules/patch_handler.py", line 41, in run_all
>     >     run_patch(patch)
>     >   File "/opt/erpnext/erpnext/apps/frappe/frappe/modules/patch_handler.py", line 30, in run_patch
>     >     if not run_single(patchmodule = patch):
>     >   File "/opt/erpnext/erpnext/apps/frappe/frappe/modules/patch_handler.py", line 71, in run_single
>     >     return execute_patch(patchmodule, method, methodargs)
>     >   File "/opt/erpnext/erpnext/apps/frappe/frappe/modules/patch_handler.py", line 91, in execute_patch
>     >     frappe.get_attr(patchmodule.split()[0] + ".execute")()
>     >   File "/opt/erpnext/erpnext/apps/erpnext/erpnext/patches/v13_0/add_standard_navbar_items.py", line 7, in execute
>     >     add_standard_navbar_items()
>     >   File "/opt/erpnext/erpnext/apps/erpnext/erpnext/setup/install.py", line 121, in add_standard_navbar_items
>     >     navbar_settings = frappe.get_single("Navbar Settings")
>     >   File "/opt/erpnext/erpnext/apps/frappe/frappe/__init__.py", line 792, in get_single
>     >     return get_doc(doctype, doctype)
>     >   File "/opt/erpnext/erpnext/apps/frappe/frappe/__init__.py", line 772, in get_doc
>     >     doc = frappe.model.document.get_doc(*args, **kwargs)
>     >   File "/opt/erpnext/erpnext/apps/frappe/frappe/model/document.py", line 69, in get_doc
>     >     controller = get_controller(doctype)
>     >   File "/opt/erpnext/erpnext/apps/frappe/frappe/model/base_document.py", line 51, in get_controller
>     >     module = load_doctype_module(doctype, module_name)
>     >   File "/opt/erpnext/erpnext/apps/frappe/frappe/modules/utils.py", line 206, in load_doctype_module
>     >     raise ImportError('Module import failed for {0} ({1})'.format(doctype, module_name + ' Error: ' + str(e)))
>     > ImportError: Module import failed for Navbar Settings (frappe.core.doctype.navbar_settings.navbar_settings Error: No module named 'frappe.core.doctype.navbar_settings')

Please help to figure out the issue.