Custom Search

Saturday, May 4, 2013

Glance Error communicating with http://localhost:9292 [Errno 111] Connection refused

Error Log
----------------

CommunicationError: Error communicating with http://localhost:9292 [Errno 111] Connection refused

Solution
-------------

1) Goto http://127.0.0.1:9292 and check whether glance service is running

2)
cd install_dir/glance
mkdir /etc/glance
sudo cp etc/glance-api.conf /etc/glance/
sudo cp etc/glance-api-paste.ini /etc/glance/

3)
#glance-control --help
##Start Glance##
#glance-control all start
#sudo glance-control all status

4)
Debug "glance-api" If glance service nor running on http://127.0.0.1:9292.
#source .venv/bin/activate
#sudo glance-api --debug
This command will show the error message
For Example:
No such file or directory: '/var/log/glance/api.log'

5)
#sudo mkdir /var/log/glance/

7)
Goto http://127.0.0.1:9292 and check whether glance service is running

8)
Goto Horizon and check
http://127.0.0.1:8000/admin/images/images/

How to debug glance-api
----------------------------------------

(.venv)saju@saju-VirtualBox:~/ops_manual/glance$ sudo glance-api --debug
Traceback (most recent call last):
  File "/usr/local/bin/glance-api", line 7, in
    execfile(__file__)
  File "/opt/stack/glance/bin/glance-api", line 54, in
    log.setup('glance')
  File "/opt/stack/glance/glance/openstack/common/log.py", line 331, in setup
    _setup_logging_from_conf(product_name)
  File "/opt/stack/glance/glance/openstack/common/log.py", line 378, in _setup_logging_from_conf
    filelog = logging.handlers.WatchedFileHandler(logpath)
  File "/usr/lib/python2.7/logging/handlers.py", line 392, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python2.7/logging/__init__.py", line 902, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python2.7/logging/__init__.py", line 925, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 2] No such file or directory: '/var/log/glance/api.log'
(.venv)saju@saju-VirtualBox:~/ops_manual/glance$

Complete Error Log
--------------------------------

glanceclient connection created using token "5fbf4fdf68cb0b65a2bc4479354582c0" and url "http://localhost:9292"
curl -i -X GET -H 'X-Auth-Token: 5fbf4fdf68cb0b65a2bc4479354582c0' -H 'Content-Type: application/json' -H 'User-Agent: python-glanceclient' http://localhost:9292/v1/images/detail?limit=21
ERROR:django.request:Internal Server Error: /admin/images/images/
Traceback (most recent call last):
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/home/saju/ops_manual/horizon/horizon/decorators.py", line 38, in dec
    return view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/horizon/decorators.py", line 86, in dec
    return view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/horizon/decorators.py", line 54, in dec
    return view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/horizon/decorators.py", line 38, in dec
    return view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/views/generic/base.py", line 48, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in dispatch
    return handler(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/horizon/tables/views.py", line 155, in get
    handled = self.construct_tables()
  File "/home/saju/ops_manual/horizon/horizon/tables/views.py", line 146, in construct_tables
    handled = self.handle_table(table)
  File "/home/saju/ops_manual/horizon/horizon/tables/views.py", line 118, in handle_table
    data = self._get_data_dict()
  File "/home/saju/ops_manual/horizon/horizon/tables/views.py", line 182, in _get_data_dict
    self._data = {self.table_class._meta.name: self.get_data()}
  File "/home/saju/ops_manual/horizon/openstack_dashboard/dashboards/admin/images/views.py", line 57, in get_data
    exceptions.handle(self.request, msg)
  File "/home/saju/ops_manual/horizon/openstack_dashboard/dashboards/admin/images/views.py", line 53, in get_data
    paginate=True)
  File "/home/saju/ops_manual/horizon/openstack_dashboard/api/glance.py", line 78, in image_list_detailed
    images = list(itertools.islice(images_iter, request_size))
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/glanceclient/v1/images.py", line 149, in paginate
    images = self._list(url, "images")
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/glanceclient/common/base.py", line 53, in _list
    resp, body = self.api.json_request('GET', url)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/glanceclient/common/http.py", line 222, in json_request
    resp, body_iter = self._http_request(url, method, **kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/glanceclient/common/http.py", line 192, in _http_request
    raise exc.CommunicationError(message=message)
CommunicationError: Error communicating with http://localhost:9292 [Errno 111] Connection refused
[04/May/2013 10:32:27] "GET /admin/images/images/ HTTP/1.1" 500 193040

No comments:

Post a Comment