nova-api commands fail when running behind httpd

Bug #1643511 reported by Alfredo Moralejo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Juan Antonio Osorio Robles
tripleo
Fix Released
Critical
Unassigned

Bug Description

After https://review.openstack.org/#/c/333212 when running some openstack nova commands we are getting errors like [1]:

Execution of '/usr/bin/openstack flavor create --format shell m1.micro --public --id 84 --ram 128 --disk 0 --vcpus 1' returned 1: Unknown Error (HTTP 500)

Following error is found in apache logs:

[Sat Nov 19 10:39:12.366389 2016] [:error] [pid 21326] [remote ::1:80] mod_wsgi (pid=21326): Exception occurred processing WSGI script '/var/www/cgi-bin/nova/nova-api'.
[Sat Nov 19 10:39:12.366458 2016] [:error] [pid 21326] [remote ::1:80] TypeError: expected byte string object for header value, value of type unicode found

We are hitting this bug both in puppet-openstack-integration and tripleo jobs.

[1] https://ci.centos.org/artifacts/rdo/weirdo-master-promote-puppet-openstack-scenario003/689/weirdo-project/puppet.txt.gz
[2] https://ci.centos.org/artifacts/rdo/weirdo-master-promote-puppet-openstack-scenario003/689/weirdo-project/logs/apache/nova_api_wsgi_error_ssl.txt.gz

Changed in tripleo:
milestone: none → ocata-2
Revision history for this message
Juan Antonio Osorio Robles (juan-osorio-robles) wrote :

this is because mod_wsgi expects a bytes string in python2.X https://github.com/GrahamDumpleton/mod_wsgi/blob/develop/src/server/wsgi_convert.c#L27 ; it, however, accepts unicode when using python 3.X.

So if we want nova to work with mod_wsgi, it should take that into account.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
assignee: nobody → Juan Antonio Osorio Robles (juan-osorio-robles)
status: New → In Progress
Changed in tripleo:
importance: Undecided → Critical
milestone: ocata-2 → none
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Juan Antonio Osorio Robles (<email address hidden>) on branch: master
Review: https://review.openstack.org/400193
Reason: Attempting to fix it here https://review.openstack.org/#/c/400336/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit 11d8dde452b3ce52f77a637e1d6c98080bbd7fa2
Author: Juan Antonio Osorio Robles <email address hidden>
Date: Mon Nov 21 18:43:21 2016 +0200

    Use byte string or utf8 depending on python version for wsgi

    A recent change to the wsgi code broke deployments running over
    httpd/mod_wsgi. This is because for py2.X mod_wsgi accepts byte
    strings and breaks with utf8. However, for py3.X, utf8 is
    accepted. So this acts accordingly.

    Change-Id: I81739bc3de9d623b718987b5fc18eaf851533902
    Closes-Bug: #1643511

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/400664

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (stable/newton)

Change abandoned by Lee Yarwood (<email address hidden>) on branch: stable/newton
Review: https://review.openstack.org/400664

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 15.0.0.0b2

This issue was fixed in the openstack/nova 15.0.0.0b2 development milestone.

Revision history for this message
Michele Baldessari (michele) wrote :

Setting Fix released for the tripleo component as well since https://review.openstack.org/#/c/400336/ merged

Changed in tripleo:
status: Confirmed → 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.