2280: API: failure to update review request: AttributeError: 'NoneType' object has no attribute 'startswith'

robert.********@gmai***** (Google Code) (Is this you? Claim this profile.)
Sept. 12, 2011
What version are you running?

1.6.1

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

http://server/reviewboard/api/review-requests/930/

What steps will reproduce the problem?
1. Post an update to the mentioned URL to change the status to 'submitted'.
2. An HTML page is returned (problem #1) and then the operation fails (problem #2)

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

I would expect the operation to succeed and return a JSON reponses. Instead, it fails and returns a HTML page. I am not sure if this worked with 1.6.0, but it did work just fine with 1.5.x .

Please find the error email below

Traceback (most recent call last):

  File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/views/decorators/cache.py", line 79, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)

  File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/views/decorators/vary.py", line 22, in inner_func
    response = func(*args, **kwargs)

  File "/usr/local/lib/python2.6/site-packages/Djblets-0.6.11-py2.6.egg/djblets/webapi/resources.py", line 321, in __call__
    request._load_post_and_files()

  File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/http/__init__.py", line 270, in _load_post_and_files
    if self.META.get('CONTENT_TYPE', '').startswith('multipart'):

AttributeError: 'NoneType' object has no attribute 'startswith'

<ModPythonRequest
path:/reviewboard/api/review-requests/930/,
GET:<QueryDict: {}>,
POST:<could not parse>,
COOKIES:{'rbsessionid': 'c09025ef7ebf4ad73b6a2b4916cf0868'},
META:{'AUTH_TYPE': None,
 'CONTENT_LENGTH': '16',
 'CONTENT_TYPE': None,
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_CONTENT_LENGTH': '16',
 'HTTP_COOKIE': '$Version=0; rbsessionid=c09025ef7ebf4ad73b6a2b4916cf0868; $Path=/reviewboard/',
 'HTTP_HOST': '192.168.90.72',
 'HTTP_USER_AGENT': 'Mylyn/3.6.0 eReviewBoard Eclipse/3.7.0 (org.eclipse.epp.package.jee.product) HttpClient/3.1 Java/1.6.0_26 (Sun) Linux/2.6.37.6-0.5-desktop (amd64; en_US)',
 'PATH_INFO': u'/reviewboard/api/review-requests/930/',
 'PATH_TRANSLATED': None,
 'QUERY_STRING': '',
 'REMOTE_ADDR': '192.168.58.31',
 'REMOTE_HOST': None,
 'REMOTE_IDENT': None,
 'REMOTE_USER': None,
 'REQUEST_METHOD': 'POST',
 'SCRIPT_NAME': '',
 'SERVER_NAME': 'dev.site',
 'SERVER_PORT': 80,
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'mod_python'}>

What operating system are you using? What browser?

RB is hosted on Linux SLES 11 , x86.
Please provide any additional information below.
chipx86
#1 chipx86
Are you posting with a custom script? It looks like you're missing a Content-Type header. These are required for all PUT/POST in HTTP.

If it worked with 1.5.x, it was just masking a bug. This check is done in Django, and beyond our control, but the HTTP spec does say that it's needed for PUT/POST.
  • +NeedInfo
  • -Type-Defect
    +Type-Support
#2 robert.********@gmai***** (Google Code) (Is this you? Claim this profile.)
I am posting using the ereviewboard plugin for Eclipse. After setting
the 'Content-Type' header updating works just fine, so you can close
this.
chipx86
#3 chipx86
  • -NeedInfo
    +NotABug