Keystone needs a URL normalizer middleware

Bug #956954 reported by Rafael Durán Castañeda
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Low
Rafael Durán Castañeda

Bug Description

Hi,

After doing a fresh install from source I'm getting some errors due a trailing slash URL. First request (user) works, second (nova service) raises 404 not found:

POST /v2.0/tokens HTTP/1.1
Host: 10.130.0.14:35357
Content-Length: 108
content-type: application/json
accept-encoding: gzip, deflate
accept: application/json
user-agent: python-novaclient

{"auth": {"tenantName": "admin", "passwordCredentials": {"username": "<email address hidden>", "password": "pass"}}}

POST /v2.0/tokens/ HTTP/1.1
Host: 10.130.0.14:35357
Accept-Encoding: identity
Content-Length: 75
Content-type: application/json
Accept: application/json

{"auth": {"passwordCredentials": {"username": "nova", "password": "pass"}}}

Both requests are triggered after doing: nova --debug image-list

Complete keystone tcpflow: http://pastebin.com/Zk1guczv
Nova result: http://pastebin.com/XbF7EPkh

This would be fixed just getting into master the missing after redux keystone.middleware.url

Revision history for this message
Rafael Durán Castañeda (rafadurancastaneda) wrote :

Related to https://bugs.launchpad.net/keystone/+bug/942485, which is still raising the same error.

Dolph Mathews (dolph)
Changed in keystone:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Rafael Durán Castañeda (rafadurancastaneda) wrote :

I've tested old URL normalizer from stable/diablo branch and works fine on master; running the tests results in 3 tests failing but they are the same indeed, but for 3 different backends (the token expire test); which I think is a known bug. I can add some testing and send a patch if that helps.

Revision history for this message
Dolph Mathews (dolph) wrote :

Testing and patches are always helpful :)

Feel free to assign this to yourself.

Revision history for this message
Rafael Durán Castañeda (rafadurancastaneda) wrote :

Ok I'm going to start working on this, basically the tests since I will reuse old url middleware.

Changed in keystone:
assignee: nobody → Rafael Durán Castañeda (rafadurancastaneda)
Revision history for this message
yong sheng gong (gongysh) wrote :

I run the commands many times, and cannot find the trailing trash.

[root@robinlinux eclipse]# nova --debug image-list
connect: (localhost, 35357)
connect fail: ('localhost', 35357)
connect: (localhost, 35357)
send: 'POST /v2.0/tokens HTTP/1.1\r\nHost: localhost:35357\r\nContent-Length: 103\r\ncontent-type: application/json\r\naccept-encoding: gzip, deflate\r\naccept: application/json\r\nuser-agent: python-novaclient\r\n\r\n'
send: '{"auth": {"tenantName": "admin", "passwordCredentials": {"username": "admin", "password": "password"}}}'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Type: application/json
header: Vary: X-Auth-Token
header: Content-Length: 1966
header: Date: Sun, 18 Mar 2012 02:55:16 GMT
connect: (localhost, 8774)
connect fail: (u'localhost', 8774)
connect: (localhost, 8774)
send: u'GET /v1.1/19fe0f48d5124d208b3e78824481f777/images/detail HTTP/1.1\r\nHost: localhost:8774\r\nx-auth-project-id: admin\r\nx-auth-token: e0d731f71e9d465d8d9bd5b75f1a1142\r\naccept-encoding: gzip, deflate\r\naccept: application/json\r\nuser-agent: python-novaclient\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: X-Compute-Request-Id: req-0ed66a53-ffd9-4ec3-bdc3-d686e5b0bf40
header: Content-Type: application/json
header: Content-Length: 2139
header: Date: Sun, 18 Mar 2012 02:55:17 GMT
+--------------------------------------+----------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+----------------+--------+--------+
| 1fe612e2-6816-4272-a41f-6e365c78d0fc | cirros | ACTIVE | |
| c093bb14-c0c7-4561-a554-3d5bdd737cd7 | cirros-ramdisk | ACTIVE | |
| f8925389-0140-45a9-8351-208be71ea748 | cirros-kernel | ACTIVE | |
+--------------------------------------+----------------+--------+--------+

Revision history for this message
Rafael Durán Castañeda (rafadurancastaneda) wrote :

The trailing slash was added when nova authenticated itself, so the nova output doesn't show it. However the output show its working for you, what versions are you using for nova-api and keystone?

Anyway I still think the url normalizer is needed and the patch is ready https://github.com/rafaduran/keystone/compare/bug/956954; however I think I won't submit it until next Keystone meeting, so it can be discussed further.

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

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

Changed in keystone:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Changed in keystone:
assignee: Rafael Durán Castañeda (rafadurancastaneda) → Joseph Heck (heckj)
Revision history for this message
Rafael Durán Castañeda (rafadurancastaneda) wrote :

There is a new +1 patch that still needs someone review it.

Changed in keystone:
assignee: Joseph Heck (heckj) → Rafael Durán Castañeda (rafadurancastaneda)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/6425
Committed: http://github.com/openstack/keystone/commit/05d6150fe9e1000e7293045272f0e3e2e7754bf4
Submitter: Jenkins
Branch: master

commit 05d6150fe9e1000e7293045272f0e3e2e7754bf4
Author: Rafael Durán Castañeda <email address hidden>
Date: Mon Mar 19 01:44:31 2012 +0100

    Added 'NormalizingFilter' middleware.

    Fixes bug 956954.

    Change-Id: Ib5995a01439e564fcb27682976e8e27c8bb7d0d1

Changed in keystone:
status: In Progress → Fix Committed
Joseph Heck (heckj)
Changed in keystone:
milestone: none → folsom-1
Thierry Carrez (ttx)
Changed in keystone:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: folsom-1 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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