INternal server error after removing app

Hi, All

After removing whatsapp -

rm -rf apps/frappe_whatsapp

my site is not working it’s saying INTERNAL SERVER ERROR

Hi @rs115199789
The app removal method is incorrect. Re-install the app uninstall the app from the site and then remove the app. I hope It will work

bench --site [site-name] uninstall-app [app-name]
bench remove-app [app_name] --force

Thank You!

darklord@Rahul-PC:~/frappe-bench$ bench --site erp.testserver.in uninstall-app frappe_whatsapp
Uninstalling App frappe_whatsapp from Site erp.testserver.in…
All doctypes (including custom), modules related to this app will be deleted. Are you sure you want to continue? [y/N]: y
Backing up…
Deleting Module ‘Frappe Whatsapp’

  • removing DocType ‘WhatsApp Message’…
  • removing DocType ‘WhatsApp Templates’…
  • removing DocType ‘WhatsApp Settings’…
  • removing DocType ‘WhatsApp Notification’…
  • removing DocType ‘WhatsApp Message Fields’…
  • removing DocType ‘WhatsApp Notification Log’…
  • removing Module Def ‘Frappe Whatsapp’…
  • dropping Table for ‘WhatsApp Templates’…
  • dropping Table for ‘WhatsApp Notification Log’…
  • dropping Table for ‘WhatsApp Notification’…
  • dropping Table for ‘WhatsApp Message Fields’…
  • dropping Table for ‘WhatsApp Message’…
    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/darklord/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 114, in
    main()
    File “/home/darklord/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 20, in main
    click.Group(commands=commands)(prog_name=“bench”)
    File “/home/darklord/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1157, in call
    return self.main(*args, **kwargs)
    File “/home/darklord/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1078, in main
    rv = self.invoke(ctx)
    File “/home/darklord/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/darklord/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/darklord/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/home/darklord/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 783, in invoke
    return __callback(*args, **kwargs)
    File “/home/darklord/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/darklord/frappe-bench/apps/frappe/frappe/commands/init.py”, line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/darklord/frappe-bench/apps/frappe/frappe/commands/site.py”, line 873, in uninstall
    remove_app(app_name=app, dry_run=dry_run, yes=yes, no_backup=no_backup, force=force)
    File “/home/darklord/frappe-bench/apps/frappe/frappe/installer.py”, line 401, in remove_app
    frappe.get_single(“Installed Applications”).update_versions()
    File “/home/darklord/frappe-bench/apps/frappe/frappe/core/doctype/installed_applications/installed_applications.py”, line 39, in update_versions
    self.save()
    File “/home/darklord/frappe-bench/apps/frappe/frappe/model/document.py”, line 337, in save
    return self._save(*args, **kwargs)
    File “/home/darklord/frappe-bench/apps/frappe/frappe/model/document.py”, line 373, in _save
    self.run_before_save_methods()
    File “/home/darklord/frappe-bench/apps/frappe/frappe/model/document.py”, line 1085, in run_before_save_methods
    self.run_method(“before_validate”)
    File “/home/darklord/frappe-bench/apps/frappe/frappe/model/document.py”, line 962, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
    File “/home/darklord/frappe-bench/apps/frappe/frappe/model/document.py”, line 1322, in composer
    return composed(self, method, *args, **kwargs)
    File “/home/darklord/frappe-bench/apps/frappe/frappe/model/document.py”, line 1306, in runner
    add_to_return_value(self, f(self, method, *args, **kwargs))
    File “/home/darklord/frappe-bench/apps/frappe_whatsapp/frappe_whatsapp/utils/init.py”, line 17, in run_server_script_for_doc_event
    notification = get_notifications_map().get(
    File “/home/darklord/frappe-bench/apps/frappe_whatsapp/frappe_whatsapp/utils/init.py”, line 36, in get_notifications_map
    enabled_whatsapp_notifications = frappe.get_all(
    File “/home/darklord/frappe-bench/apps/frappe/frappe/init.py”, line 2057, in get_all
    return get_list(doctype, *args, **kwargs)
    File “/home/darklord/frappe-bench/apps/frappe/frappe/init.py”, line 2032, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
    File “/home/darklord/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 185, in execute
    self.columns = self.get_table_columns()
    File “/home/darklord/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 546, in get_table_columns
    return get_table_columns(self.doctype)
    File “/home/darklord/frappe-bench/apps/frappe/frappe/model/meta.py”, line 73, in get_table_columns
    return frappe.db.get_table_columns(doctype)
    File “/home/darklord/frappe-bench/apps/frappe/frappe/database/database.py”, line 1197, in get_table_columns
    raise self.TableMissingError(“DocType”, doctype)
    pymysql.err.ProgrammingError: (‘DocType’, ‘WhatsApp Notification’)

tried the second command and it’s working, sorted the issue with bench use site.

Thanks