not able to execute the openstack api !!

Asked by Naved Ali Shah on 2011-02-15

I have done setup of the glance and glance-api and registry are running as expected. i am using filesystem to upload an image and thats working fine. Now i have couple of images uploaded on glance (/var/lib/glance/). TO test the openstack api i ran a command cloudservers image-list or flavor-list and came across below error
Traceback (most recent call last):
  File "/usr/local/bin/cloudservers", line 9, in <module>
    load_entry_point('python-cloudservers==1.2', 'console_scripts', 'cloudservers')()
  File "/usr/local/lib/python2.6/dist-packages/python_cloudservers-1.2-py2.6.egg/cloudservers/", line 551, in main
  File "/usr/local/lib/python2.6/dist-packages/python_cloudservers-1.2-py2.6.egg/cloudservers/", line 144, in main
  File "/usr/local/lib/python2.6/dist-packages/python_cloudservers-1.2-py2.6.egg/cloudservers/", line 293, in do_image_list
    print_list(self.cs.images.list(), ['ID', 'Name', 'Status'])
  File "/usr/local/lib/python2.6/dist-packages/python_cloudservers-1.2-py2.6.egg/cloudservers/", line 39, in list
    return self._list("/images/detail", "images")
  File "/usr/local/lib/python2.6/dist-packages/python_cloudservers-1.2-py2.6.egg/cloudservers/", line 26, in _list
    resp, body = self.api.client.get(url)
  File "/usr/local/lib/python2.6/dist-packages/python_cloudservers-1.2-py2.6.egg/cloudservers/", line 83, in get
    return self._cs_request(url, 'GET', **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/python_cloudservers-1.2-py2.6.egg/cloudservers/", line 70, in _cs_request
  File "/usr/local/lib/python2.6/dist-packages/python_cloudservers-1.2-py2.6.egg/cloudservers/", line 56, in request

I am trying to execute the command from network api server where i have defined the basic properties for glance and set the enviornment variable those are below :-
and variables :-
export CLOUD_SERVERS_API_KEY="60ddc94f-77b8-4c7f-a493-80239cf0744d"
I also have removed ec2 parameters from the nova.conf file and nova-objectstore is not running any more as well (means only 3 services running on network server and 2 glance server in serperate machine).
If i do GET from network server then i get proper response from Glance but if i run cloudservers commands i get exception (mentioned above).
Below is the log messages from nova-api service :-
2011-02-15 02:46:09,645 DEBUG eventlet.wsgi.server [-] - - [15/Feb/2011 02:46:09] "GET /v1.0/ HTTP/1.1" 204 276 0.040602
 from MainProcess (pid=28711) write /usr/local/lib/python2.6/dist-packages/nova-2011.2-py2.6.egg/nova/
2011-02-15 02:46:09,666 ERROR nova.api.openstack [-] エラー id openstack のプロジェクトが存在しません。 をキャッチしました。
(nova.api.openstack): TRACE: Traceback (most recent call last):
(nova.api.openstack): TRACE: File "/usr/local/lib/python2.6/dist-packages/nova-2011.2-py2.6.egg/nova/api/openstack/", line 52, in __call__
(nova.api.openstack): TRACE: return req.get_response(self.application)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/", line 918, in get_response
(nova.api.openstack): TRACE: application, catch_exc_info=False)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/", line 886, in call_application
(nova.api.openstack): TRACE: app_iter = application(self.environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/", line 147, in __call__
(nova.api.openstack): TRACE: resp = self.call_func(req, *args, **self.kwargs)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/", line 208, in call_func
(nova.api.openstack): TRACE: return self.func(req, *args, **kwargs)
(nova.api.openstack): TRACE: File "/usr/local/lib/python2.6/dist-packages/nova-2011.2-py2.6.egg/nova/api/openstack/", line 58, in __call__
(nova.api.openstack): TRACE: project = self.auth.get_project(FLAGS.default_project)
(nova.api.openstack): TRACE: File "/usr/local/lib/python2.6/dist-packages/nova-2011.2-py2.6.egg/nova/auth/", line 473, in get_project
(nova.api.openstack): TRACE: project_dict = drv.get_project(pid)
(nova.api.openstack): TRACE: File "/usr/local/lib/python2.6/dist-packages/nova-2011.2-py2.6.egg/nova/auth/", line 58, in get_project
(nova.api.openstack): TRACE: project = db.project_get(context.get_admin_context(), pid)
(nova.api.openstack): TRACE: File "/usr/local/lib/python2.6/dist-packages/nova-2011.2-py2.6.egg/nova/db/", line 882, in project_get
(nova.api.openstack): TRACE: return IMPL.project_get(context, id)
(nova.api.openstack): TRACE: File "/usr/local/lib/python2.6/dist-packages/nova-2011.2-py2.6.egg/nova/db/sqlalchemy/", line 1784, in project_get
(nova.api.openstack): TRACE: raise exception.NotFound(_("No project with id %s") % id)
(nova.api.openstack): TRACE: NotFound: <unprintable NotFound object>
(nova.api.openstack): TRACE:
2011-02-15 02:46:09,671 DEBUG eventlet.wsgi.server [-] - - [15/Feb/2011 02:46:09] "GET /v1.0//images/detail?fresh=1297766769.65 HTTP/1.1" 500 285 0.023622
 from MainProcess (pid=28711) write /usr/local/lib/python2.6/dist-packages/nova-2011.2-py2.6.egg/nova/
    raise exceptions.from_response(resp, body)

I am sure some parameter is not been set or value is not been set properly.
nova.conf File :-
--default_log_levels=amqplib=INFO, sqlalchemy=INFO, eventlet.wsgi.server=DEBUG

I appriciate any help you can provide to me.

Question information

English Edit question
Glance Edit question
No assignee Edit question
Solved by:
Naved Ali Shah
Last query:
Last reply:
Naved Ali Shah (naved-shah) said : #1

Issue was from Nova:- Reason of not running was default project was absent in the DB >> projects and in access key if you see for EC2 there is project id as well present to relate the user and the project but if there is no project id in the access key that time nova code looks for default project and if its nor present in th DB then throws error :-
raise exception.NotFound(_("No project with id %s") % id)
To resolve this i ad to create a project using the same user which access key is been sourced to cloudserver/openstack api.