Status-line of HTTP responce is wrong

Bug #1496055 reported by Marian Horban
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Ivan Kolodyazhny
OpenStack Compute (nova)
Fix Released
Low
Marian Horban

Bug Description

Some negative tempest test cases fail when nova is ran by Apache(NOVA_USE_MOD_WSGI=True).
For example:
2015-09-08 09:30:29.696 | tempest.api.compute.admin.test_hosts_negative.HostsAdminNegativeTestJSON.test_update_host_with_invalid_maintenance_mode[id-ab1e230e-5e22-41a9-8699-82b9947915d4,negative]
2015-09-08 09:30:29.697 | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2015-09-08 09:30:29.697 |
2015-09-08 09:30:29.697 | Captured traceback:
2015-09-08 09:30:29.697 | ~~~~~~~~~~~~~~~~~~~
2015-09-08 09:30:29.697 | Traceback (most recent call last):
2015-09-08 09:30:29.697 | File "tempest/api/compute/admin/test_hosts_negative.py", line 95, in test_update_host_with_invalid_maintenance_mode
2015-09-08 09:30:29.697 | maintenance_mode='invalid')
2015-09-08 09:30:29.697 | File "/opt/stack/new/tempest/.tox/full/local/lib/python2.7/site-packages/testtools/testcase.py", line 422, in assertRaises
2015-09-08 09:30:29.697 | self.assertThat(our_callable, matcher)
2015-09-08 09:30:29.697 | File "/opt/stack/new/tempest/.tox/full/local/lib/python2.7/site-packages/testtools/testcase.py", line 433, in assertThat
2015-09-08 09:30:29.698 | mismatch_error = self._matchHelper(matchee, matcher, message, verbose)
2015-09-08 09:30:29.698 | File "/opt/stack/new/tempest/.tox/full/local/lib/python2.7/site-packages/testtools/testcase.py", line 483, in _matchHelper
2015-09-08 09:30:29.698 | mismatch = matcher.match(matchee)
2015-09-08 09:30:29.698 | File "/opt/stack/new/tempest/.tox/full/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 108, in match
2015-09-08 09:30:29.698 | mismatch = self.exception_matcher.match(exc_info)
2015-09-08 09:30:29.698 | File "/opt/stack/new/tempest/.tox/full/local/lib/python2.7/site-packages/testtools/matchers/_higherorder.py", line 62, in match
2015-09-08 09:30:29.698 | mismatch = matcher.match(matchee)
2015-09-08 09:30:29.698 | File "/opt/stack/new/tempest/.tox/full/local/lib/python2.7/site-packages/testtools/testcase.py", line 414, in match
2015-09-08 09:30:29.698 | reraise(*matchee)
2015-09-08 09:30:29.698 | File "/opt/stack/new/tempest/.tox/full/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 101, in match
2015-09-08 09:30:29.698 | result = matchee()
2015-09-08 09:30:29.698 | File "/opt/stack/new/tempest/.tox/full/local/lib/python2.7/site-packages/testtools/testcase.py", line 969, in __call__
2015-09-08 09:30:29.699 | return self._callable_object(*self._args, **self._kwargs)
2015-09-08 09:30:29.699 | File "tempest/services/compute/json/hosts_client.py", line 54, in update_host
2015-09-08 09:30:29.699 | resp, body = self.put("os-hosts/%s" % hostname, request_body)
2015-09-08 09:30:29.699 | File "/opt/stack/new/tempest/.tox/full/local/lib/python2.7/site-packages/tempest_lib/common/rest_client.py", line 319, in put
2015-09-08 09:30:29.699 | return self.request('PUT', url, extra_headers, headers, body)
2015-09-08 09:30:29.699 | File "/opt/stack/new/tempest/.tox/full/local/lib/python2.7/site-packages/tempest_lib/common/rest_client.py", line 643, in request
2015-09-08 09:30:29.699 | resp, resp_body)
2015-09-08 09:30:29.699 | File "/opt/stack/new/tempest/.tox/full/local/lib/python2.7/site-packages/tempest_lib/common/rest_client.py", line 680, in _error_checker
2015-09-08 09:30:29.699 | raise exceptions.UnexpectedContentType(str(resp.status))
2015-09-08 09:30:29.699 | tempest_lib.exceptions.UnexpectedContentType: Unexpected content type provided
2015-09-08 09:30:29.699 | Details: 500

Root cause of this - nova doesn't attach textual phrase after error code in status line of HTTP response.
But there is a strict rule about constructing status line for HTTP:
'...Status-Line, consisting of the protocol version followed by a numeric status code and its associated textual phrase, with each element separated by SP characters' (http://www.faqs.org/rfcs/rfc2616.html)

Revision history for this message
Marian Horban (mhorban) wrote :
affects: ceilometer → nova-project
Changed in nova-project:
assignee: nobody → Marian Horban (mhorban)
Julien Danjou (jdanjou)
affects: nova-project → nova
Changed in nova:
importance: Undecided → Low
status: New → In Progress
Ivan Kolodyazhny (e0ne)
Changed in cinder:
assignee: nobody → Ivan Kolodyazhny (e0ne)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/231438

Changed in cinder:
status: New → In Progress
Changed in nova:
assignee: Marian Horban (mhorban) → Jay Pipes (jaypipes)
Jay Pipes (jaypipes)
Changed in nova:
assignee: Jay Pipes (jaypipes) → Marian Horban (mhorban)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/231438
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=17802086f6c4ac846cdf5d9bfe8d4eb4908cc8ff
Submitter: Jenkins
Branch: master

commit 17802086f6c4ac846cdf5d9bfe8d4eb4908cc8ff
Author: Ivan Kolodyazhny <email address hidden>
Date: Tue Oct 6 14:52:53 2015 +0300

    Fix Status-Line in HTTP response

    There is a strict rule about constructing status line for HTTP:
    '...Status-Line, consisting of the protocol version followed by a
    numeric status code and its associated textual phrase, with each
    element separated by SP characters'
    (http://www.faqs.org/rfcs/rfc2616.html)

    This patch coerces filling associated textual phrase.

    Also removed unused code from cinder/tests/unit/test_exception.py

    Change-Id: Ia9099fb5020cee02bfee2cd0e8e111845918c36c
    Closes-Bug: #1496055
    Co-Authored-By: Marian Horban <email address hidden>

Changed in cinder:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/223235
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=dbda82afd8ac0ae4373ea35d990e124bbac91eef
Submitter: Jenkins
Branch: master

commit dbda82afd8ac0ae4373ea35d990e124bbac91eef
Author: Marian Horban <email address hidden>
Date: Mon Sep 14 13:43:36 2015 -0400

    Fix Status-Line in HTTP response

    There is a strict rule about constructing status line for HTTP:
    '...Status-Line, consisting of the protocol version followed by a
    numeric status code and its associated textual phrase, with each
    element separated by SP characters'
    (http://www.faqs.org/rfcs/rfc2616.html)

    This patch ensures an associated textual phrase for a status code
    is always written in the HTTP response.

    Closes-Bug: #1496055
    Change-Id: I68d4c41d0c04871eb032d23d7b16aa2bf2c0bb73

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/nova 13.0.0.0b1

This issue was fixed in the openstack/nova 13.0.0.0b1 development milestone.

Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/cinder 8.0.0.0b1

This issue was fixed in the openstack/cinder 8.0.0.0b1 development milestone.

Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Changed in nova:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.