Project

General

Profile

Actions

Bug #5502

open

500 error when using multiple custom branch permissions

Added by Frank Ecsedy over 5 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
High
Assignee:
-
Category:
-
Target version:
Start date:
25.10.2018
Due date:
% Done:

0%

Estimated time:
Sorting:
Commit Number:
Affected Version:

Description

We created 4 branch patterns with priorities 10, 20, 30 and 40. I created a new group that has force push permissions on those branches. When I add a user to the new group and try to view their permissions it is either wrong (no extra permissions show) or it throws a 500. Here is the exception log:

Traceback (most recent call last):
File "/opt/rhodecode/store/mxgf7jxv7p2nw91a4y9c89y8jia712g5-python2.7-pyramid-1.9.2/lib/python2.7/site-packages/pyramid/tweens.py", line 39, in excview_tween
response = handler(request)
File "/opt/rhodecode/store/mxgf7jxv7p2nw91a4y9c89y8jia712g5-python2.7-pyramid-1.9.2/lib/python2.7/site-packages/pyramid/router.py", line 156, in handle_request
view_name
File "/opt/rhodecode/store/mxgf7jxv7p2nw91a4y9c89y8jia712g5-python2.7-pyramid-1.9.2/lib/python2.7/site-packages/pyramid/view.py", line 642, in call_view
response = view_callable(context, request)
File "/opt/rhodecode/store/mxgf7jxv7p2nw91a4y9c89y8jia712g5-python2.7-pyramid-1.9.2/lib/python2.7/site-packages/pyramid/viewderivers.py", line 390, in attr_view
return view(context, request)
File "/opt/rhodecode/store/mxgf7jxv7p2nw91a4y9c89y8jia712g5-python2.7-pyramid-1.9.2/lib/python2.7/site-packages/pyramid/viewderivers.py", line 368, in predicate_wrapper
return view(context, request)
File "/opt/rhodecode/store/mxgf7jxv7p2nw91a4y9c89y8jia712g5-python2.7-pyramid-1.9.2/lib/python2.7/site-packages/pyramid/viewderivers.py", line 462, in rendered_view
request, result, view_inst, context)
File "/opt/rhodecode/store/mxgf7jxv7p2nw91a4y9c89y8jia712g5-python2.7-pyramid-1.9.2/lib/python2.7/site-packages/pyramid/renderers.py", line 435, in render_view
return self.render_to_response(response, system, request=request)
File "/opt/rhodecode/store/mxgf7jxv7p2nw91a4y9c89y8jia712g5-python2.7-pyramid-1.9.2/lib/python2.7/site-packages/pyramid/renderers.py", line 458, in render_to_response
result = self.render(value, system_values, request=request)
File "/opt/rhodecode/store/mxgf7jxv7p2nw91a4y9c89y8jia712g5-python2.7-pyramid-1.9.2/lib/python2.7/site-packages/pyramid/renderers.py", line 454, in render
result = renderer(value, system_values)
File "/opt/rhodecode/store/86qd4x71plpan4xz807ng3g09hcc2l3p-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramid_mako/
init.py", line 156, in __call_
reraise(MakoRenderingException(errtext), None, exc_info[2])
File "/opt/rhodecode/store/86qd4x71plpan4xz807ng3g09hcc2l3p-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramid_mako/init.py", line 148, in call
result = template.render_unicode(*system)
File "/opt/rhodecode/store/ida848f1ziml06glki8mawhi38h2k4fv-python2.7-mako-1.0.7/lib/python2.7/site-packages/mako/template.py", line 471, in render_unicode
as_unicode=True)
File "/opt/rhodecode/store/ida848f1ziml06glki8mawhi38h2k4fv-python2.7-mako-1.0.7/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render
*
kwargs_for_callable(callable, data))
File "/opt/rhodecode/store/ida848f1ziml06glki8mawhi38h2k4fv-python2.7-mako-1.0.7/lib/python2.7/site-packages/mako/runtime.py", line 873, in render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/opt/rhodecode/store/ida848f1ziml06glki8mawhi38h2k4fv-python2.7-mako-1.0.7/lib/python2.7/site-packages/mako/runtime.py", line 899, in _exec_template
callable
(context, *args, **kwargs)
File "base_root_mako", line 99, in render_body
File "_base_base_mako", line 54, in render_body
File "rhodecode_templates_admin_users_user_edit_mako", line 133, in render_main
File "/opt/rhodecode/store/ida848f1ziml06glki8mawhi38h2k4fv-python2.7-mako-1.0.7/lib/python2.7/site-packages/mako/runtime.py", line 761, in _include_file
callable
(ctx, **kwargs)
File "admin_users_user_edit_perms_summary_mako", line 35, in render_body
File "/opt/rhodecode/store/rq6n4kdw9z8d44km9njnr5rxxyh01p4h-python2.7-zope.cachedescriptors-4.3.1/lib/python2.7/site-packages/zope/cachedescriptors/property.py", line 106, in __get
_
value = func(inst)
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 1076, in permissions_full_details
user=self, cache=None, calculate_super_admin=True)
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 1211, in get_perms
calculate_super_admin)
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/lib/rc_cache/utils.py", line 79, in decorate
return self.get_or_create(key, creator, timeout, should_cache_fn)
File "/opt/rhodecode/store/v33y23yxrp8sa4l232vf4i5nmwnclili-python2.7-dogpile.cache-0.6.6/lib/python2.7/site-packages/dogpile/cache/region.py", line 864, in get_or_create
async_creator) as value:
File "/opt/rhodecode/store/v33y23yxrp8sa4l232vf4i5nmwnclili-python2.7-dogpile.cache-0.6.6/lib/python2.7/site-packages/dogpile/lock.py", line 186, in enter
return self._enter()
File "/opt/rhodecode/store/v33y23yxrp8sa4l232vf4i5nmwnclili-python2.7-dogpile.cache-0.6.6/lib/python2.7/site-packages/dogpile/lock.py", line 93, in _enter
generated = self._enter_create(value, createdtime)
File "/opt/rhodecode/store/v33y23yxrp8sa4l232vf4i5nmwnclili-python2.7-dogpile.cache-0.6.6/lib/python2.7/site-packages/dogpile/lock.py", line 179, in _enter_create
return self.creator()
File "/opt/rhodecode/store/v33y23yxrp8sa4l232vf4i5nmwnclili-python2.7-dogpile.cache-0.6.6/lib/python2.7/site-packages/dogpile/cache/region.py", line 831, in gen_value
created_value = creator()
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/lib/rc_cache/utils.py", line 71, in creator
return fn(*arg, **kw)
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 1205, in compute_perm_tree
explicit, algo, calculate_super_admin)
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 320, in _cached_perms_data
return permissions.calculate()
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 450, in calculate
self._calculate_repository_branch_permissions()
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 789, in _calculate_repository_branch_permissions
p = self._choose_permission(p, cur_perm)
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 942, in _choose_permission
cur_perm_val = Permission.PERM_WEIGHTS[cur_perm]
MakoRenderingException:

