Bench Update on development Env

I am trying to update my development environment as following but it is giving error when performing migration kindly help:
bench 4.1.0
erpnext 12.x.x-develop
frappe 12.0.16

Patching sites…
Migrating erpnext12
Traceback (most recent call last):

File “/usr/lib/python3.6/”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/”, line 85, in _run_code
exec(code, run_globals)
File “/home//erpnext12/apps/frappe/frappe/utils/", line 97, in
File "/home/
/erpnext12/apps/frappe/frappe/utils/”, line 18, in main
File “/home//erpnext12/env/lib/python3.6/site-packages/click/", line 764, in call
return self.main(args, kwargs)
File "/home/
/erpnext12/env/lib/python3.6/site-packages/click/", line 717, in main
rv = self.invoke(ctx)
File "/home/
/erpnext12/env/lib/python3.6/site-packages/click/”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home//erpnext12/env/lib/python3.6/site-packages/click/", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/
/erpnext12/env/lib/python3.6/site-packages/click/”, line 956, in invoke
return ctx.invoke(self.callback, ctx.params)
File "/home/
/erpnext12/env/lib/python3.6/site-packages/click/", line 555, in invoke
return callback(args, kwargs)
File "/home/
/erpnext12/env/lib/python3.6/site-packages/click/", line 17, in new_func
return f(get_current_context(), args, kwargs)
File "/home/
/erpnext12/apps/frappe/frappe/commands/", line 25, in _func
ret = f(frappe._dict(ctx.obj), args, kwargs)
File "/home/
/erpnext12/apps/frappe/frappe/commands/", line 233, in migrate
migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip_failing)
File "/home/
/erpnext12/apps/frappe/frappe/", line 40, in migrate
File "/home/
/erpnext12/apps/frappe/frappe/", line 48, in clear_global_cache
File "/home/
/erpnext12/apps/frappe/frappe/website/", line 295, in clear_cache
File "/home/
/erpnext12/apps/frappe/frappe/", line 561, in clear_cache
File "/home/
/erpnext12/apps/frappe/frappe/", line 31, in clear_user_cache
File "/home/
/erpnext12/apps/frappe/frappe/desk/", line 174, in clear_notifications
config = get_notification_config()
File "/home/
/erpnext12/apps/frappe/frappe/desk/", line 237, in get_notification_config
return frappe.cache().get_value(“notification_config”, _get)
File "/home/
/erpnext12/apps/frappe/frappe/utils/", line 79, in get_value
val = generator()
File "/home/
/erpnext12/apps/frappe/frappe/desk/", line 228, in _get
hooks = frappe.get_hooks()
File "/home/
/erpnext12/apps/frappe/frappe/", line 938, in get_hooks
hooks = _dict(load_app_hooks())
File "/home/
/erpnext12/apps/frappe/frappe/", line 929, in load_app_hooks
append_hook(hooks, key, getattr(app_hooks, key))
File "/home/
/erpnext12/apps/frappe/frappe/", line 959, in append_hook
append_hook(target[key], inkey, value[inkey])
File "/home/
**/erpnext12/apps/frappe/frappe/", line 962, in append_hook
target.setdefault(key, [])
AttributeError: ‘list’ object has no attribute ‘setdefault’

My guess is one of these is malformed say from a custom manual change?

frappe@ubuntu:~/frappe-bench$ find . -name

Thank you for replying. I have not changed anything in these hooks manually. It is all happening after I performed bench update. If i restore my last backup before the update everything works fine. Any idea how to fix this issue manually or is it possible that it will get fixed in the next update?

Issue is fixed. There was some issue with the branches
bench 4.1.0
erpnext 12.x.x-develop
frappe 12.0.16 **seems this was causing the issue**

I ran the command bench switch-to-develop && bench update
now everything is working fine.

bench 4.1.0
erpnext 12.x.x-develop
frappe 12.x.x-develop


1 Like