earthians / marley

Open Source Health Information System
https://frappehealth.com
GNU General Public License v3.0
333 stars 254 forks source link

raise exc frappe.exceptions.DoesNotExistError: Domain Healthcare not found #484

Open bonface221 opened 4 months ago

bonface221 commented 4 months ago

Information about bug

I was installing frappe health when it gave me an error Now I'm trying to remove it and I'm still getting error

frapp@106:~/frappe-bench$ bench --site dev.example.ke uninstall-app healthcare --yes Uninstalling App healthcare from Site dev.clouderp.ke... Backing up... Removing customizations created by Frappe Health... Removing Customizations for Frappe Health failed due to an error. Please try again or report the issue on https://github.com/frappe/health/issues/new if not resolved. Traceback (most recent call last): File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/home/frapp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 114, in main() File "/home/frapp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 20, in main click.Group(commands=commands)(prog_name="bench") File "/home/frapp/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) File "/home/frapp/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) File "/home/frapp/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/frapp/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/frapp/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/frapp/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) File "/home/frapp/frappe-bench/env/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func return f(get_current_context(), *args, *kwargs) File "/home/frapp/frappe-bench/apps/frappe/frappe/commands/init.py", line 29, in _func ret = f(frappe._dict(ctx.obj), args, kwargs) File "/home/frapp/frappe-bench/apps/frappe/frappe/commands/site.py", line 961, in uninstall remove_app(app_name=app, dry_run=dry_run, yes=yes, no_backup=no_backup, force=force) File "/home/frapp/frappe-bench/apps/frappe/frappe/installer.py", line 387, in remove_app frappe.get_attr(before_uninstall)() File "/home/frapp/frappe-bench/apps/healthcare/healthcare/uninstall.py", line 21, in before_uninstall raise e File "/home/frapp/frappe-bench/apps/healthcare/healthcare/uninstall.py", line 11, in before_uninstall remove_customizations() File "/home/frapp/frappe-bench/apps/healthcare/healthcare/setup.py", line 181, in before_uninstall domain = frappe.get_doc("Domain", "Healthcare") File "/home/frapp/frappe-bench/apps/frappe/frappe/init.py", line 1284, in get_doc doc = frappe.model.document.get_doc(*args, *kwargs) File "/home/frapp/frappe-bench/apps/frappe/frappe/model/document.py", line 85, in get_doc return controller(args, **kwargs) File "/home/frapp/frappe-bench/apps/frappe/frappe/model/document.py", line 126, in init self.load_from_db() File "/home/frapp/frappe-bench/apps/frappe/frappe/model/document.py", line 172, in load_from_db frappe.throw( File "/home/frapp/frappe-bench/apps/frappe/frappe/init.py", line 600, in throw msgprint( File "/home/frapp/frappe-bench/apps/frappe/frappe/init.py", line 565, in msgprint _raise_exception() File "/home/frapp/frappe-bench/apps/frappe/frappe/init.py", line 516, in _raise_exception raise exc frappe.exceptions.DoesNotExistError: Domain Healthcare not found

Module

Integration with ERPNext modules

Version

frappe 15.17.3 version-15 erpnext 15.17.1 version-15 hrms 16.0.0-dev develop payments 0.0.1 develop ecommerce_integrations 1.17.0 develop frappe_paystack 0.0.4 version-14 whitelabel 0.0.1 version-15

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

frapp@106:~/frappe-bench$ bench --site dev.example.ke uninstall-app healthcare --yes
Uninstalling App healthcare from Site dev.clouderp.ke...
Backing up...
Removing customizations created by Frappe Health...
Removing Customizations for Frappe Health failed due to an error. Please try again or report the issue on https://github.com/frappe/health/issues/new if not resolved.
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/frapp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 114, in <module>
    main()
  File "/home/frapp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/home/frapp/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/frapp/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/frapp/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frapp/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frapp/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frapp/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/frapp/frappe-bench/env/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/frapp/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frapp/frappe-bench/apps/frappe/frappe/commands/site.py", line 961, in uninstall
    remove_app(app_name=app, dry_run=dry_run, yes=yes, no_backup=no_backup, force=force)
  File "/home/frapp/frappe-bench/apps/frappe/frappe/installer.py", line 387, in remove_app
    frappe.get_attr(before_uninstall)()
  File "/home/frapp/frappe-bench/apps/healthcare/healthcare/uninstall.py", line 21, in before_uninstall
    raise e
  File "/home/frapp/frappe-bench/apps/healthcare/healthcare/uninstall.py", line 11, in before_uninstall
    remove_customizations()
  File "/home/frapp/frappe-bench/apps/healthcare/healthcare/setup.py", line 181, in before_uninstall
    domain = frappe.get_doc("Domain", "Healthcare")
  File "/home/frapp/frappe-bench/apps/frappe/frappe/__init__.py", line 1284, in get_doc
    doc = frappe.model.document.get_doc(*args, **kwargs)
  File "/home/frapp/frappe-bench/apps/frappe/frappe/model/document.py", line 85, in get_doc
    return controller(*args, **kwargs)
  File "/home/frapp/frappe-bench/apps/frappe/frappe/model/document.py", line 126, in __init__
    self.load_from_db()
  File "/home/frapp/frappe-bench/apps/frappe/frappe/model/document.py", line 172, in load_from_db
    frappe.throw(
  File "/home/frapp/frappe-bench/apps/frappe/frappe/__init__.py", line 600, in throw
    msgprint(
  File "/home/frapp/frappe-bench/apps/frappe/frappe/__init__.py", line 565, in msgprint
    _raise_exception()
  File "/home/frapp/frappe-bench/apps/frappe/frappe/__init__.py", line 516, in _raise_exception
    raise exc
frappe.exceptions.DoesNotExistError: Domain Healthcare not found

Code of Conduct

dmbabu commented 4 months ago

I am facing the same issue with healthcare version-15. I ran bench migrate even after the error and everything seems to out.