Bug 1517264 - nova --bypass-url flag throw the ERROR (KeyError): 'versions'
Summary: nova --bypass-url flag throw the ERROR (KeyError): 'versions'
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-nova
Version: 9.0 (Mitaka)
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
: 9.0 (Mitaka)
Assignee: Rajesh Tailor
QA Contact: Joe H. Rahme
URL:
Whiteboard:
Depends On:
Blocks: 1525427
TreeView+ depends on / blocked
 
Reported: 2017-11-24 12:40 UTC by Md Nadeem
Modified: 2022-08-09 11:47 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1525427 (view as bug list)
Environment:
Last Closed: 2018-01-29 20:54:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OSP-8670 0 None None None 2022-08-09 11:47:09 UTC

Description Md Nadeem 2017-11-24 12:40:00 UTC
Description of problem:

While executing the any nova command with --bypass-url, it throw the error ERROR (KeyError): 'versions'. After analyzing a bit, i come to know the below parameter set wrong. 

response_key get sets to "versions" where as it gets set to "servers" when execute without --bypass-url and produce the expected output.

>> /usr/lib/python2.7/site-packages/novaclient/base.py +246
    
$nova --version
3.3.2

 
Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
[stack@instack ~]$ nova --bypass-url http://192.168.124.20:8774/v2.1/  list

ERROR (KeyError): 'versions'


Expected results:
It should produce the expected output of nova list

Additional info:

Comment 4 Artom Lifshitz 2018-01-29 20:54:45 UTC
I believe the traceback is an indication that the URL given to --bypass-url is wrong. I agree that the traceback is completely unhelpful, but the root cause is the missing tenant ID (which can be obtained with `openstack token issue` and looking at the project_id field) in --bypass-url. Here's a quick test I did in a packstack-deployed OSP9 allinone:

$ openstack token issue | grep project_id
  project_id | ee46bec1fc7d4382b0397d9e0671e92b |


$ nova --bypass-url http://192.168.100.141:8774/v2.1/ list
  ERROR (KeyError): 'versions'

$ nova --bypass-url http://192.168.100.141:8774/this/is/wrong list
  ERROR (KeyError): 'versions'

$ nova --bypass-url \ 
  http://192.168.100.141:8774/v2.1/ee46bec1fc7d4382b0397d9e0671e92b/ list

  +----+------+--------+------------+-------------+----------+
  | ID | Name | Status | Task State | Power State | Networks |
  +----+------+--------+------------+-------------+----------+
  +----+------+--------+------------+-------------+----------+

Because it's fairly easy to correct this without any changes to the code, and the fact that OSP9 (mitaka) is EOL upstream, I'd like to close this bug. If adding the tenant ID doesn't fix the problem, please re-open the bug.


Note You need to log in before you can comment on or make changes to this bug.