yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #64224
[Bug 1693228] [NEW] Nova quota show/set give errors in verify_project_id
Public bug reported:
Description
===========
'openstack quota show <project>' gives error in ocata.
Log:
2017-05-24 11:32:27.666 21595 DEBUG nova.api.openstack.wsgi [req-2fdb7c04-35d4-4cd3-aa12-9dd7a835db25 aad396bff0834baeb50beda5ade6ccaa aaf41996573a47ab996a9876313caaaa - default default] Calling method '<function version_select at 0x7f39f5828398>' _process_stack /openstack/venvs/nova-master/lib/python2.7/site-packages/nova/api/openstack/wsgi.py:624
2017-05-24 11:32:28.143 21595 INFO nova.api.openstack.wsgi [req-2fdb7c04-35d4-4cd3-aa12-9dd7a835db25 aad396bff0834baeb50beda5ade6ccaa aaf41996573a47ab996a9876313caaaa - default default] HTTP exception thrown: Project ID aa4664722c924c979953bf264c4044aa is not a valid project.
2017-05-24 11:32:28.147 21595 DEBUG nova.api.openstack.wsgi [req-2fdb7c04-35d4-4cd3-aa12-9dd7a835db25 aad396bff0834baeb50beda5ade6ccaa aaf41996573a47ab996a9876313caaaa - default default] Returning 400 to user: Project ID aa4664722c924c979953bf264c4044aa is not a valid project. __call__ /openstack/venvs/nova-master/lib/python2.7/site-packages/nova/api/openstack/wsgi.py:1041
After some digging the error seems to be that in file:
https://github.com/openstack/nova/blob/master/nova/api/openstack/identity.py#L34
on line 34 the code reads: 'resp = sess.get('/v3/projects/%s' %
project_id'
It seems incorrect to enforce v3 endpoint here. Both due to that some are still using v2.0, and also because the endpoints for identity normally already includes the endpoint.
Before the request is sent to identity the url is merged with base url (In file: keystoneauth1/session.py line 516).
This results in an incorrect path with duplicate versions, that looks something like: http://<domain:port>/v3/v3/projects/<project_id>
..which in turn gives a 404 response back to nova. Nova will present this as a 400 error stating the project does not exist.
Changing the code from:
'resp = sess.get('/v3/projects/%s' % project_id'
to
'resp = sess.get('/projects/%s' % project_id'
..will fix this particular issue and so far I have not seen any other
impact and to me is seems logical to let the endpoint define versioning
rather than enforcing it.
Steps to reproduce
==================
Use openstack client and run: openstack quota show <project>
Expected result
===============
Getting a result of project quota
Actual result
=============
Nova returns 400 error: 'Project ID <project_id> is not a valid project'
Environment
===========
Ocata version running on KVM
Installed via openstack-ansible
Ceph backend
Neutron
** Affects: nova
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1693228
Title:
Nova quota show/set give errors in verify_project_id
Status in OpenStack Compute (nova):
New
Bug description:
Description
===========
'openstack quota show <project>' gives error in ocata.
Log:
2017-05-24 11:32:27.666 21595 DEBUG nova.api.openstack.wsgi [req-2fdb7c04-35d4-4cd3-aa12-9dd7a835db25 aad396bff0834baeb50beda5ade6ccaa aaf41996573a47ab996a9876313caaaa - default default] Calling method '<function version_select at 0x7f39f5828398>' _process_stack /openstack/venvs/nova-master/lib/python2.7/site-packages/nova/api/openstack/wsgi.py:624
2017-05-24 11:32:28.143 21595 INFO nova.api.openstack.wsgi [req-2fdb7c04-35d4-4cd3-aa12-9dd7a835db25 aad396bff0834baeb50beda5ade6ccaa aaf41996573a47ab996a9876313caaaa - default default] HTTP exception thrown: Project ID aa4664722c924c979953bf264c4044aa is not a valid project.
2017-05-24 11:32:28.147 21595 DEBUG nova.api.openstack.wsgi [req-2fdb7c04-35d4-4cd3-aa12-9dd7a835db25 aad396bff0834baeb50beda5ade6ccaa aaf41996573a47ab996a9876313caaaa - default default] Returning 400 to user: Project ID aa4664722c924c979953bf264c4044aa is not a valid project. __call__ /openstack/venvs/nova-master/lib/python2.7/site-packages/nova/api/openstack/wsgi.py:1041
After some digging the error seems to be that in file:
https://github.com/openstack/nova/blob/master/nova/api/openstack/identity.py#L34
on line 34 the code reads: 'resp = sess.get('/v3/projects/%s' %
project_id'
It seems incorrect to enforce v3 endpoint here. Both due to that some are still using v2.0, and also because the endpoints for identity normally already includes the endpoint.
Before the request is sent to identity the url is merged with base url (In file: keystoneauth1/session.py line 516).
This results in an incorrect path with duplicate versions, that looks something like: http://<domain:port>/v3/v3/projects/<project_id>
..which in turn gives a 404 response back to nova. Nova will present this as a 400 error stating the project does not exist.
Changing the code from:
'resp = sess.get('/v3/projects/%s' % project_id'
to
'resp = sess.get('/projects/%s' % project_id'
..will fix this particular issue and so far I have not seen any other
impact and to me is seems logical to let the endpoint define
versioning rather than enforcing it.
Steps to reproduce
==================
Use openstack client and run: openstack quota show <project>
Expected result
===============
Getting a result of project quota
Actual result
=============
Nova returns 400 error: 'Project ID <project_id> is not a valid project'
Environment
===========
Ocata version running on KVM
Installed via openstack-ansible
Ceph backend
Neutron
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1693228/+subscriptions
Follow ups