Bench update error - Module import failed for Assessment Result Detail

Hi guys,

Please see below error on bench update. Seems to be coming from School.

Chudes-MBP:frappe-bench chudeosiegbu$ bench update
INFO:bench.utils:updating bench
Already up-to-date.
Requirement already satisfied: 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 estate_manager
From https://github.com/manqala/estate_manager
 * branch            develop    -> FETCH_HEAD
Already up-to-date.
INFO:bench.app:pulling paystack_integration
From https://github.com/manqala/paystack_integration
 * branch            develop    -> FETCH_HEAD
Already up-to-date.
INFO:bench.app:pulling bank_statement
From https://github.com/manqala/bank_statement
 * 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 erpnext_estate
Updating frappe                     : [========================================]
Updating erpnext                    : [========================================]
Updating estate_manager             : [========================================]
Syncing help database...
Migrating erpnext_school
Executing erpnext.patches.v7_2.update_assessment_modules in erpnext_school (ace2dd0979440896)
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/chudeosiegbu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/Users/chudeosiegbu/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/Users/chudeosiegbu/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/Users/chudeosiegbu/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/chudeosiegbu/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/chudeosiegbu/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/chudeosiegbu/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/Users/chudeosiegbu/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/chudeosiegbu/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/commands/site.py", line 209, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/migrate.py", line 30, in migrate
    frappe.modules.patch_handler.run_all()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all
    if not run_single(patchmodule = patch):
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/Users/chudeosiegbu/frappe-bench/apps/erpnext/erpnext/patches/v7_2/update_assessment_modules.py", line 29, in execute
    assessment_result.save()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/document.py", line 223, in save
    return self._save(*args, **kwargs)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/document.py", line 246, in _save
    self.insert()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/document.py", line 179, in insert
    self._set_defaults()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/document.py", line 487, in _set_defaults
    new_doc = frappe.new_doc(df.options, as_dict=True)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/__init__.py", line 578, in new_doc
    return get_new_doc(doctype, parent_doc, parentfield, as_dict=as_dict)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/create_new.py", line 19, in get_new_doc
    frappe.local.new_doc_templates[doctype] = make_new_doc(doctype)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/create_new.py", line 37, in make_new_doc
    "docstatus": 0
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/__init__.py", line 602, in get_doc
    return frappe.model.document.get_doc(arg1, arg2)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/document.py", line 48, in get_doc
    controller = get_controller(doctype)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/base_document.py", line 34, in get_controller
    module = load_doctype_module(doctype, module_name)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/modules/utils.py", line 179, in load_doctype_module
    raise ImportError, 'Module import failed for {0} ({1})'.format(doctype, module_name)
ImportError: Module import failed for Assessment Result Detail (frappe.core.doctype.assessment_result_detail.assessment_result_detail)

Regards,
cksgb

Hi @Chude_Osiegbu,

I have fixed it via https://github.com/frappe/erpnext/pull/7564
Thanks for reporting.

2 Likes

Hi @neilLasrado,

Another error with evaluation criteria:

Chudes-MBP:frappe-bench chudeosiegbu$ bench update
INFO:bench.utils:updating bench
Already up-to-date.
Requirement already satisfied: 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 estate_manager
From https://github.com/manqala/estate_manager
 * branch            develop    -> FETCH_HEAD
Already up-to-date.
INFO:bench.app:pulling paystack_integration
From https://github.com/manqala/paystack_integration
 * branch            develop    -> FETCH_HEAD
Already up-to-date.
INFO:bench.app:pulling bank_statement
From https://github.com/manqala/bank_statement
 * 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 erpnext_estate
