ImportError: No module named inbox.email_inbox.contact

On development setup . On bench update, I have been facing below issue. Please guide. Before this I was just trying for production setup steps - nginx and supervisor setup. Which wasnt quite successful hence I did undo production setup (Again as per instructions given in documentation.) Then while trying to do bench update , I get below error.

Executing frappe.patches.v7_1.fix_email_sender in erpnext.local (ea106b3e4781622f)
Traceback (most recent call last):
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/Users/truptimali/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/Users/truptimali/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/Users/truptimali/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/Users/truptimali/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/Users/truptimali/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Users/truptimali/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Users/truptimali/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/Users/truptimali/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/Users/truptimali/frappe-bench/env/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/Users/truptimali/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/Users/truptimali/frappe-bench/apps/frappe/frappe/commands/site.py”, line 209, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/Users/truptimali/frappe-bench/apps/frappe/frappe/migrate.py”, line 30, in migrate
frappe.modules.patch_handler.run_all()
File “/Users/truptimali/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/Users/truptimali/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/Users/truptimali/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/Users/truptimali/frappe-bench/apps/frappe/frappe/init.py”, line 880, in get_attr
return getattr(get_module(modulename), methodname)
File “/Users/truptimali/frappe-bench/apps/frappe/frappe/init.py”, line 665, in get_module
return importlib.import_module(modulename)
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py”, line 37, in import_module
import(name)
File “/Users/truptimali/frappe-bench/apps/frappe/frappe/patches/v7_1/fix_email_sender.py”, line 4, in
from inbox.email_inbox.contact import match_email_to_contact
ImportError: No module named inbox.email_inbox.contact

1 Like

Known problem, it will be fixed soon.

ok thanks !!

pull now. Making a detailed post

After that, now I get

Executing erpnext.patches.v7_2.update_salary_slips in erp.local (1bd3e0294d)
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/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/ubuntu/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/ubuntu/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/ubuntu/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/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/ubuntu/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/ubuntu/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/site.py", line 209, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/migrate.py", line 30, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all
    if not run_single(patchmodule = patch):
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/ubuntu/frappe-bench/apps/erpnext/erpnext/patches/v7_2/update_salary_slips.py", line 15, in execute
    get_start_end_date = get_month_details(salary_slip.fiscal_year, salary_slip.month)
  File "/home/ubuntu/frappe-bench/apps/erpnext/erpnext/hr/doctype/process_payroll/process_payroll.py", line 359, in get_month_details
    frappe.throw(_("Fiscal Year {0} not found").format(year))
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/__init__.py", line 312, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator='red')
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/__init__.py", line 302, in msgprint
    _raise_exception()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/__init__.py", line 275, in _raise_exception
    raise raise_exception, encode(msg)
frappe.exceptions.ValidationError: Fiscal Year None not found

Looks like the error is in:

/home/ubuntu/frappe-bench/apps/erpnext/erpnext/patches/v7_2/update_salary_slips.py

here:

    salary_slips = frappe.db.sql("""select month, name from `tabSalary Slip`
                            where (month is not null and month != '') and
                            (start_date is null  or start_date = '') and
                            (end_date is null  or end_date = '') and docstatus != 2""", as_dict=True)

In the select statement fiscal_year is missing. But is it safe to correct it and run it myself?

EDIT: I’ve ran bench backup and then I fixed the file by adding fiscal_year to the select statement and ran bench update again. It’s working fine now.

Fixed !!! Please pull again.

1 Like

When i try to access desk#email_inbox I get the following error
Failed to load resource: the server responded with a status of 403 (FORBIDDEN) desk#email_inbox:1 Uncaught SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>) at Object.<anonymous> (desk.min.js:139) at i (jquery.min.js:2) at Object.fireWith [as rejectWith] (jquery.min.js:2) at z (jquery.min.js:4) at XMLHttpRequest.<anonymous> (jquery.min.js:4)