major / supernova

Use novaclient with multiple OpenStack nova environments the easy way
http://supernova.readthedocs.org/
Apache License 2.0
86 stars 54 forks source link

ERROR (BadRequest): Expecting apiKey (HTTP 400) #94

Open pozgo opened 9 years ago

pozgo commented 9 years ago

After running git pull

 [SUPERNOVA] Running nova against prod...

__ Error Output ______________________________________________________________
ERROR (BadRequest): Expecting apiKey (HTTP 400)

MacOS 10.10.5

sjafferali commented 9 years ago

This actually looks like an issue with python-novaclient 2.27.0. I tried providing all the variables to nova and received the same error. Rolling back to 2.26.0 fixed it for me.

samir@macbook [~]$ pip install python-novaclient==2.26.0

major commented 9 years ago

Hey @pozgo -- thanks for the bug report. That error output is coming from python-novaclient, as @sjafferali noted above. You might want to double-check your supernova configuration to make sure your credentials are entered correctly.

sjafferali commented 9 years ago

To expand on my previous reply, there appears to be an issue with the python-novaclient 2.27.0 update that causing the error "ERROR (BadRequest): Expecting apiKey (HTTP 400)."

samir@macbook [~]$ nova --version
2.26.0
samir@macbook [~]$ nova list
/Library/Python/2.7/site-packages/novaclient/v1_1/__init__.py:30: UserWarning: Module novaclient.v1_1 is deprecated (taken as a basis for novaclient.v2). The preferable way to get client class or object you can find in novaclient.client module.
  warnings.warn("Module novaclient.v1_1 is deprecated (taken as a basis for "
/Library/Python/2.7/site-packages/requests/packages/urllib3/connection.py:251: SecurityWarning: Certificate has no `subjectAltName`, falling back to check for a `commonName` for now. This feature is being removed by major browsers and deprecated by RFC 2818. (See https://github.com/shazow/urllib3/issues/497 for details.)
  SecurityWarning
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+
samir@macbook [~]$ sudo pip install -U python-novaclient
[Truncated for brevity]
samir@macbook [~]$ nova --version
2.27.0
samir@macbook [~]$ nova list
/Library/Python/2.7/site-packages/requests/packages/urllib3/connection.py:251: SecurityWarning: Certificate has no `subjectAltName`, falling back to check for a `commonName` for now. This feature is being removed by major browsers and deprecated by RFC 2818. (See https://github.com/shazow/urllib3/issues/497 for details.)
  SecurityWarning
ERROR (BadRequest): Expecting apiKey (HTTP 400)
samir@macbook [~]$

Since supernova calls nova with arguments, it is affected as well.

samir@macbook [~]$ supernova self show
[SUPERNOVA] Running nova against self...

__ Error Output ______________________________________________________________
/Library/Python/2.7/site-packages/requests/packages/urllib3/connection.py:251: SecurityWarning: Certificate has no `subjectAltName`, falling back to check for a `commonName` for now. This feature is being removed by major browsers and deprecated by RFC 2818. (See https://github.com/shazow/urllib3/issues/497 for details.)
  SecurityWarning
ERROR (BadRequest): Expecting apiKey (HTTP 400)

samir@macbook [~]$
pozgo commented 9 years ago

HI, Thanks for such a quick reply. After downgrading the nova client to 2.26.0 seems to work again. Thanks @sjafferali !!! :)

BTW. Still after having supernova run and getting output there is small error.

| c91ae969-40a5-421a-8cb1-c32cb6998dd4 | Windows Server 2012 R2 + SQL Server 2014 Standard            | ACTIVE |        |
| beb3dfe6-ebb0-4943-bcea-65a3e11bb7bd | Windows Server 2012 R2 + SQL Server 2014 Web                 | ACTIVE |        |
| 9aa0d346-c06f-4652-bbb1-4342a7d2d017 | iPXE Boot (boot.rackspace.com)                               | ACTIVE |        |
+--------------------------------------+--------------------------------------------------------------+--------+--------+

__ Error Output ______________________________________________________________
/Library/Python/2.7/site-packages/novaclient/v1_1/__init__.py:30: UserWarning: Module novaclient.v1_1 is deprecated (taken as a basis for novaclient.v2). The preferable way to get client class or object you can find in novaclient.client module.
  warnings.warn("Module novaclient.v1_1 is deprecated (taken as a basis for "

But this is not big issue as far as I can use supernova. Thanks again
DanielSmedegaardBuus commented 9 years ago

This issue is also present in 2.28.0. I downgraded to 2.26.0 as suggested here, and I can now access Rackspace.

halfshellhero commented 9 years ago

+1, same as @DanielSmedegaardBuus

I updated to 2.28.0 this morning and suddenly started receiving the 400 bad request errors as well.

ERROR (BadRequest): Expecting apiKey (HTTP 400)

I made no changes to my .supernova credentials file; downgraded back to 2.26.0 and functionality was restored.

gtmanfred commented 9 years ago

https://review.openstack.org/#/c/221570/

Once that goes through, or someone comments on it, that should fix the problem

The problem is that every nova client call checks for the api_version, but the rackspace api endpoint has that disabled.

alanquillin commented 9 years ago

Just a heads up. I pulled down the most recent 2.31.0 (after https://review.openstack.org/#/c/221570/ @gtmanfred mentioned above has been merged) and this issue seems to have been resolve.