Updating frappe                     : [========================================]
Updating erpnext                    : [========================================]
Updating estate_manager             : [========================================]
Syncing help database...
Migrating erpnext_school
Executing erpnext.patches.v7_2.update_assessment_modules in erpnext_school (ace2dd0979440896)
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/chudeosiegbu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/Users/chudeosiegbu/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/Users/chudeosiegbu/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/Users/chudeosiegbu/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/chudeosiegbu/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/chudeosiegbu/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/chudeosiegbu/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/Users/chudeosiegbu/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/chudeosiegbu/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/commands/site.py", line 209, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/migrate.py", line 30, in migrate
    frappe.modules.patch_handler.run_all()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all
    if not run_single(patchmodule = patch):
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/Users/chudeosiegbu/frappe-bench/apps/erpnext/erpnext/patches/v7_2/update_assessment_modules.py", line 31, in execute
    assessment_result.save()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/document.py", line 223, in save
    return self._save(*args, **kwargs)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/document.py", line 246, in _save
    self.insert()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/document.py", line 179, in insert
    self._set_defaults()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/document.py", line 487, in _set_defaults
    new_doc = frappe.new_doc(df.options, as_dict=True)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/__init__.py", line 578, in new_doc
    return get_new_doc(doctype, parent_doc, parentfield, as_dict=as_dict)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/create_new.py", line 19, in get_new_doc
    frappe.local.new_doc_templates[doctype] = make_new_doc(doctype)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/create_new.py", line 40, in make_new_doc
    set_user_and_static_default_values(doc)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/create_new.py", line 55, in set_user_and_static_default_values
    user_default_value = get_user_default_value(df, defaults, user_permissions)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/create_new.py", line 70, in get_user_default_value
    if (frappe.get_meta(df.options).document_type=="Setup"
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/__init__.py", line 619, in get_meta
    return frappe.model.meta.get_meta(doctype, cached=cached)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/meta.py", line 30, in get_meta
    return frappe.cache().hget("meta", doctype, lambda: Meta(doctype))
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py", line 171, in hget
    value = generator()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/meta.py", line 30, in <lambda>
    return frappe.cache().hget("meta", doctype, lambda: Meta(doctype))
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/meta.py", line 65, in __init__
    super(Meta, self).__init__("DocType", doctype)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/document.py", line 83, in __init__
    self.load_from_db()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/meta.py", line 70, in load_from_db
    super(Meta, self).load_from_db()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/document.py", line 114, in load_from_db
    frappe.throw(_("{0} {1} not found").format(_(self.doctype), self.name), frappe.DoesNotExistError)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/__init__.py", line 312, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator='red')
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/__init__.py", line 302, in msgprint
    _raise_exception()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/__init__.py", line 275, in _raise_exception
    raise raise_exception, encode(msg)
frappe.exceptions.DoesNotExistError: DocType Evaluation Criteria not found 

Regards,
cksgb

@Chude_Osiegbu fixed it as well. https://github.com/frappe/erpnext/pull/7569

Sorry for the inconvenience.

@Chude_Osiegbu Can you also try out the new Assessment module and give some feedback regarding it.
You can check this out to understand the new design better https://frappe.io/blog/erpnext-features/manage-student-assessments-using-erpnext-schools

Hi Neil,

Will do.

Cheers,
cksgb

Hi @neilLasrado,

Still a problem with bench update on the following:

Chudes-MBP:frappe-bench chudeosiegbu$ bench update
INFO:bench.utils:updating bench
Already up-to-date.
remote: Counting objects: 14, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 14 (delta 5), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (14/14), done.
From https://github.com/frappe/frappe
   254ca33..e178712  develop    -> upstream/develop
   073dd69..9a23f80  hotfix     -> upstream/hotfix
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
From https://github.com/frappe/frappe
 * branch            develop    -> FETCH_HEAD
Updating 254ca33..e178712
Fast-forward
 frappe/core/page/permission_manager/permission_manager.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
INFO:bench.app:pulling estate_manager
From https://github.com/manqala/estate_manager
 * branch            develop    -> FETCH_HEAD
Already up-to-date.
INFO:bench.app:pulling paystack_integration
From https://github.com/manqala/paystack_integration
 * branch            develop    -> FETCH_HEAD
Already up-to-date.
INFO:bench.app:pulling bank_statement
From https://github.com/manqala/bank_statement
 * 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 erpnext_estate
Updating frappe                     : [========================================]
Updating erpnext                    : [========================================]
Updating estate_manager             : [========================================]
Syncing help database...
Migrating erpnext_school
Executing erpnext.patches.v7_2.update_assessment_modules in erpnext_school (ace2dd0979440896)
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/chudeosiegbu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/Users/chudeosiegbu/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/Users/chudeosiegbu/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/Users/chudeosiegbu/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/chudeosiegbu/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/chudeosiegbu/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/chudeosiegbu/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/Users/chudeosiegbu/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/chudeosiegbu/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/commands/site.py", line 209, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/migrate.py", line 30, in migrate
    frappe.modules.patch_handler.run_all()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all
    if not run_single(patchmodule = patch):
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/Users/chudeosiegbu/frappe-bench/apps/erpnext/erpnext/patches/v7_2/update_assessment_modules.py", line 33, in execute
    assessment_result.save()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/document.py", line 223, in save
    return self._save(*args, **kwargs)
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/document.py", line 246, in _save
    self.insert()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/document.py", line 190, in insert
    self._validate()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/document.py", line 388, in _validate
    self._validate_mandatory()
  File "/Users/chudeosiegbu/frappe-bench/apps/frappe/frappe/model/document.py", line 608, in _validate_mandatory
    name=self.name))
frappe.exceptions.MandatoryError: [Assessment Result, RES000001]: details

Regards,
cksgb

Hi @Chude_Osiegbu,

We have fixed this issue as well. Try running bench update and let me know if it works fine now. :slight_smile: