ERROR: Bad Request (HTTP 400) with cinder 1.2.1

Bug #1464160 reported by Valery Tschopp
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
python-cinderclient
Fix Released
Critical
John Griffith

Bug Description

I just installed v1.2.1 of python-cinderclient, and it doesn't work anymore:

<email address hidden>:~/projects/openstack$ cinder list
ERROR: Bad Request (HTTP 400)

The problem is that our cinder-api is behind a proxy (HTTPS terminator), and it somehow breaks the cinder client.
Here is the debug log, where you can see it tries to connect the HTTP endpoint instead of the HTTPS endpoint published in the Keystone catalog:

<email address hidden>:~/projects/openstack$ cinder --debug list
DEBUG:keystoneclient.session:REQ: curl -g -i -X GET https://keystone.cloud.switch.ch:5000/v2.0 -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
DEBUG:keystoneclient.session:RESP: [200] content-length: 628 vary: X-Auth-Token server: nginx connection: keep-alive date: Thu, 11 Jun 2015 08:09:09 GMT content-type: application/json x-distribution: Ubuntu
RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}, {"base": "application/xml", "type": "application/vnd.openstack.identity-v2.0+xml"}], "id": "v2.0", "links": [{"href": "https://keystone.cloud.switch.ch:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/api/openstack-identity-service/2.0/content/", "type": "text/html", "rel": "describedby"}, {"href": "http://docs.openstack.org/api/openstack-identity-service/2.0/identity-dev-guide-2.0.pdf", "type": "application/pdf", "rel": "describedby"}]}}

DEBUG:keystoneclient.auth.identity.v2:Making authentication request to https://keystone.cloud.switch.ch:5000/v2.0/tokens
DEBUG:keystoneclient.session:REQ: curl -g -i -X GET https://api.zhdk.cloud.switch.ch:8776/ -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
DEBUG:keystoneclient.session:RESP: [200] date: Thu, 11 Jun 2015 08:09:10 GMT content-length: 318 content-type: application/json connection: keep-alive server: nginx
RESP BODY: {"versions": [{"status": "CURRENT", "updated": "2012-01-04T11:33:21Z", "id": "v1.0", "links": [{"href": "http://api.zhdk.cloud.switch.ch:8776/v1/", "rel": "self"}]}, {"status": "CURRENT", "updated": "2012-11-21T11:33:21Z", "id": "v2.0", "links": [{"href": "http://api.zhdk.cloud.switch.ch:8776/v2/", "rel": "self"}]}]}

DEBUG:keystoneclient.auth.identity.v2:Making authentication request to https://keystone.cloud.switch.ch:5000/v2.0/tokens
DEBUG:keystoneclient.session:REQ: curl -g -i -X GET https://api.unil.cloud.switch.ch:8776/ -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
DEBUG:keystoneclient.session:RESP: [200] date: Thu, 11 Jun 2015 08:09:10 GMT content-length: 318 content-type: application/json connection: keep-alive server: nginx
RESP BODY: {"versions": [{"status": "CURRENT", "updated": "2012-01-04T11:33:21Z", "id": "v1.0", "links": [{"href": "http://api.unil.cloud.switch.ch:8776/v1/", "rel": "self"}]}, {"status": "CURRENT", "updated": "2012-11-21T11:33:21Z", "id": "v2.0", "links": [{"href": "http://api.unil.cloud.switch.ch:8776/v2/", "rel": "self"}]}]}

DEBUG:keystoneclient.session:REQ: curl -g -i -X GET http://api.unil.cloud.switch.ch:8776/v1/45d76b4b42294e04886dd163dd4f20d8/volumes/detail -H "User-Agent: python-cinderclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}c7f7cdb12f7b6a35cf6906ae4befac7b65297f97"
DEBUG:keystoneclient.session:RESP: [400] date: Thu, 11 Jun 2015 08:09:10 GMT content-length: 264 content-type: text/html connection: close server: nginx
RESP BODY: <html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>
<hr><center>nginx</center>
</body>
</html>

ERROR: Bad Request (HTTP 400)

Revision history for this message
Joe T (joe-topjian-v) wrote :

I'm seeing a similar issue with 1.2.2.

Even though there's an https entry in the catalog, the client is still trying to use http.

Revision history for this message
Mike Perez (thingee) wrote :

The only fix is on the server side with the public_endpoint configuration option.

http://docs.openstack.org/kilo/config-reference/content/cinder-conf-changes-kilo.html

Unfortunately that option has only been available since Kilo, and I don't expect a lot clouds to be up that version yet. The version discovery addition to Cinder client was premature in my opinion.

Changed in python-cinderclient:
assignee: nobody → Mike Perez (thingee)
importance: Undecided → Critical
status: New → In Progress
Changed in python-cinderclient:
assignee: Mike Perez (thingee) → John Griffith (john-griffith)
Changed in python-cinderclient:
status: In Progress → Fix Committed
Mike Perez (thingee)
Changed in python-cinderclient:
status: Fix Committed → Fix Released
Revision history for this message
Eric Harney (eharney) wrote :
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.