[IMP] unable to bench migrate

getting following error while migrating

also, tried removing app, but unable to delete app.

➜  procurement_app git:(develop) ✗ bench --site sample migrate             
Migrating sample




Updating DocTypes for frappe        : [=================================       ] 84%Queued rebuilding of search index for sample

Traceback with variables (most recent call last):
  File "/usr/local/Cellar/python@3.10/3.10.14/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
      mod_name = 'frappe.utils.bench_helper'
      alter_argv = True
      mod_spec = ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x1039d37c0>, origin='/Users/DeHaat/frappe-bench/apps/frappe/frappe/utils/bench_helper.py')
      code = <code object <module> at 0x10515a810, file "/Users/DeHaat/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 1>
      main_globals = {'__name__': '__main__', '__doc__': None, '__package__': 'frappe.utils', '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x1039d37c0>, '__spec__': ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x1039d37c0>, origin='/Users/DeHaat/frappe-bench/apps/frappe/frappe/utils/bench_helper.py'), '__annotations__': {}, '__builtins__': <module 'builtins' (built-in)>, '__file__': '/Users/DeHaat/frappe-bench/apps/frappe/frappe/utils/bench_helper.py', '__cached__': '/Users/DeHaat/frappe-bench/apps/frappe/frappe/utils/__pycache__/bench_helper.cpython-310.pyc', 'importlib': <module 'importlib' from '/usr/local/Cellar/python@3.10/3.10.14/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py'>, 'json': <module 'json' from '/usr/local/Cellar/python@3.10/3.10.14/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/__init__.py'>, 'os': <module 'os' from '/usr/local/Cellar/python@3.10/3.10.14/Fr...
  File "/usr/local/Cellar/python@3.10/3.10.14/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
      code = <code object <module> at 0x10515a810, file "/Users/DeHaat/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 1>
      run_globals = {'__name__': '__main__', '__doc__': None, '__package__': 'frappe.utils', '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x1039d37c0>, '__spec__': ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x1039d37c0>, origin='/Users/DeHaat/frappe-bench/apps/frappe/frappe/utils/bench_helper.py'), '__annotations__': {}, '__builtins__': <module 'builtins' (built-in)>, '__file__': '/Users/DeHaat/frappe-bench/apps/frappe/frappe/utils/bench_helper.py', '__cached__': '/Users/DeHaat/frappe-bench/apps/frappe/frappe/utils/__pycache__/bench_helper.cpython-310.pyc', 'importlib': <module 'importlib' from '/usr/local/Cellar/python@3.10/3.10.14/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py'>, 'json': <module 'json' from '/usr/local/Cellar/python@3.10/3.10.14/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/__init__.py'>, 'os': <module 'os' from '/usr/local/Cellar/python@3.10/3.10.14/Fr...
      init_globals = None
      mod_name = '__main__'
      mod_spec = ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x1039d37c0>, origin='/Users/DeHaat/frappe-bench/apps/frappe/frappe/utils/bench_helper.py')
      pkg_name = 'frappe.utils'
      script_name = None
      loader = <_frozen_importlib_external.SourceFileLoader object at 0x1039d37c0>
      fname = '/Users/DeHaat/frappe-bench/apps/frappe/frappe/utils/bench_helper.py'
      cached = '/Users/DeHaat/frappe-bench/apps/frappe/frappe/utils/__pycache__/bench_helper.cpython-310.pyc'
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 128, in <module>
    main()
      ...skipped... 27 vars
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 34, in main
    FrappeCommandGroup(commands=commands)(prog_name="bench")
      commands = {'frappe': <FrappeCommandGroup frappe>, 'get-frappe-commands': <Command get-frappe-commands>, 'get-frappe-help': <Command get-frappe-help>}
  File "/Users/DeHaat/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
      self = <FrappeCommandGroup None>
      args = ()
      kwargs = {'prog_name': 'bench'}
  File "/Users/DeHaat/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
      self = <FrappeCommandGroup None>
      args = ['frappe', '--site', 'sample', 'migrate']
      prog_name = 'bench'
      complete_var = None
      standalone_mode = True
      windows_expand_args = True
      extra = {}
      ctx = <click.core.Context object at 0x105a3f850>
  File "/Users/DeHaat/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
      _process_result = <function MultiCommand.invoke.<locals>._process_result at 0x105ab3ac0>
      args = ['migrate']
      cmd_name = 'frappe'
      cmd = <FrappeCommandGroup frappe>
      sub_ctx = <click.core.Context object at 0x110051ab0>
      ctx = <click.core.Context object at 0x105a3f850>
      self = <FrappeCommandGroup None>
      __class__ = <class 'click.core.MultiCommand'>
  File "/Users/DeHaat/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
      _process_result = <function MultiCommand.invoke.<locals>._process_result at 0x11004fe20>
      args = []
      cmd_name = 'migrate'
      cmd = <Command migrate>
      sub_ctx = <click.core.Context object at 0x1100528c0>
      ctx = <click.core.Context object at 0x110051ab0>
      self = <FrappeCommandGroup frappe>
      __class__ = <class 'click.core.MultiCommand'>
  File "/Users/DeHaat/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
      self = <Command migrate>
      ctx = <click.core.Context object at 0x1100528c0>
  File "/Users/DeHaat/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
      _Context__self = <click.core.Context object at 0x1100528c0>
      _Context__callback = <function migrate at 0x105adbb50>
      args = ()
      kwargs = {'skip_failing': False, 'skip_search_index': False}
      ctx = <click.core.Context object at 0x1100528c0>
  File "/Users/DeHaat/frappe-bench/env/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
      args = ()
      kwargs = {'skip_failing': False, 'skip_search_index': False}
      f = <function migrate at 0x105adb910>
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
      ctx = <click.core.Context object at 0x1100528c0>
      args = ()
      kwargs = {'skip_failing': False, 'skip_search_index': False}
      profile = False
      f = <function migrate at 0x105adb880>
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/commands/site.py", line 764, in migrate
    SiteMigration(
      context = {'sites': ['sample'], 'force': False, 'verbose': False, 'profile': False}
      skip_failing = False
      skip_search_index = False
      activate_by_import = <module 'traceback_with_variables.activate_by_import' from '/Users/DeHaat/frappe-bench/env/lib/python3.10/site-packages/traceback_with_variables/activate_by_import.py'>
      SiteMigration = <class 'frappe.migrate.SiteMigration'>
      site = 'sample'
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/migrate.py", line 186, in run
    self.run_schema_updates()
      self = <frappe.migrate.SiteMigration object at 0x1100529e0>
      site = 'sample'
      filelock = <function filelock at 0x111ed7640>
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/migrate.py", line 52, in wrapper
    raise e
      args = (<frappe.migrate.SiteMigration object at 0x1100529e0>,)
      kwargs = {}
      method = <function SiteMigration.run_schema_updates at 0x111ed71c0>
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/migrate.py", line 44, in wrapper
    ret = method(*args, **kwargs)
      args = (<frappe.migrate.SiteMigration object at 0x1100529e0>,)
      kwargs = {}
      method = <function SiteMigration.run_schema_updates at 0x111ed71c0>
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/migrate.py", line 120, in run_schema_updates
    frappe.model.sync.sync_all()
      self = <frappe.migrate.SiteMigration object at 0x1100529e0>
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/model/sync.py", line 43, in sync_all
    sync_for(app, force, reset_permissions=reset_permissions)
      force = 0
      reset_permissions = False
      app = 'frappe'
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/model/sync.py", line 111, in sync_for
    import_file_by_path(
      app_name = 'frappe'
      force = 0
      reset_permissions = False
      files = ['/Users/DeHaat/frappe-bench/apps/frappe/frappe/core/doctype/docfield/docfield.json', '/Users/DeHaat/frappe-bench/apps/frappe/frappe/core/doctype/docperm/docperm.json', '/Users/DeHaat/frappe-bench/apps/frappe/frappe/core/doctype/doctype_action/doctype_action.json', '/Users/DeHaat/frappe-bench/apps/frappe/frappe/core/doctype/doctype_link/doctype_link.json', '/Users/DeHaat/frappe-bench/apps/frappe/frappe/core/doctype/doctype_state/doctype_state.json', '/Users/DeHaat/frappe-bench/apps/frappe/frappe/core/doctype/role/role.json', '/Users/DeHaat/frappe-bench/apps/frappe/frappe/core/doctype/has_role/has_role.json', '/Users/DeHaat/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.json', '/Users/DeHaat/frappe-bench/apps/frappe/frappe/custom/doctype/custom_field/custom_field.json', '/Users/DeHaat/frappe-bench/apps/frappe/frappe/custom/doctype/property_setter/property_setter.json', '/Users/DeHaat/frappe-bench/apps/frappe/frappe/website/doctype/web_form/web_form.json', '/Users/DeHaat/fr...
      FRAPPE_PATH = '/Users/DeHaat/frappe-bench/apps/frappe/frappe'
      core_module = 'doctype'
      custom_module = 'property_setter'
      website_module = 'portal_menu_item'
      desk_module = 'workspace'
      module_name = 'vmsdemomodule'
      document_type = 'property_setter'
      file = '/Users/DeHaat/frappe-bench/apps/frappe/frappe/custom/doctype/property_setter/property_setter.json'
      folder = '/Users/DeHaat/frappe-bench/apps/frappe/frappe/vmsdemomodule'
      l = 332
      i = 279
      doc_path = '/Users/DeHaat/frappe-bench/apps/frappe/frappe/integrations/doctype/s3_backup_settings/s3_backup_settings.json'
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 142, in import_file_by_path
    import_doc(
      path = '/Users/DeHaat/frappe-bench/apps/frappe/frappe/integrations/doctype/s3_backup_settings/s3_backup_settings.json'
      force = 0
      data_import = False
      pre_process = None
      ignore_version = True
      reset_permissions = False
      docs = [{'actions': [], 'creation': '2017-09-04 20:57:20.129205', 'doctype': 'DocType', 'editable_grid': 1, 'engine': 'InnoDB', 'fields': [{'default': '0', 'fieldname': 'enabled', 'fieldtype': 'Check', 'label': 'Enable Automatic Backup', 'doctype': 'DocField'}, {'depends_on': 'enabled', 'fieldname': 'api_access_section', 'fieldtype': 'Section Break', 'label': 'API Access', 'doctype': 'DocField'}, {'fieldname': 'access_key_id', 'fieldtype': 'Data', 'in_list_view': 1, 'label': 'Access Key ID', 'mandatory_depends_on': 'enabled', 'reqd': 1, 'doctype': 'DocField'}, {'fieldname': 'column_break_4', 'fieldtype': 'Column Break', 'doctype': 'DocField'}, {'fieldname': 'secret_access_key', 'fieldtype': 'Password', 'in_list_view': 1, 'label': 'Access Key Secret', 'mandatory_depends_on': 'enabled', 'reqd': 1, 'doctype': 'DocField'}, {'depends_on': 'enabled', 'fieldname': 'notification_section', 'fieldtype': 'Section Break', 'label': 'Notification', 'doctype': 'DocField'}, {'fieldname': 'notify_email', 'fie...
      calculated_hash = 'e7ac79a67abb8d9ac148619d5d8aa866'
      doc = {'actions': [], 'creation': '2017-09-04 20:57:20.129205', 'doctype': 'DocType', 'editable_grid': 1, 'engine': 'InnoDB', 'fields': [{'default': '0', 'fieldname': 'enabled', 'fieldtype': 'Check', 'label': 'Enable Automatic Backup', 'doctype': 'DocField'}, {'depends_on': 'enabled', 'fieldname': 'api_access_section', 'fieldtype': 'Section Break', 'label': 'API Access', 'doctype': 'DocField'}, {'fieldname': 'access_key_id', 'fieldtype': 'Data', 'in_list_view': 1, 'label': 'Access Key ID', 'mandatory_depends_on': 'enabled', 'reqd': 1, 'doctype': 'DocField'}, {'fieldname': 'column_break_4', 'fieldtype': 'Column Break', 'doctype': 'DocField'}, {'fieldname': 'secret_access_key', 'fieldtype': 'Password', 'in_list_view': 1, 'label': 'Access Key Secret', 'mandatory_depends_on': 'enabled', 'reqd': 1, 'doctype': 'DocField'}, {'depends_on': 'enabled', 'fieldname': 'notification_section', 'fieldtype': 'Section Break', 'label': 'Notification', 'doctype': 'DocField'}, {'fieldname': 'notify_email', 'fiel...
      db_modified_timestamp = None
      is_db_timestamp_latest = None
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 235, in import_doc
    doc.insert()
      docdict = {'actions': [], 'creation': '2017-09-04 20:57:20.129205', 'doctype': 'DocType', 'editable_grid': 1, 'engine': 'InnoDB', 'fields': [{'default': '0', 'fieldname': 'enabled', 'fieldtype': 'Check', 'label': 'Enable Automatic Backup', 'doctype': 'DocField'}, {'depends_on': 'enabled', 'fieldname': 'api_access_section', 'fieldtype': 'Section Break', 'label': 'API Access', 'doctype': 'DocField'}, {'fieldname': 'access_key_id', 'fieldtype': 'Data', 'in_list_view': 1, 'label': 'Access Key ID', 'mandatory_depends_on': 'enabled', 'reqd': 1, 'doctype': 'DocField'}, {'fieldname': 'column_break_4', 'fieldtype': 'Column Break', 'doctype': 'DocField'}, {'fieldname': 'secret_access_key', 'fieldtype': 'Password', 'in_list_view': 1, 'label': 'Access Key Secret', 'mandatory_depends_on': 'enabled', 'reqd': 1, 'doctype': 'DocField'}, {'depends_on': 'enabled', 'fieldname': 'notification_section', 'fieldtype': 'Section Break', 'label': 'Notification', 'doctype': 'DocField'}, {'fieldname': 'notify_email', 'fiel...
      data_import = False
      pre_process = None
      ignore_version = True
      reset_permissions = False
      path = '/Users/DeHaat/frappe-bench/apps/frappe/frappe/integrations/doctype/s3_backup_settings/s3_backup_settings.json'
      controller = <class 'frappe.core.doctype.doctype.doctype.DocType'>
      doc = <DocType: S3 Backup Settings>
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/model/document.py", line 318, in insert
    self.run_post_save_methods()
      self = <DocType: S3 Backup Settings>
      ignore_permissions = None
      ignore_links = None
      ignore_if_duplicate = False
      ignore_mandatory = None
      set_name = None
      set_child_names = True
      d = <DocPerm: ks6p5m1b73 parent=S3 Backup Settings>
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/model/document.py", line 1134, in run_post_save_methods
    self.run_method("on_update")
      self = <DocType: S3 Backup Settings>
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/model/document.py", line 968, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
      self = <DocType: S3 Backup Settings>
      args = ()
      kwargs = {}
      fn = <function Document.run_method.<locals>.fn at 0x104795d80>
      method = 'on_update'
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/model/document.py", line 1332, in composer
    return composed(self, method, *args, **kwargs)
      self = <DocType: S3 Backup Settings>
      args = ()
      kwargs = {}
      hooks = [<function build_domain_restriced_doctype_cache at 0x1100b37f0>, <function clear_doctype_notifications at 0x110c8c040>, <function process_workflow_actions at 0x112d2f130>, <function attach_files_to_document at 0x1103e5ea0>, <function apply at 0x112dc1c60>, <function update_due_date at 0x112dc1cf0>, <function apply_permissions_for_non_standard_user_type at 0x112dc35b0>]
      method = 'on_update'
      doc_events = {'*': {'on_update': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.core.doctype.file.utils.attach_files_to_document', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply', 'frappe.automation.doctype.assignment_rule.assignment_rule.update_due_date', 'frappe.core.doctype.user_type.user_type.apply_permissions_for_non_standard_user_type'], 'after_rename': ['frappe.desk.notifications.clear_doctype_notifications'], 'on_cancel': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply'], 'on_trash': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions'], 'on_update_after_submit': ['frappe.workflow.doctype.workflow_action.workflow_action.process_w...
      handler = 'frappe.core.doctype.user_type.user_type.apply_permissions_for_non_standard_user_type'
      composed = <function Document.hook.<locals>.compose.<locals>.runner at 0x104795e10>
      compose = <function Document.hook.<locals>.compose at 0x104795cf0>
      f = <function Document.run_method.<locals>.fn at 0x104795d80>
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/model/document.py", line 1310, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
      self = <DocType: S3 Backup Settings>
      method = 'on_update'
      args = ()
      kwargs = {}
      add_to_return_value = <function Document.hook.<locals>.add_to_return_value at 0x104795b40>
      fn = <function Document.run_method.<locals>.fn at 0x104795d80>
      hooks = (<function build_domain_restriced_doctype_cache at 0x1100b37f0>, <function clear_doctype_notifications at 0x110c8c040>, <function process_workflow_actions at 0x112d2f130>, <function attach_files_to_document at 0x1103e5ea0>, <function apply at 0x112dc1c60>, <function update_due_date at 0x112dc1cf0>, <function apply_permissions_for_non_standard_user_type at 0x112dc35b0>)
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/model/document.py", line 965, in fn
    return method_object(*args, **kwargs)
      self = <DocType: S3 Backup Settings>
      args = ()
      kwargs = {}
      method_object = <bound method DocType.on_update of <DocType: S3 Backup Settings>>
      method = 'on_update'
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 538, in on_update
    self.run_module_method("on_doctype_update")
      self = <DocType: S3 Backup Settings>
      allow_doctype_export = False
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 636, in run_module_method
    module = load_doctype_module(self.name, self.module)
      self = <DocType: S3 Backup Settings>
      method = 'on_doctype_update'
      load_doctype_module = <function load_doctype_module at 0x1101209d0>
  File "/Users/DeHaat/frappe-bench/apps/frappe/frappe/modules/utils.py", line 253, in load_doctype_module
    raise ImportError(msg) from e
      doctype = 'S3 Backup Settings'
      module = 'Integrations'
      prefix = ''
      suffix = ''
      app = 'frappe'
      key = ('frappe', 'S3 Backup Settings', '', '')
      module_name = 'frappe.integrations.doctype.s3_backup_settings.s3_backup_settings'
      msg = "Module import failed for S3 Backup Settings, the DocType you're trying to open might be deleted.<br> Error: cannot import name 'Mapping' from 'collections' (/usr/local/Cellar/python@3.10/3.10.14/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)"
builtins.ImportError: Module import failed for S3 Backup Settings, the DocType you're trying to open might be deleted.<br> Error: cannot import name 'Mapping' from 'collections' (/usr/local/Cellar/python@3.10/3.10.14/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)

Try:

bench setup requirements

Also check Apps.txt :page_facing_up: and Apps.json :page_facing_up: in your site folder.