Project

General

Profile

Bug #5652

Pull Requests: when title and descriptions contains character [] {} and () index out of bound when attempting to comment/approve.

Added by Yechen Qiao 10 months ago. Updated 7 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
01.02.2021
Due date:
% Done:

0%

Estimated time:
Sorting:
Commit Number:
Affected Version:

Description

This happens when attempting to approve such a pull request. (500 internal service error, cannot continue) Apparently it is because an un-escaped character caught in the code somewhere writing an email from email template?

2021-02-01 09:34:32.287 [11824] ERROR [rhodecode.lib.partial_renderer]
Traceback (most recent call last):
File "/opt/rhodecode/store/5vmp7ipy3w2m4qii4fymlz8amzc9xd3k-python2.7-rhodecode-enterprise-ce-4.23.2/lib/python2.7/site-packages/rhodecode/lib/partial_renderer.py", line 79, in render_with_exc
return render_func.render(*args, **kwargs)
File "/opt/rhodecode/store/9g17akjjvw6s5yv8nnhpv5s9nk06hbjq-python2.7-mako-1.1.0/lib/python2.7/site-packages/mako/template.py", line 476, in render
return runtime._render(self, self.callable
, args, data)
File "/opt/rhodecode/store/9g17akjjvw6s5yv8nnhpv5s9nk06hbjq-python2.7-mako-1.1.0/lib/python2.7/site-packages/mako/runtime.py", line 883, in render
**_kwargs_for_callable(callable
, data)
File "/opt/rhodecode/store/9g17akjjvw6s5yv8nnhpv5s9nk06hbjq-python2.7-mako-1.1.0/lib/python2.7/site-packages/mako/runtime.py", line 924, in render_context
_exec_template(callable
, context, args=args, kwargs=kwargs)
File "/opt/rhodecode/store/9g17akjjvw6s5yv8nnhpv5s9nk06hbjq-python2.7-mako-1.1.0/lib/python2.7/site-packages/mako/runtime.py", line 947, in exec_template
callable
(context, args, **kwargs)
File "/opt/rhodecode/store/5vmp7ipy3w2m4qii4fymlz8amzc9xd3k-python2.7-rhodecode-enterprise-ce-4.23.2/lib/python2.7/site-packages/rhodecode/templates/email_templates/pull_request_comment.mako", line 35, in render_subject
${subject_template.format(
data) |n}
IndexError: tuple index out of range
2021-02-01 09:34:32.288 [11824] ERROR [rhodecode.config.middleware] error occurred handling this request for path: /internalproducts/sapiofoundations/sapiofoundations-serverside/pull-request/949/comment
Traceback (most recent call last):
File "/opt/rhodecode/store/da2il1f83gci4333j0sd256nji9nlhpa-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/tweens.py", line 41, in excview_tween
response = handler(request)
File "/opt/rhodecode/store/da2il1f83gci4333j0sd256nji9nlhpa-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/router.py", line 148, in handle_request
registry, request, context, context_iface, view_name
File "/opt/rhodecode/store/da2il1f83gci4333j0sd256nji9nlhpa-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/view.py", line 667, in _call_view
response = view_callable(context, request)
File "/opt/rhodecode/store/da2il1f83gci4333j0sd256nji9nlhpa-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/config/views.py", line 188, in attr_view
return view(context, request)
File "/opt/rhodecode/store/da2il1f83gci4333j0sd256nji9nlhpa-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/config/views.py", line 214, in predicate_wrapper
return view(context, request)
File "/opt/rhodecode/store/da2il1f83gci4333j0sd256nji9nlhpa-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 436, in rendered_view
result = view(context, request)
File "/opt/rhodecode/store/da2il1f83gci4333j0sd256nji9nlhpa-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 132, in _class_view
response = getattr(inst, attr)()
File "/opt/rhodecode/store/5vmp7ipy3w2m4qii4fymlz8amzc9xd3k-python2.7-rhodecode-enterprise-ce-4.23.2/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 2507, in local_wrapper
return wrapper(func, *args, **kwds)
File "/opt/rhodecode/store/5vmp7ipy3w2m4qii4fymlz8amzc9xd3k-python2.7-rhodecode-enterprise-ce-4.23.2/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 1823, in __wrapper
return func(*fargs, **fkwargs)
File "/opt/rhodecode/store/5vmp7ipy3w2m4qii4fymlz8amzc9xd3k-python2.7-rhodecode-enterprise-ce-4.23.2/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 2507, in local_wrapper
return wrapper(func, *args, **kwds)
File "/opt/rhodecode/store/5vmp7ipy3w2m4qii4fymlz8amzc9xd3k-python2.7-rhodecode-enterprise-ce-4.23.2/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 1867, in __wrapper
return func(*fargs, **fkwargs)
File "/opt/rhodecode/store/5vmp7ipy3w2m4qii4fymlz8amzc9xd3k-python2.7-rhodecode-enterprise-ce-4.23.2/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 2507, in local_wrapper
return wrapper(func, *args, **kwds)
File "/opt/rhodecode/store/5vmp7ipy3w2m4qii4fymlz8amzc9xd3k-python2.7-rhodecode-enterprise-ce-4.23.2/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 1897, in __wrapper
return func(*fargs, **fkwargs)
File "/opt/rhodecode/store/5vmp7ipy3w2m4qii4fymlz8amzc9xd3k-python2.7-rhodecode-enterprise-ce-4.23.2/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 2507, in local_wrapper
return wrapper(func, *args, **kwds)
File "/opt/rhodecode/store/5vmp7ipy3w2m4qii4fymlz8amzc9xd3k-python2.7-rhodecode-enterprise-ce-4.23.2/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 1716, in __wrapper
return func(*fargs, **fkwargs)
File "/opt/rhodecode/store/5vmp7ipy3w2m4qii4fymlz8amzc9xd3k-python2.7-rhodecode-enterprise-ce-4.23.2/lib/python2.7/site-packages/rhodecode/apps/repository/views/repo_pull_requests.py", line 1750, in pull_request_comment_create
data = self._pull_request_comments_create(pull_request, [comment_data])
File "/opt/rhodecode/store/5vmp7ipy3w2m4qii4fymlz8amzc9xd3k-python2.7-rhodecode-enterprise-ce-4.23.2/lib/python2.7/site-packages/rhodecode/apps/repository/views/repo_pull_requests.py", line 1644, in _pull_request_comments_create
send_email=not is_draft, # skip notification for draft comments
File "/opt/rhodecode/store/5vmp7ipy3w2m4qii4fymlz8amzc9xd3k-python2.7-rhodecode-enterprise-ce-4.23.2/lib/python2.7/site-packages/rhodecode/model/comment.py", line 481, in create
email_kwargs=kwargs,
File "/opt/rhodecode/store/5vmp7ipy3w2m4qii4fymlz8amzc9xd3k-python2.7-rhodecode-enterprise-ce-4.23.2/lib/python2.7/site-packages/rhodecode/model/notification.py", line 123, in create
EmailNotificationModel().render_email(notification_type, **email_kwargs)
File "/opt/rhodecode/store/5vmp7ipy3w2m4qii4fymlz8amzc9xd3k-python2.7-rhodecode-enterprise-ce-4.23.2/lib/python2.7/site-packages/rhodecode/model/notification.py", line 432, in render_email
subject = email_template.render('subject', *
kwargs)
File "/opt/rhodecode/store/5vmp7ipy3w2m4qii4fymlz8amzc9xd3k-python2.7-rhodecode-enterprise-ce-4.23.2/lib/python2.7/site-packages/rhodecode/lib/partial_renderer.py", line 95, in render
return self._render_with_exc(tmpl, args, kwargs)
File "/opt/rhodecode/store/5vmp7ipy3w2m4qii4fymlz8amzc9xd3k-python2.7-rhodecode-enterprise-ce-4.23.2/lib/python2.7/site-packages/rhodecode/lib/partial_renderer.py", line 79, in _render_with_exc
return render_func.render(*args, **kwargs)
File "/opt/rhodecode/store/9g17akjjvw6s5yv8nnhpv5s9nk06hbjq-python2.7-mako-1.1.0/lib/python2.7/site-packages/mako/template.py", line 476, in render
return runtime._render(self, self.callable
, args, data)
File "/opt/rhodecode/store/9g17akjjvw6s5yv8nnhpv5s9nk06hbjq-python2.7-mako-1.1.0/lib/python2.7/site-packages/mako/runtime.py", line 883, in render
**_kwargs_for_callable(callable
, data)
File "/opt/rhodecode/store/9g17akjjvw6s5yv8nnhpv5s9nk06hbjq-python2.7-mako-1.1.0/lib/python2.7/site-packages/mako/runtime.py", line 924, in render_context
_exec_template(callable
, context, args=args, kwargs=kwargs)
File "/opt/rhodecode/store/9g17akjjvw6s5yv8nnhpv5s9nk06hbjq-python2.7-mako-1.1.0/lib/python2.7/site-packages/mako/runtime.py", line 947, in exec_template
callable
(context, *args, **kwargs)
File "rhodecode_templates_email_templates_pull_request_comment_mako", line 240, in render_subject
IndexError: tuple index out of range
2021-02-01 09:34:32.344 [11824] INFO [rhodecode.lib.middleware.request_wrapper] Req[ 1] POST Request to /internalproducts/sapiofoundations/sapiofoundations-serverside/pull-request/949/comment time: 0.4481s [Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36], RhodeCode 4.23.2

Also available in: Atom PDF