Unable to connect to server. Got error: [Errno 111] ECONNREFUSED

Asked by chistopher on 2011-10-07

I am trying to get glance working with swift. These are the commands that I ran to make sure that swift is running - which it is ! :-).
curl -k -v -H 'X-Storage-User: system:root' -H 'X-Storage-Pass: testpass' https://146.141.78.76:8080/auth/v1.0
* About to connect() to 146.141.78.76 port 8080 (#0)
* Trying 146.141.78.76... connected
* Connected to 146.141.78.76 (146.141.78.76) port 8080 (#0)
* successfully set certificate verify locations:
* CAfile: none
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using AES256-SHA
* Server certificate:
* subject: C=SA; ST=gautang; L=johannesburg; O=***; OU=cns; CN=146.141.78.76; emailAddress=********
* start date: 2011-10-04 08:03:36 GMT
* expire date: 2011-11-03 08:03:36 GMT
* common name: 146.141.78.76 (matched)
* issuer: C=SA; ST=gautang; L=johannesburg; O=wits; OU=cns; CN=146.141.78.76; emailAddress=********
* SSL certificate verify result: self signed certificate (18), continuing anyway.
> GET /auth/v1.0 HTTP/1.1
> User-Agent: curl/7.21.3 (x86_64-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
> Host: 146.141.78.76:8080
> Accept: */*
> X-Storage-User: system:root
> X-Storage-Pass: testpass
>
< HTTP/1.1 200 OK
< X-Storage-Url: https://146.141.78.76:8080/v1/AUTH_system
< X-Storage-Token: AUTH_tk7b8f180d01ef4be8ada6635cc50a0f8e
< X-Auth-Token: AUTH_tk7b8f180d01ef4be8ada6635cc50a0f8e
< Content-Length: 0
< Date: Fri, 07 Oct 2011 09:37:33 GMT
<
* Connection #0 to host 146.141.78.76 left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1)

I have uploaded a couple of files and swift works.

The problem that I am now having is when I try and upload a file using glance into swift I get Unable to connect to server. Got error: [Errno 111] ECONNREFUSED.

The glance settings are .

[DEFAULT]
# Show more verbose log output (sets INFO log level output)
verbose = True

# Show debugging output in logs (sets DEBUG log level output)
debug = true

# Which backend store should Glance use by default is not specified
# in a request to add a new image to Glance? Default: 'file'
# Available choices are 'file', 'swift', and 's3'
default_store = swift

# Address to bind the API server
bind_host = 0.0.0.0

# Port the bind the API server to
bind_port = 9292

# Address to find the registry server
registry_host = 0.0.0.0

# Port the registry server is listening on
registry_port = 9191

# Log to this file. Make sure you do not set the same log
# file for both the API and registry servers!
log_file = /var/log/glance/api.log

# Send logs to syslog (/dev/log) instead of to file specified by `log_file`
use_syslog = False

# ============ Filesystem Store Options ========================

# Directory that the Filesystem backend store
# writes image data to
filesystem_store_datadir = /var/lib/glance/images/

# ============ Swift Store Options =============================
# Address where the Swift authentication service lives
swift_store_auth_address = https://146.141.78.76:443/v1/AUTH_system
# User to authenticate against the Swift authentication service
swift_store_user = system:root

# Auth key for the user authenticating against the
# Swift authentication service
swift_store_key = AUTH_tk7b8f180d01ef4be8ada6635cc50a0f8e

# Container within the account that the account should use
# for storing images in Swift
swift_store_container = glance

# Do we create the container if it does not exist?
swift_store_create_container_on_put = true

# Whether to use ServiceNET to communicate with the Swift storage servers.
# (If you aren't RACKSPACE, leave this False!)
#
#
# To use ServiceNET for authentication, prefix hostname of
# `swift_store_auth_address` with 'snet-'.
# Ex. https://example.com/v1.0/ -> https://snet-example.com/v1.0/
swift_enable_snet = False

# ============ S3 Store Options =============================

# Address where the S3 authentication service lives
s3_store_host = 127.0.0.1:8080/v1.0/

# User to authenticate against the S3 authentication service
s3_store_access_key = <20-char AWS access key>

# Auth key for the user authenticating against the
# S3 authentication service
s3_store_secret_key = <40-char AWS secret key>

# Container within the account that the account should use
# for storing images in S3. Note that S3 has a flat namespace,
# so you need a unique bucket name for your glance images. An
# easy way to do this is append your AWS access key to "glance".
# S3 buckets in AWS *must* be lowercased, so remember to lowercase
# your AWS access key if you use it in your bucket name below!
s3_store_bucket = <lowercased 20-char aws access key>glance

# Do we create the bucket if it does not exist?
s3_store_create_bucket_on_put = False

# ============ Image Cache Options ========================

image_cache_enabled = False

# Directory that the Image Cache writes data to
# Make sure this is also set in glance-pruner.conf
image_cache_datadir = /var/lib/glance/image-cache/

# Number of seconds after which we should consider an incomplete image to be
# stalled and eligible for reaping
image_cache_stall_timeout = 86400
# ============ Delayed Delete Options =============================

# Turn on/off delayed delete
delayed_delete = False

[pipeline:glance-api]
pipeline = versionnegotiation context apiv1app

# To enable Image Cache Management API replace pipeline with below:
# pipeline = versionnegotiation imagecache apiv1app

[pipeline:versions]
pipeline = versionsapp

[app:versionsapp]
paste.app_factory = glance.api.versions:app_factory

[app:apiv1app]
paste.app_factory = glance.api.v1:app_factory
[filter:versionnegotiation]
paste.filter_factory = glance.api.middleware.version_negotiation:filter_factory

[filter:imagecache]
paste.filter_factory = glance.api.middleware.image_cache:filter_factory

[filter:context]
paste.filter_factory = glance.common.context:filter_factory

I have tried

 swift_store_auth_address = https://146.141.78.76:8080/v1/AUTH_system
swift_store_auth_address = https://146.141.78.76:8080/v1/
swift_store_auth_address = https://146.141.78.76:443/v1/
swift_store_auth_address = https://146.141.78.76:443/v1/AUTH_system
with
swift_store_key = AUTH_tk7b8f180d01ef4be8ada6635cc50a0f8e
swift_store_key = testpass

These are the log files
2011-10-07 12:30:48 DEBUG [glance.api.middleware.version_negotiation] Processing request: POST /v1/images Accept:
2011-10-07 12:30:48 DEBUG [glance.api.middleware.version_negotiation] Matched versioned URI. Version: 1.0
2011-10-07 12:30:48 DEBUG [routes.middleware] Matched POST /images
2011-10-07 12:30:48 DEBUG [routes.middleware] Route path: 'images', defaults: {'action': u'create', 'controller': <glance.common.wsgi.Resource object at 0x27c1750>}
2011-10-07 12:30:48 DEBUG [routes.middleware] Match dict: {'action': u'create', 'controller': <glance.common.wsgi.Resource object at 0x27c1750>}
2011-10-07 12:30:48 DEBUG [glance.registry] Adding image metadata...
2011-10-07 12:30:48 DEBUG [glance.registry] container_format: ovf
2011-10-07 12:30:48 DEBUG [glance.registry] disk_format: raw
2011-10-07 12:30:48 DEBUG [glance.registry] is_public: True
2011-10-07 12:30:48 DEBUG [glance.registry] name: Image-1
2011-10-07 12:30:48 DEBUG [glance.registry] size: 0
2011-10-07 12:30:48 DEBUG [glance.registry] status: queued
2011-10-07 12:30:48 DEBUG [glance.registry] 1 custom properties...
2011-10-07 12:30:48 DEBUG [glance.registry] distro: ubuntu 10.10
2011-10-07 12:30:48 DEBUG [eventlet.wsgi.server] 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 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 130, 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 498, in create
    image_meta = self._reserve(req, image_meta)
  File "/usr/lib/pymodules/python2.6/glance/api/v1/images.py", line 292, in _reserve
    image_meta)
  File "/usr/lib/pymodules/python2.6/glance/registry/__init__.py", line 56, in add_image_metadata
    new_image_meta = c.add_image(image_meta)
  File "/usr/lib/pymodules/python2.6/glance/registry/client.py", line 97, in add_image
    res = self.do_request("POST", "/images", body, headers=headers)
  File "/usr/lib/pymodules/python2.6/glance/common/client.py", line 158, in do_request
    "server. Got error: %s" % e)
ClientConnectionError: Unable to connect to server. Got error: [Errno 111] ECONNREFUSED

Thanks in advance :)

Question information

Language:
English Edit question
Status:
Solved
For:
Glance Edit question
Assignee:
No assignee Edit question
Solved by:
chistopher
Solved:
2011-10-07
Last query:
2011-10-07
Last reply:

I forgot to change the registry port to 9191. When O changed it I got an authentication error.

Jay Pipes (jaypipes) said : #2

Try setting your swift_store_auth_url option to this:

swift_store_auth_address = 146.141.78.76:8080/auth/v1.0/

In other words, don't include the https://

Cheers,
-jay

may be this cause by the lacking of
 [paste_deploy]
flavor = keystone

in glance-api.conf and glance-registry.conf

Please recheck your config files