Glance with postgres db gives connection refused error

Asked by Marc on 2011-06-24

Hi,

I've got glance v2011.3-dev installed using swift as baskend, everything works fine if I use the default sqlite database. If I try change to postgres then I get the following error:

root@ares:~# glance details
Failed to show details. Got error:
Internal Server error: Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/eventlet/wsgi.py", line 336, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/glance/common/wsgi.py", line 113, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 1053, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 1022, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/lib/pymodules/python2.6/routes/middleware.py", line 131, in __call__
    response = self.app(environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/glance/common/wsgi.py", line 311, in __call__
    request, **action_args)
  File "/usr/lib/pymodules/python2.6/glance/common/wsgi.py", line 328, in dispatch
    return method(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/glance/api/v1/images.py", line 136, in detail
    images = registry.get_images_detail(self.options, **params)
  File "/usr/lib/pymodules/python2.6/glance/registry/__init__.py", line 42, in get_images_detail
    return c.get_images_detailed(**kwargs)
  File "/usr/lib/pymodules/python2.6/glance/registry/client.py", line 83, in get_images_detailed
    res = self.do_request("GET", "/images/detail", params=params)
  File "/usr/lib/pymodules/python2.6/glance/client.py", line 174, in do_request
    "server. Got error: %s" % e)
ClientConnectionError: Unable to connect to server. Got error: [Errno 111] ECONNREFUSED

Here is a postgres bit in my glance config:

#sql_connection = sqlite:////var/lib/glance/glance.sqlite
sql_connection = postgresql://glance:password@172.16.16.10/glance

Postgres is listening on 172.16.16.10, I'm able to connect via command line to this db from the glance host (it's the same host as the db). And nova uses the same postgres db without any issue.

Any ideas about this one?

Regards,
Marc

Question information

Language:
English Edit question
Status:
Answered
For:
Glance Edit question
Assignee:
Jay Pipes Edit question
Last query:
2011-06-24
Last reply:
2012-11-26
Jay Pipes (jaypipes) said : #1

Hi Marc, I'm looking into this locally. I'll let you know what I find.

Cheers,
jay

Marc (nerens) said : #2

Hi Jay,

Have you had any luck reproducing the problem?

Cheers,
Marc

Jay Pipes (jaypipes) said : #3

Sorry, Marc, I will try to get to this on a plane ride today... been in meetings all last three days. :(

Launchpad Janitor (janitor) said : #4

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Jay Pipes (jaypipes) said : #5

Re-opening... sorry Marc, still working on this... been a crazy last couple weeks :(

Jay Pipes (jaypipes) said : #6

Still ongoing questions...

apporc (appleorchard2000) said : #7

Same problem here.

apporc (appleorchard2000) said : #8

Same problem here.

apporc (appleorchard2000) said : #9

In my case, I found that if i setenforce 0, then the error was gone.

Can you help with this problem?

Provide an answer of your own, or ask Marc for more information if necessary.

To post a message you must log in.