Upgrade failing; frappe.exceptions.DoesNotExistError: DocType Student Admission not found

Hi All,

I’m testing upgrading to v8, and I’m hitting the following error (full stack trace at bottom).

frappe.exceptions.DoesNotExistError: DocType Student Admission not found

Any hints would be greatly appreciated.

# bench version
erpnext 8.0.18
frappe 8.0.25
Backing up sites...
Patching sites...
Migrating ship
Executing frappe.patches.v8_0.update_published_in_global_search in ship (ship)
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 700, in __call__
    return self.main(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1027, 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 1027, 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 873, 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 508, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 16, 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 210, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/migrate.py", line 31, 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/v8_0/update_published_in_global_search.py", line 6, in execute
    rebuild_for_doctype(doctype)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/global_search.py", line 64, in rebuild_for_doctype
    meta = frappe.get_meta(doctype)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 623, in get_meta
    return frappe.model.meta.get_meta(doctype, cached=cached)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/meta.py", line 30, 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 171, in hget
    value = generator()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/meta.py", line 30, in <lambda>
    return frappe.cache().hget("meta", doctype, lambda: Meta(doctype))
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/meta.py", line 65, in __init__
    super(Meta, self).__init__("DocType", doctype)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 84, in __init__
    self.load_from_db()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/meta.py", line 70, in load_from_db
    super(Meta, self).load_from_db()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 115, 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 316, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator='red')
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 306, in msgprint
    _raise_exception()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 279, in _raise_exception
    raise raise_exception, encode(msg)
frappe.exceptions.DoesNotExistError: DocType Student Admission not found

I have also now posted this as a Github Issue https://github.com/frappe/erpnext/issues/8590

1 Like

PSA: The awesome @rmehta pushed a fixed and is now in v8.0.20