Well I have just discovered that this patch fails on my system after running for 30~45 mins with the below validation error:
Executing frappe.patches.v8_x.update_user_permission in local-rigpl (rigpl)
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/aditya/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 91, in <module>
main()
File "/home/aditya/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 17, in main
click.Group(commands=commands)(prog_name='bench')
File "/home/aditya/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
return self.main(*args, **kwargs)
File "/home/aditya/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/home/aditya/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/aditya/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/aditya/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/aditya/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/home/aditya/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/aditya/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File "/home/aditya/frappe-bench/apps/frappe/frappe/commands/site.py", line 216, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File "/home/aditya/frappe-bench/apps/frappe/frappe/migrate.py", line 31, in migrate
frappe.modules.patch_handler.run_all()
File "/home/aditya/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all
if not run_single(patchmodule = patch):
File "/home/aditya/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File "/home/aditya/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 83, in execute_patch
frappe.get_attr(patchmodule.split()[0] + ".execute")()
File "/home/aditya/frappe-bench/apps/frappe/frappe/patches/v8_x/update_user_permission.py", line 23, in execute
)).insert(ignore_permissions = True)
File "/home/aditya/frappe-bench/apps/frappe/frappe/model/document.py", line 219, in insert
self.run_post_save_methods()
File "/home/aditya/frappe-bench/apps/frappe/frappe/model/document.py", line 790, in run_post_save_methods
self.run_method("on_update")
File "/home/aditya/frappe-bench/apps/frappe/frappe/model/document.py", line 666, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/aditya/frappe-bench/apps/frappe/frappe/model/document.py", line 887, in composer
return composed(self, method, *args, **kwargs)
File "/home/aditya/frappe-bench/apps/frappe/frappe/model/document.py", line 870, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/aditya/frappe-bench/apps/frappe/frappe/model/document.py", line 660, in <lambda>
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/aditya/frappe-bench/apps/frappe/frappe/core/doctype/user_permission/user_permission.py", line 16, in on_update
self.apply_user_permissions_to_all_roles()
File "/home/aditya/frappe-bench/apps/frappe/frappe/core/doctype/user_permission/user_permission.py", line 39, in apply_user_permissions_to_all_roles
'apply_user_permissions', '1')
File "/home/aditya/frappe-bench/apps/frappe/frappe/permissions.py", line 488, in update_permission_property
validate_permissions_for_doctype(doctype)
File "/home/aditya/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 628, in validate_permissions_for_doctype
validate_permissions(doctype, for_remove)
File "/home/aditya/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 740, in validate_permissions
check_double(d)
File "/home/aditya/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 681, in check_double
.format(get_txt(d), similar_because_of))
File "/home/aditya/frappe-bench/apps/frappe/frappe/__init__.py", line 319, in throw
msgprint(msg, raise_exception=exc, title=title, indicator='red')
File "/home/aditya/frappe-bench/apps/frappe/frappe/__init__.py", line 309, in msgprint
_raise_exception()
File "/home/aditya/frappe-bench/apps/frappe/frappe/__init__.py", line 282, in _raise_exception
raise raise_exception(encode(msg))
frappe.exceptions.ValidationError: For System Manager at level 0 in Global Defaults in row 1: Only one rule allowed with the same Role, Level and Apply User Permissions