Lookup does not fallback on 401

Bug #1612696 reported by Lucas Alvares Gomes
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ironic-python-agent
Fix Released
Critical
Lucas Alvares Gomes

Bug Description

Newer versions of IPA (> Mitaka) uses the new endpoints v1/lookup and v1/heartbeat of the ironic api instead of the vendor passthru ones by default. It's suppose to fallback to the old endpoints when there's an error but, currently the code is only looking for a 404 error to be returned.

In some cases a 401 will be returned instead a 404 because Ironic will check the policies before routing the request. We should also fallback on that error code.

[0] https://github.com/openstack/ironic-python-agent/blob/87b2b82478fafe521efb6881dab0a278bbc60d72/ironic_python_agent/ironic_api_client.py#L125

Logs:

2016-08-12 14:25:09.250 35 INFO keystonemiddleware.auth_token [-] Rejecting request
2016-08-12 14:25:09.251 35 INFO ironic_api [-] 10.237.223.28 "GET /v1/lookup?addresses=90%3Ae2%3Aba%3A5c%3Aad%3A61%2C90%3Ae2%3Aba%3A5e%3Aa5%3A90%2C90%3Ae2%3Aba%3A5e%3Aa5%3A91%2C00%3A1e%3A67%3A89%3A9b%3Ab1%2C00%3A1e%3A67%3A89%3A9b%3Ab2%2C90%3Ae2%3Aba%3A5c%3Aad%3A60%2C00%3A1e%3A67%3A89%3A9b%3Ab3%2C00%3A1e%3A67%3A89%3A9b%3Ab4 HTTP/1.1" status: 401 len: 233 time: 0.0010359

Changed in ironic-python-agent:
importance: Undecided → Critical
assignee: nobody → Lucas Alvares Gomes (lucasagomes)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic-python-agent (master)

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

Changed in ironic-python-agent:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic-python-agent (master)

Reviewed: https://review.openstack.org/354802
Committed: https://git.openstack.org/cgit/openstack/ironic-python-agent/commit/?id=09d5d0c37711219dcbc6e5c63677668776a6f7b3
Submitter: Jenkins
Branch: master

commit 09d5d0c37711219dcbc6e5c63677668776a6f7b3
Author: Lucas Alvares Gomes <email address hidden>
Date: Fri Aug 12 16:37:57 2016 +0100

    Fallback to the old /lookup endpoint on 401

    Prior to this patch the ironic-python-agent service would only fallback
    to use the old endpoints for /lookup and /heartbeat on a 404 error but,
    since Ironic will check auth (if enabled) before it routes the requests
    a 401 (Unauthorized) was returned.

    Closes-Bug: #1612696
    Change-Id: Idba5fed587e77aaa683d2c2b2126a520214712ce

Changed in ironic-python-agent:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/ironic-python-agent 1.5.0

This issue was fixed in the openstack/ironic-python-agent 1.5.0 release.

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.