Bench Update throwing errors


I had installed a custom app on the server but had later removed it from the apps by using

bench remove-app custom app
bench remove-from-installed-apps custom app

I had also deleted the app from the tabModule Def inside the database. But, whenever I am running a bench update or Bench migrate, I am getting this following error:

Migrating preqp
Executing frappe.patches.v7_2.set_in_standard_filter_property #1 in preqp (bd1043fd48)
Traceback (most recent call last):
File “/usr/lib/python2.7/”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/”, line 72, in _run_code
exec code in run_globals
File “/home/proman/frappe-bench/apps/frappe/frappe/utils/”, line 79, in
File “/home/proman/frappe-bench/apps/frappe/frappe/utils/”, line 16, in main
File “/home/proman/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 664, in call
return self.main(*args, **kwargs)
File “/home/proman/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 644, in main
rv = self.invoke(ctx)
File “/home/proman/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/proman/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/proman/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 837, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/proman/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 464, in invoke
return callback(*args, **kwargs)
File “/home/proman/frappe-bench/apps/frappe/frappe/commands/”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/proman/frappe-bench/apps/frappe/frappe/commands/”, line 209, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/proman/frappe-bench/apps/frappe/frappe/”, line 30, in migrate
File “/home/proman/frappe-bench/apps/frappe/frappe/modules/”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/proman/frappe-bench/apps/frappe/frappe/modules/”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/proman/frappe-bench/apps/frappe/frappe/modules/”, line 83, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/proman/frappe-bench/apps/frappe/frappe/patches/v7_2/”, line 12, in execute
frappe.reload_doctype(, force=True)
File “/home/proman/frappe-bench/apps/frappe/frappe/”, line 644, in reload_doctype
force=force, reset_permissions=reset_permissions)
File “/home/proman/frappe-bench/apps/frappe/frappe/”, line 656, in reload_doc
return frappe.modules.reload_doc(module, dt, dn, force=force, reset_permissions=reset_permissions)
File “/home/proman/frappe-bench/apps/frappe/frappe/modules/”, line 141, in reload_doc
return import_files(module, dt, dn, force=force, reset_permissions=reset_permissions)
File “/home/proman/frappe-bench/apps/frappe/frappe/modules/”, line 19, in import_files
File “/home/proman/frappe-bench/apps/frappe/frappe/modules/”, line 23, in import_file
path = get_file_path(module, dt, dn)
File “/home/proman/frappe-bench/apps/frappe/frappe/modules/”, line 30, in get_file_path
path = os.path.join(get_module_path(module),
File “/home/proman/frappe-bench/apps/frappe/frappe/modules/”, line 133, in get_module_path
return frappe.get_module_path(module)
File “/home/proman/frappe-bench/apps/frappe/frappe/”, line 681, in get_module_path
return get_pymodule_path(local.module_app[module] + “.” + module, *joins)
KeyError: u’epochapp’

Please help


I believe this should fix it [enhance] custom perms, frappe/erpnext#6093 by rmehta · Pull Request #2577 · frappe/frappe · GitHub

Thanks Rushabh. So, should I try running bench update again?


I don’t think this is merged yet, you can manually update the file and migrate!

Thanks for responding so promptly Rushabh. But, I am still not clear with the github and pull things yet. So, can you please let me know which file and which lines? The link is showing many files.

Thanks a ton

Ok pushed the fix, you can now do bench update

Thanks a ton Rushabh. Will try it out and let you know… :slight_smile:

Thanks Rushabh… The bench update went off well… :slight_smile: