OpenStack Image Registry and Delivery Service (Glance)

Glance image add error

Asked by shahzeb khan on 2012-04-20

Iam having an error at the time of adding image i.e

Failed to add image. Got error:
Internal Server error: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/eventlet/wsgi.py", line 336, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 113, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1053, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1022, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/keystone-2011.3.1-py2.7.egg/keystone/middleware/auth_token.py", line 162, in __call__
    valid = self._validate_claims(claims)
  File "/usr/local/lib/python2.7/dist-packages/keystone-2011.3.1-py2.7.egg/keystone/middleware/auth_token.py", line 273, in _validate_claims
    '/v2.0/tokens/%s' % claims, headers=headers)
  File "/usr/local/lib/python2.7/dist-packages/keystone-2011.3.1-py2.7.egg/keystone/common/bufferedhttp.py", line 164, in http_connect_raw
    conn.endheaders()
  File "/usr/lib/python2.7/httplib.py", line 951, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 811, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 773, in send
    self.connect()
  File "/usr/local/lib/python2.7/dist-packages/keystone-2011.3.1-py2.7.egg/keystone/common/bufferedhttp.py", line 80, in connect
    return HTTPConnection.connect(self)
  File "/usr/lib/python2.7/httplib.py", line 754, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/dist-packages/eventlet/green/socket.py", line 59, in create_connection
    raise error, msg
error: [Errno 111] ECONNREFUSED

Note: Your image metadata may still be in the registry, but the image's status will likely be 'killed'.

This error raises when i give following command :

sudo glance add -A 999888777666 name="ttylinux-uec-amd64-12.1_2.6.35-22_1" is_public=true < ttylinux-uec-amd64-12.1_2.6.35-22_1-vmlinuz

Please help me out asap ...
please

Thanks

Question information

Language:
English Edit question
Status:
Expired
For:
Glance Edit question
Assignee:
No assignee Edit question
Last query:
2012-04-25
Last reply:
2012-05-11
Brian Waldon (bcwaldon) said : #1

It looks like the glance api server can't connect to keystone. Can you verify that you have properly configured the keystone middleware in your glance api paste config?

shahzeb khan (08bitshahzebk) said : #2

i think so because keystone is running well...

smallma (s-rain) said : #3

Can you paste your endpoint list and keystone version?

shahzeb khan (08bitshahzebk) said : #4

https://github.com/openstack/keystone/zipball/stable/diablo this is my keystone version openstack-keystone-79a9fde

Thats my keystone endpoints

{
    "access": {
        "serviceCatalog": [
            {
                "endpoints": [
                    {
                        "adminURL": "http://10.3.30.234:8774/v1.1/1",
                        "internalURL": "http://10.3.30.234:8774/v1.1/1",
                        "publicURL": "http://10.3.30.234:8774/v1.1/1",
                        "region": "RegionOne"
                    },
                    {
                        "adminURL": "http://10.3.30.234:8774/v1.1/1",
                        "internalURL": "http://10.3.30.234:8774/v1.1/1",
                        "publicURL": "http://10.3.30.234:8774/v1.1/1",
                        "region": "RegionOne"
                    },
                    {
                        "adminURL": "http://10.3.30.234:8774/v1.1/1",
                        "internalURL": "http://10.3.30.234:8774/v1.1/1",
                        "publicURL": "http://10.3.30.234:8774/v1.1/1",
                        "region": "RegionOne"
                    },
                    {
                        "adminURL": "http://10.3.30.234:8774/v1.1/1",
                        "internalURL": "http://10.3.30.234:8774/v1.1/1",
                        "publicURL": "http://10.3.30.234:8774/v1.1/1",
                        "region": "RegionOne"
                    }
                ],
                "name": "nova",
                "type": "compute"
            },
            {
                "endpoints": [
                    {
                        "adminURL": "http://10.3.30.234:9292/v1.1/1",
                        "internalURL": "http://10.3.30.234:9292/v1.1/1",
                        "publicURL": "http://10.3.30.234:9292/v1.1/1",
                        "region": "RegionOne"
                    },
                    {
                        "adminURL": "http://10.3.30.234:9292/v1.1/1",
                        "internalURL": "http://10.3.30.234:9292/v1.1/1",
                        "publicURL": "http://10.3.30.234:9292/v1.1/1",
                        "region": "RegionOne"
                    },
                    {
                        "adminURL": "http://10.3.30.234:9292/v1.1/1",
                        "internalURL": "http://10.3.30.234:9292/v1.1/1",
                        "publicURL": "http://10.3.30.234:9292/v1.1/1",
                        "region": "RegionOne"
                    },
                    {
                        "adminURL": "http://10.3.30.234:9292/v1.1/1",
                        "internalURL": "http://10.3.30.234:9292/v1.1/1",
                        "publicURL": "http://10.3.30.234:9292/v1.1/1",
                        "region": "RegionOne"
                    }
                ],
                "name": "glance",
                "type": "image"
            },
            {
                "endpoints": [
                    {
                        "adminURL": "http://10.3.30.234:35357/v2.0",
                        "internalURL": "http://10.3.30.234:5000/v2.0",
                        "publicURL": "http://10.3.30.234:5000/v2.0",
                        "region": "RegionOne"
                    },
                    {
                        "adminURL": "http://10.3.30.234:35357/v2.0",
                        "internalURL": "http://10.3.30.234:5000/v2.0",
                        "publicURL": "http://10.3.30.234:5000/v2.0",
                        "region": "RegionOne"
                    },
                    {
                        "adminURL": "http://10.3.30.234:35357/v2.0",
                        "internalURL": "http://10.3.30.234:5000/v2.0",
                        "publicURL": "http://10.3.30.234:5000/v2.0",
                        "region": "RegionOne"
                    },
                    {
                        "adminURL": "http://10.3.30.234:35357/v2.0",
                        "internalURL": "http://10.3.30.234:5000/v2.0",
                        "publicURL": "http://10.3.30.234:5000/v2.0",
                        "region": "RegionOne"
                    }
                ],
                "name": "identity",
                "type": "identity"
            }
        ],
        "token": {
            "expires": "2015-02-05T00:00:00",
            "id": "999888777666",
            "tenant": {
                "id": "1",
                "name": "adminTenant"
            }
        },
        "user": {
            "id": "1",
            "name": "adminUser",
            "roles": [
                {
                    "id": "1",
                    "name": "KeystoneServiceAdmin",
                    "tenantId": "1"
                },
                {
                    "id": "2",
                    "name": "Admin",
                    "tenantId": "1"
                },
                {
                    "id": "1",
                    "name": "KeystoneServiceAdmin"
                },
                {
                    "id": "1",
                    "name": "KeystoneServiceAdmin"
                },
                {
                    "id": "1",
                    "name": "KeystoneServiceAdmin"
                },
                {
                    "id": "1",
                    "name": "KeystoneServiceAdmin"
                },
                {
                    "id": "1",
                    "name": "KeystoneServiceAdmin"
                },
                {
                    "id": "2",
                    "name": "Admin"
                },
                {
                    "id": "2",
                    "name": "Admin"
                },
                {
                    "id": "2",
                    "name": "Admin"
                },
                {
                    "id": "2",
                    "name": "Admin"
                }
            ]
        }
    }
}

shahzeb khan (08bitshahzebk) said : #5

Kindly help me out asap

shahzeb khan (08bitshahzebk) said : #6

MY glance-api.conf is as follows:

[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 = file

# 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

# ============ Notification System Options =====================

# Notifications can be sent when images are create, updated or deleted.
# There are three methods of sending notifications, logging (via the
# log_file directive), rabbit (via a rabbitmq queue) or noop (no
# notifications sent, the default)
notifier_strategy = noop

# Configuration options if sending notifications via rabbitmq (these are
# the defaults)
rabbit_host = localhost
rabbit_port = 5672
rabbit_use_ssl = false
rabbit_userid = guest
rabbit_password = guest
rabbit_virtual_host = /
rabbit_notification_topic = glance_notifications

# ============ 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 = 127.0.0.1:8080/v1.0/

# User to authenticate against the Swift authentication service
swift_store_user = jdoe

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

# 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 = False

# What size, in MB, should Glance start chunking image files
# and do a large object manifest in Swift? By default, this is
# the maximum object size in Swift, which is 5GB
swift_store_large_object_size = 5120

# When doing a large object manifest, what size, in MB, should
# Glance write chunks to Swift? This amount of data is written
# to a temporary disk buffer during the process of chunking
# the image file, and the default is 200MB
swift_store_large_object_chunk_size = 200

# 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
# NOTE: use the following pipeline for keystone
pipeline = versionnegotiation authtoken context apiv1app

# To enable Image Cache Management API replace pipeline with below:
# pipeline = versionnegotiation context imagecache apiv1app
# NOTE: use the following pipeline for keystone auth (with caching)
# pipeline = versionnegotiation authtoken context imagecache apiv1app
pipeline = versionnegotiation authtoken keystone_shim 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

[filter:authtoken]
paste.filter_factory = keystone.middleware.auth_token:filter_factory
service_protocol = http
service_host = 10.3.30.234
service_port = 5000
auth_host = 10.3.30.234
auth_port = 35357
auth_protocol = http
auth_uri = http://10.3.30.234:5000/v2.0
admin_token = 999888777666

[filter:keystone_shim]
context_class = glance.registry.context.RequestContext
paste.filter_factory = keystone.middleware.glance_auth_token:filter_factory

Eoghan Glynn (eglynn) said : #7

What version are you using?

 admin_token = 999888777666

has been replaced with:

 admin_tenant_name = <tenant>
 admin_user = <user>
 admin_password = <password>

in the latest version.

Also, can you invoke on the configured keystone endpoint via curl:

curl -d '{"auth":{"passwordCredentials":{"username": <user>, "password": <password>}}}' -H "Content-type: application/json" http://localhost:5000/v2.0/tokens

Jay Pipes (jaypipes) said : #8

Eoghan, he's using stable/diablo versions of Keystone and Glance. (2011.3.1 release)

Shazeb, would it be possible to upgrade to the Essex code base?

Best,
-jay

shahzeb khan (08bitshahzebk) said : #9

i hve no idea of upgradation ...

shahzeb khan (08bitshahzebk) said : #10

iam using diablo release..

smallma (s-rain) said : #11

In my case, I installed keystone_2012.1 and glance2012.1. The following sections are my setting for your reference.

add glance endpoint:
keystone endpoint-create --region RegionOne --service_id 7c6c524face04f7994062fa8c78e0c3b --publicurl http://172.16.70.236:9292/v1 --adminurl http://172.16.70.236:9292/v1 --internalurl http://172.16.70.236:9292/v1

glance-api-paste.ini:
[filter:authtoken]
paste.filter_factory = keystone.middleware.auth_token:filter_factory
service_protocol = http
service_host = 172.16.70.129
service_port = 5000
auth_host = 172.16.70.129
auth_port = 35357
auth_protocol = http
auth_uri = http://172.16.70.129:5000/
admin_tenant_name = adminTenant
admin_user = admin
admin_password = openstack
admin_token = ADMIN

Launchpad Janitor (janitor) said : #12

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