Traceback (most recent call last):
File "/opt/rhodecode/store/86qd4x71plpan4xz807ng3g09hcc2l3p-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramid_mako/init.py", line 148, in call
result = template.render_unicode(*system)
File "/opt/rhodecode/store/ida848f1ziml06glki8mawhi38h2k4fv-python2.7-mako-1.0.7/lib/python2.7/site-packages/mako/template.py", line 471, in render_unicode
as_unicode=True)
File "/opt/rhodecode/store/ida848f1ziml06glki8mawhi38h2k4fv-python2.7-mako-1.0.7/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render
*
kwargs_for_callable(callable, data))
File "/opt/rhodecode/store/ida848f1ziml06glki8mawhi38h2k4fv-python2.7-mako-1.0.7/lib/python2.7/site-packages/mako/runtime.py", line 873, in render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/opt/rhodecode/store/ida848f1ziml06glki8mawhi38h2k4fv-python2.7-mako-1.0.7/lib/python2.7/site-packages/mako/runtime.py", line 899, in _exec_template
callable
(context, *args, **kwargs)
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/templates/base/root.mako", line 156, in render_body
${next.body()}
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/templates/base/base.mako", line 32, in render_body
${next.main()}
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/templates/admin/users/user_edit.mako", line 53, in render_main
<%include file="/admin/users/user_edit_${c.active}.mako"/>
File "/opt/rhodecode/store/ida848f1ziml06glki8mawhi38h2k4fv-python2.7-mako-1.0.7/lib/python2.7/site-packages/mako/runtime.py", line 761, in include_file
callable
(ctx, **kwargs)
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/templates/admin/users/user_edit_perms_summary.mako", line 3, in render_body
${p.perms_summary(c.perm_user.permissions_full_details, show_all=True, side_link=h.route_path('edit_user_perms_summary_json', user_id=c.user.user_id))}
File "/opt/rhodecode/store/rq6n4kdw9z8d44km9njnr5rxxyh01p4h-python2.7-zope.cachedescriptors-4.3.1/lib/python2.7/site-packages/zope/cachedescriptors/property.py", line 106, in get
value = func(inst)
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 1076, in permissions_full_details
user=self, cache=None, calculate_super_admin=True)
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 1211, in get_perms
calculate_super_admin)
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/lib/rc_cache/utils.py", line 79, in decorate
return self.get_or_create(key, creator, timeout, should_cache_fn)
File "/opt/rhodecode/store/v33y23yxrp8sa4l232vf4i5nmwnclili-python2.7-dogpile.cache-0.6.6/lib/python2.7/site-packages/dogpile/cache/region.py", line 864, in get_or_create
async_creator) as value:
File "/opt/rhodecode/store/v33y23yxrp8sa4l232vf4i5nmwnclili-python2.7-dogpile.cache-0.6.6/lib/python2.7/site-packages/dogpile/lock.py", line 186, in enter
return self._enter()
File "/opt/rhodecode/store/v33y23yxrp8sa4l232vf4i5nmwnclili-python2.7-dogpile.cache-0.6.6/lib/python2.7/site-packages/dogpile/lock.py", line 93, in _enter
generated = self._enter_create(value, createdtime)
File "/opt/rhodecode/store/v33y23yxrp8sa4l232vf4i5nmwnclili-python2.7-dogpile.cache-0.6.6/lib/python2.7/site-packages/dogpile/lock.py", line 179, in _enter_create
return self.creator()
File "/opt/rhodecode/store/v33y23yxrp8sa4l232vf4i5nmwnclili-python2.7-dogpile.cache-0.6.6/lib/python2.7/site-packages/dogpile/cache/region.py", line 831, in gen_value
created_value = creator()
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/lib/rc_cache/utils.py", line 71, in creator
return fn(*arg, **kw)
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 1205, in compute_perm_tree
explicit, algo, calculate_super_admin)
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 320, in _cached_perms_data
return permissions.calculate()
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 450, in calculate
self._calculate_repository_branch_permissions()
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 789, in _calculate_repository_branch_permissions
p = self._choose_permission(p, cur_perm)
File "/opt/rhodecode/store/rn12s997k08lbfzg074fca3x206ng6si-python2.7-rhodecode-enterprise-ce-4.13.3/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 942, in _choose_permission
cur_perm_val = Permission.PERM_WEIGHTS[cur_perm]
TypeError: unhashable type: 'OrderedDict'


Files

permission_tree_patch.diff (11.1 KB) permission_tree_patch.diff Daniel D, 25.10.2018 20:27
Actions

Also available in: Atom PDF