Bench Update Error on Migrate Site: ModuleNotFoundError: No module named 'extra_features'

Hi ERPNEXT Community,

I had been running ERPNEXT V12.5 for a few months and today I decided to update the system to the latest branch. But I ran into an error when migrating site:

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/erpnext/bench/apps/frappe/frappe/utils/", line 97, in <module>
  File "/home/erpnext/bench/apps/frappe/frappe/utils/", line 18, in main
  File "/home/erpnext/bench/env/lib/python3.6/site-packages/click/", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/erpnext/bench/env/lib/python3.6/site-packages/click/", line 717, in main
    rv = self.invoke(ctx)
  File "/home/erpnext/bench/env/lib/python3.6/site-packages/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/bench/env/lib/python3.6/site-packages/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/bench/env/lib/python3.6/site-packages/click/", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/erpnext/bench/env/lib/python3.6/site-packages/click/", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/bench/env/lib/python3.6/site-packages/click/", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/erpnext/bench/apps/frappe/frappe/commands/", line 25, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/erpnext/bench/apps/frappe/frappe/commands/", line 239, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip_failing)
  File "/home/erpnext/bench/apps/frappe/frappe/", line 48, in migrate
  File "/home/erpnext/bench/apps/frappe/frappe/modules/", line 41, in run_all
  File "/home/erpnext/bench/apps/frappe/frappe/modules/", line 30, in run_patch
    if not run_single(patchmodule = patch):
  File "/home/erpnext/bench/apps/frappe/frappe/modules/", line 71, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/erpnext/bench/apps/frappe/frappe/modules/", line 77, in execute_patch
  File "/home/erpnext/bench/apps/frappe/frappe/modules/", line 127, in block_user
    frappe.db.set_global('__session_status', block and 'stop' or None)
  File "/home/erpnext/bench/apps/frappe/frappe/database/", line 698, in set_global
    self.set_default(key, val, user)
  File "/home/erpnext/bench/apps/frappe/frappe/database/", line 712, in set_default
    frappe.defaults.set_default(key, val, parent, parenttype)
  File "/home/erpnext/bench/apps/frappe/frappe/", line 134, in set_default
    add_default(key, value, parent)
  File "/home/erpnext/bench/apps/frappe/frappe/", line 147, in add_default
  File "/home/erpnext/bench/apps/frappe/frappe/model/", line 223, in insert
  File "/home/erpnext/bench/apps/frappe/frappe/model/", line 794, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/erpnext/bench/apps/frappe/frappe/model/", line 1061, in composer
  File "/home/erpnext/bench/apps/frappe/frappe/", line 1046, in get_attr
    return getattr(get_module(modulename), methodname)
  File "/home/erpnext/bench/apps/frappe/frappe/", line 827, in get_module
    return importlib.import_module(modulename)
  File "/home/erpnext/bench/env/lib/python3.6/importlib/", 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 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/erpnext/bench/apps/erpnext_telegram_integration/erpnext_telegram_integration/erpnext_telegram_integration/doctype/sms_notification/", line 14, in <module>
    from import print_out
ModuleNotFoundError: No module named 'extra_features'

Anyone has any idea how to fix this?

What command(s) produced the error message? Have you tried bench updare --reset ?

I’ve tried bench update --reset a few times, still doesn’t work. Everytime it gets to migrating site, I get the same error.

@Ratanak Do you have any custom apps installed? This could be the due to a broken Python environment. Try bench --site {site-name} list-apps to check the installed apps on your site.

I have the ERPNEXT telegram integration app installed. It was working fine with V 12.5.0.

I’ve found out the cause of the error, it was caused by the custom app Erpnext Telegram Integration. I reverted the app back to its previous version, and everything works fine.

1 Like


Thank you for sharing the solution.
Please Mark as solved & close this subject.

Commands that could help:

  • bench setup requirements --python
  • bench pip install -e apps/erpnext_telegram_integration
1 Like

bench setup requirements --python
Usage: bench frappe [OPTIONS] COMMAND [ARGS]…
Try ‘bench frappe --help’ for help.

Error: No such command ‘setup’.
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 20, in
File “/usr/local/lib/python3.9/”, line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[’/home/frappe/frappe-bench/env/bin/python’, ‘/home/frappe/frappe-bench/apps/frappe/frappe/utils/’, ‘frappe’, ‘setup’, ‘requirements’, ‘–python’]’ returned non-zero exit status 2.

I got this error in my production setup.