3470: Unable to set groups/people on a review request

sour*****@gmai***** (Google Code) (Is this you? Claim this profile.)
July 24, 2014
What version are you running?

2.0.2

What's the URL of the page containing the problem?

https://git.reviewboard.kde.org/r/119175/

What steps will reproduce the problem?
1. Attempt to change the person/groups assigned to a review

What is the expected output? What do you see instead?

Assigned persons/groups are changed.

What operating system are you using? What browser?

Occurs with both Chrome and Firefox, both on Linux.

Please provide any additional information below.

This is a very unusual issue. I recreated the user's submission myself and was unable to reproduce, but when attempting to perform changes to the review they created can reliably reproduce this 100%. It is almost as if their submission has created a broken review request.

Further, they were able to reproduce this behaviour (by creating a second request which is affected by the same issue).

Backtrace is:

Traceback (most recent call last):

  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.5-py2.7.egg/django/core/handlers/base.py", line 199, in get_response
    response = middleware_method(request, response)

  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.5-py2.7.egg/django/middleware/http.py", line 14, in process_response
    response['Content-Length'] = str(len(response.content))

  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8.5-py2.7.egg/djblets/webapi/responses.py", line 109, in _get_content
    **self.encoder_kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8.5-py2.7.egg/djblets/webapi/encoders.py", line 110, in encode
    return super(JSONEncoderAdapter, self).encode(o)

  File "/usr/lib/python2.7/json/encoder.py", line 200, in encode
    chunks = self.iterencode(o, _one_shot=True)

  File "/usr/lib/python2.7/json/encoder.py", line 263, in iterencode
    return _iterencode(o, 0)

  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8.5-py2.7.egg/djblets/webapi/encoders.py", line 118, in default
    **self.encode_kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8.5-py2.7.egg/djblets/webapi/responses.py", line 88, in encode
    result = encoder.encode(*args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8.5-py2.7.egg/djblets/webapi/encoders.py", line 87, in encode
    return serializer.serialize_object(o, *args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8.5-py2.7.egg/djblets/webapi/resources.py", line 986, in serialize_object
    *args, **kwargs),

  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8.5-py2.7.egg/djblets/webapi/resources.py", line 1087, in get_links
    base_href = self.get_href(obj, request, *args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.2-py2.7.egg/reviewboard/webapi/resources/review_request.py", line 1026, in get_href
    self.get_item_url(local_site_name=local_site_name, **href_kwargs))

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.2-py2.7.egg/reviewboard/webapi/base.py", line 123, in get_item_url
    return self._get_resource_url(self.name, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.2-py2.7.egg/reviewboard/webapi/base.py", line 156, in _get_resource_url
    kwargs=kwargs)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.2-py2.7.egg/reviewboard/site/urlresolvers.py", line 38, in local_site_reverse
    *func_args, **func_kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.5-py2.7.egg/django/core/urlresolvers.py", line 532, in reverse
    return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))

  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.5-py2.7.egg/django/core/urlresolvers.py", line 437, in _reverse_with_prefix
    candidate_subs = dict((k, urlquote(v)) for (k, v) in candidate_subs.items())

  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.5-py2.7.egg/django/core/urlresolvers.py", line 437, in <genexpr>
    candidate_subs = dict((k, urlquote(v)) for (k, v) in candidate_subs.items())

  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.5-py2.7.egg/django/utils/functional.py", line 203, in wrapper
    return func(*args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.5-py2.7.egg/django/utils/http.py", line 40, in urlquote
    return force_text(quote(force_str(url), force_str(safe)))

  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.5-py2.7.egg/django/utils/encoding.py", line 157, in force_bytes
    if not isinstance(s, six.string_types):

RuntimeError: maximum recursion depth exceeded while calling a Python object
chipx86
#1 chipx86
That is very unusual, and it's unclear what the problem is.

Can you look in the database entry for this and see if you can find anything unusual about the information for this entry?

Can you also see what user/group is being set?
  • +NeedInfo
#2 sour*****@gmai***** (Google Code) (Is this you? Claim this profile.)
I may have discovered part of the issue. It seems having a pending review request draft which depends on another review request (in this case, #119160) causes it.

I can reproduce this by setting the Depends on field using the number of the review request. The review request draft in question can still be viewed without issue through the administrative backend.

Interestingly, this also displays another bug. If an administrator (or person with appropriate permission) accesses a review request for which a review request draft exists, those changes will not initially be shown. If they attempt to make any changes however, then they will see the content / changes made within that draft.

The appropriate part of the WSGI Request in case it helps:

path:/api/review-requests/119175/draft/,
GET:<QueryDict: {}>,
POST:<QueryDict: {u'depends_on': [u'119160'], u'api_format': [u'json'], u'expand': [u'depends_on,target_people,target_groups']}>,
david
#3 david
This is fixed in djblets (85eb686), which you should get if you upgrade to the latest Review Board 2.0.x
  • -NeedInfo
    +Fixed