4850: AttributeError: 'User' object has no attribute 'user'

Misery
chipx86
chipx86

What version are you running?

3.0.15

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

/api/review-requests/40351/reviews/111393/general-comments/

What steps will reproduce the problem?

  1. Add a comment or issue to review request
  2. Be fast enough to click (with a script or so) another button or send another issue

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

Expected: All requests works

See: Stacktrace

What operating system are you using? What browser?

Firefox, Linux

Please provide any additional information below.

Traceback (most recent call last):

File "/opt/reviewboard/dist/lib/python2.7/site-packages/django/core/handlers/base.py", line 112, in get_response
response = wrapped_callback(request, callback_args, *callback_kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/django/views/decorators/cache.py", line 52, in _wrapped_view_func
response = view_func(request, args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/django/views/decorators/vary.py", line 19, in inner_func
response = func(args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/webapi/resources/base.py", line 244, in call
request, method, view, api_format=api_format, args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/reviewboard/webapi/base.py", line 338, in call_method_view
request, method, view, args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/webapi/resources/mixins/api_tokens.py", line 66, in call_method_view
request, method, view, args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/webapi/resources/mixins/oauth2_tokens.py", line 102, in call_method_view
request, method, view, args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/webapi/resources/base.py", line 369, in call_method_view
return view(request, args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/webapi/resources/base.py", line 470, in post
return self.create(args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/webapi/decorators.py", line 125, in _call
return view_func(args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/reviewboard/webapi/decorators.py", line 169, in _check
return view_func(args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/webapi/decorators.py", line 125, in _call
return view_func(args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/webapi/decorators.py", line 146, in _checklogin
return view_func(args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/webapi/decorators.py", line 125, in _call
return view_func(args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/webapi/decorators.py", line 125, in _call
return view_func(args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/webapi/decorators.py", line 311, in _validate
return view_func(args, *new_kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/reviewboard/webapi/resources/review_general_comment.py", line 57, in create
return self.get_no_access_error(request.user)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/webapi/resources/base.py", line 1232, in get_no_access_error
if request.user.is_authenticated():

File "/opt/reviewboard/dist/lib/python2.7/site-packages/django/utils/functional.py", line 214, in inner
return func(self._wrapped, *args)

AttributeError: 'User' object has no attribute 'user'

<WSGIRequest
path:/api/review-requests/40351/reviews/111393/general-comments/,
GET:<QueryDict: {}>,
POST:<QueryDict: {u'issue_opened': [u'true'], u'text_type': [u'markdown'], u'include_text_types': [u'html,raw,markdown'], u'extra_data.require_verification': [u'false'], u'api_format': [u'json'], u'text': [u'EXAMPLE']}>,
COOKIES:{'collapsediffs': 'True',
'csrftoken': 'b',
'rbsessionid': 'a'},
META:{'CONTENT_LENGTH': '146',
'CONTENT_TYPE': 'application/x-www-form-urlencoded',
'DOCUMENT_ROOT': '/var/lib/nginx/html',
'HTTPS': 'on',
'HTTP_ACCEPT': 'application/json, text/javascript, /; q=0.01',
'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br',
'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.9,de;q=0.8',
'HTTP_CONTENT_LENGTH': '146',
'HTTP_CONTENT_TYPE': 'application/x-www-form-urlencoded',
'HTTP_COOKIE': 'collapsediffs=True; csrftoken=X; rbsessionid=X',
'HTTP_HOST': 'rb.X.de',
'HTTP_ORIGIN': 'https://rb.X.de',
'HTTP_REFERER': 'https://rb.X.de/r/40351/',
'HTTP_SEC_FETCH_MODE': 'cors',
'HTTP_SEC_FETCH_SITE': 'same-origin',
'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36',
'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
u'LOCAL_SITE': None,
'PATH_INFO': u'/api/review-requests/40351/reviews/111393/general-comments/',
'QUERY_STRING': '',
'REMOTE_ADDR': '10.211.4.94',
'REMOTE_PORT': '53186',
'REQUEST_METHOD': 'POST',
'REQUEST_SCHEME': 'https',
'REQUEST_URI': '/api/review-requests/40351/reviews/111393/general-comments/',
u'SCRIPT_NAME': u'',
'SERVER_NAME': 'rb.X.de',
'SERVER_PORT': '443',
'SERVER_PROTOCOL': 'HTTP/2.0',
u'USERNAME': u'XYZ',
u'USER_EMAIL': u'XYZ',
'uwsgi.node': 'vpi-rb',
'uwsgi.version': '2.0.18',
'wsgi.errors': <open file 'wsgi_errors', mode 'w' at 0x7f2b36c20db0>,
'wsgi.file_wrapper': <built-in function uwsgi_sendfile>,
'wsgi.input': <uwsgi._Input object at 0x7f2b32e93378>,
'wsgi.multiprocess': True,
'wsgi.multithread': False,
'wsgi.run_once': False,
'wsgi.url_scheme': u'https',
'wsgi.version': (1, 0)}>

david
#1 david
  • +EasyFix
chipx86
#2 chipx86
  • -New
    +PendingReview
  • +Release-3.0.x
  • +Component:API
  • +chipx86
david
#3 david

Fixed in 3.0.18

  • -PendingReview
    +Fixed