glance add failed

asked 2011-11-22 12:02:51 -0500

chnzzw gravatar image

help: keystone+glance, glance add failed, who can help me?

linux-rskn:/usr/lib64/python2.6/site-packages/glance-tools # glance add name=chnzzw is_public=true < /opt/ubuntu-11.10-server-cloudimg-amd64-disk1.img glance_endpoint = http://127.0.0.1:9292/v1.1/2 action=/v1.1/2/images headers={'content-length': 225443840, 'x-image-meta-container_format': u'ovf', 'x-image-meta-min_disk': u'0', 'x-auth-token': u'4750b0c1-8279-4b24-8af5-e4e65aae35d3', 'x-image-meta-size': 225443840, 'x-image-meta-is_public': u'True', 'x-image-meta-min_ram': u'0', 'content-type': 'application/octet-stream', 'x-image-meta-disk_format': u'raw', 'x-image-meta-name': u'chnzzw'} Failed to add image. Got error: image Note: Your image metadata may still be in the registry, but the image's status will likely be 'killed'. linux-rskn:/usr/lib64/python2.6/site-packages/glance-tools # glance --debug index params={'marker': None, 'sort_key': None, 'limit': 10, 'sort_dir': None} glance_endpoint = http://127.0.0.1:9292/v1.1/2 action=/v1.1/2/images?limit=10 headers={'x-auth-token': u'4750b0c1-8279-4b24-8af5-e4e65aae35d3'} res= Traceback (most recent call last): File "/usr/bin/glance", line 1207, in result = command(options, args) File "/usr/bin/glance", line 60, in wrapper ret = func(*args, kwargs) File "/usr/bin/glance", line 498, in images_index print_header=True) File "/usr/bin/glance", line 444, in _images_index images = client.get_images(parameters) File "/usr/lib64/python2.6/site-packages/glance/client.py", line 56, in get_images data = json.loads(res.read())['images'] KeyError: 'images'

edit retag flag offensive close merge delete

26 answers

Sort by ยป oldest newest most voted
0

answered 2011-12-21 11:20:25 -0500

To solve the problem:

Change the glance endpointemplate in keystone:

From:

http://Glance-API-IP:9292/v1.1/%25tenant_id%25 (http://Glance-API-IP:9292/v1.1/%tenan...)

To:

http://Glance-API-IP:9292/v1 (without the trailing slash!!!)

edit flag offensive delete link more
0

answered 2011-12-14 16:51:38 -0500

jaypipes gravatar image

Hi Mikyung!

I'm going to add this as a bug report and try to get a repeatable test case together. I have a suspicion that it is the endpoint template for the image service that Keystone is returning that is the culprit here.

I'll update you when I have more information.

Thanks! -jay

edit flag offensive delete link more
0

answered 2011-12-14 15:44:00 -0500

mkkang gravatar image

Hi Jay,

I'm working on same glance server.

A terminal: just run "glance index" --> GET /v1/images?limit=10 (OK) B terminal: after setting OS_AUTH_*, run "glance index" --> GET /v1.1//images?limit=10 (ERROR: 302 Multiple Choices)

sh-4.1# cat openrc

HOST_IP=** // our keystone server IP export NOVA_PROJECT_ID=demo export NOVA_USERNAME=demo export NOVA_PASSWORD=guest export NOVA_API_KEY=$NOVA_PASSWORD #export NOVA_URL="http://65.114.169.38:8774/v1.1/" export NOVA_AUTH_URL=http://$HOST_IP:5000/v2.0/ export NOVA_VERSION=1.1 export NOVA_REGION_NAME=RegionOne

export EC2_URL=http://$HOST_IP:8773/services/Cloud export EC2_ACCESS_KEY=demo #export EC2_ACCESS_KEY="demo:guest" export EC2_SECRET_KEY=secretpassword #export EC2_SECRET_KEY="secretpassword"

export OS_AUTH_USER=$NOVA_USERNAME export OS_AUTH_KEY=$NOVA_API_KEY export OS_AUTH_TENANT=$NOVA_PROJECT_ID export OS_AUTH_URL=http://$HOST_IP:5000/v2.0/ export OS_AUTH_STRATEGY=keystone

If I change NOVA_VERSION to 1, sh-4.1# source ./openrc sh-4.1# glance index Not authorized to make this request. Check your credentials (OS_AUTH_USER, OS_AUTH_KEY, ...).

Thanks, Mikyung

edit flag offensive delete link more
0

answered 2011-12-14 15:16:37 -0500

jaypipes gravatar image

Notice in the API log that some requests are being received with a request of:

GET /v1/images?limit=10

whereas some requests are being received as:

GET /v1.1//images?limit=10

The former is working just fine, the latter is returning a 302 since it does not understand v1.1.// apparently.

Can you isolate which client is actually issuing the incorrect call vs which clients are issuing the correct (v1/images/) call?

Thanks, -jay

edit flag offensive delete link more
0

answered 2011-12-13 23:34:42 -0500

mkkang gravatar image

Hello Jay, This is my glance-api log file. Thanks.

2011-12-13 18:25:57 DEBUG [glance-api] ************************* 2011-12-13 18:25:57 DEBUG [glance-api] Configuration options gathered from config file: 2011-12-13 18:25:57 DEBUG [glance-api] /etc/glance/glance-api.conf 2011-12-13 18:25:57 DEBUG [glance-api] ================================================ 2011-12-13 18:25:57 DEBUG [glance-api] backlog 4096 2011-12-13 18:25:57 DEBUG [glance-api] bind_host 0.0.0.0 2011-12-13 18:25:57 DEBUG [glance-api] bind_port 9292 2011-12-13 18:25:57 DEBUG [glance-api] debug True 2011-12-13 18:25:57 DEBUG [glance-api] default_store file 2011-12-13 18:25:57 DEBUG [glance-api] delayed_delete False 2011-12-13 18:25:57 DEBUG [glance-api] filesystem_store_datadir /var/lib/glance/images/ 2011-12-13 18:25:57 DEBUG [glance-api] image_cache_dir /var/lib/glance/image-cache/ 2011-12-13 18:25:57 DEBUG [glance-api] log_file /var/log/glance/api.log 2011-12-13 18:25:57 DEBUG [glance-api] notifier_strategy noop 2011-12-13 18:25:57 DEBUG [glance-api] rabbit_host localhost 2011-12-13 18:25:57 DEBUG [glance-api] rabbit_notification_topic glance_notifications 2011-12-13 18:25:57 DEBUG [glance-api] rabbit_password guest 2011-12-13 18:25:57 DEBUG [glance-api] rabbit_port 5672 2011-12-13 18:25:57 DEBUG [glance-api] rabbit_use_ssl false 2011-12-13 18:25:57 DEBUG [glance-api] rabbit_userid guest 2011-12-13 18:25:57 DEBUG [glance-api] rabbit_virtual_host / 2011-12-13 18:25:57 DEBUG [glance-api] rbd_store_ceph_conf /etc/ceph/ceph.conf 2011-12-13 18:25:57 DEBUG [glance-api] rbd_store_chunk_size 8 2011-12-13 18:25:57 DEBUG [glance-api] rbd_store_pool images 2011-12-13 18:25:57 DEBUG [glance-api] rbd_store_user glance 2011-12-13 18:25:57 DEBUG [glance-api] registry_client_protocol http 2011-12-13 18:25:57 DEBUG [glance-api] registry_host 0.0.0.0 2011-12-13 18:25:57 DEBUG [glance-api] registry_port 9191 2011-12-13 18:25:57 DEBUG [glance-api] s3_store_access_key <20-char AWS access key> 2011-12-13 18:25:57 DEBUG [glance-api] s3_store_bucket <lowercased 20-char="" aws="" access="" key="">glance 2011-12-13 18:25:57 DEBUG [glance-api] s3_store_create_bucket_on_put False 2011-12-13 18:25:57 DEBUG [glance-api] s3_store_host 127.0.0.1:8080/v1.0/ 2011-12-13 18:25:57 DEBUG [glance-api] s3_store_secret_key <40-char AWS secret key> 2011-12-13 18:25:57 DEBUG [glance-api] scrub_time 43200 2011-12-13 18:25:57 DEBUG [glance-api] scrubber_datadir /var/lib/glance/scrubber 2011-12-13 18:25:57 DEBUG [glance-api] swift_enable_snet False 2011-12-13 18:25:57 DEBUG [glance-api] swift_store_auth_address 127.0.0.1:8080/v1.0/ 2011-12-13 18:25:57 DEBUG [glance-api] swift_store_container glance 2011-12-13 18:25:57 DEBUG [glance-api] swift_store_create_container_on_put False 2011-12-13 18:25:57 DEBUG [glance-api] swift_store_key a86850deb2742ec3cb41518e26aa2d89 2011-12-13 18:25:57 DEBUG [glance-api] swift_store_large_object_chunk_size 200 2011-12-13 18:25:57 DEBUG [glance-api] swift_store_large_object_size 5120 2011-12-13 18:25:57 DEBUG [glance-api] swift_store_user jdoe 2011-12-13 18:25:57 DEBUG [glance-api] use_syslog False 2011-12-13 18:25:57 DEBUG [glance-api] verbose True 2011-12-13 18:25:57 DEBUG [glance-api] ************************* 2011-12-13 18:25:57 DEBUG [routes.middleware] Initialized with method overriding = True, and path info altering = True 2011-12-13 18:25:57 DEBUG [eventlet.wsgi.server] (16971) wsgi starting up on http://0.0.0.0:9292/ 2011-12-13 18:26:11 DEBUG [glance.api.middleware.version_negotiation] Processing request: GET /v1/images Accept: 2011-12-13 18:26:11 DEBUG [glance.api.middleware.version_negotiation] Matched versioned URI. Version: 1.0 2011-12-13 18:26:11 DEBUG [routes.middleware] Matched GET /images 2011-12-13 18:26 ... (more)

edit flag offensive delete link more
0

answered 2011-12-13 22:35:58 -0500

jaypipes gravatar image

Please paste the output of the glance-api log file. I need to see the request that has been sent to the API server.

Thanks! -jay

edit flag offensive delete link more
0

answered 2011-12-13 21:59:51 -0500

mkkang gravatar image

Hi, is this resolved? I got same error.

I'm running keystone and glance servers on different nodes. Also I'm using 2012.1-dev version. On keystone server, OS_AUTH_* is set. On glance server, OS_AUTH_* is not set. Only glance-api/registry.conf includes keystone configuration. "glance index/add" on glance server or "euca-run-instances/euca-describe-images" on keystone server... They don't have any problems. All images are open to all.

But, I want to add member to each glance image so that image can be managed by specific member. To do this, I run same openrc (OS_AUTH_*) with keystone server on glance server. Then "glance index/add" provide the following error.


Failed to show index. Got error: The request returned a 302 Multiple Choices. This generally means that you have not included a version indicator in a request URI.

The body of response returned:

{"versions": [{"status": "CURRENT", "id": "v1.1", "links": [{"href": "http://0.0.0.0:9292/v1/", "rel": "self"}]}, {"status": "SUPPORTED", "id": "v1.0", "links": [{"href": "http://0.0.0.0:9292/v1/", "rel": "self"}]}]}

edit flag offensive delete link more
0

answered 2011-12-10 22:30:41 -0500

jaypipes gravatar image

Very odd... I'm a little stumped on this one. Usually this happens when there is an old Glance client lib installed. Let me do some investigating and I will get back to you.

edit flag offensive delete link more
0

answered 2011-12-10 20:50:25 -0500

thingee gravatar image

I've deployed with devstack so it appears to just being pull from master:

2012.1-dev

edit flag offensive delete link more
0

answered 2011-12-10 20:30:59 -0500

jaypipes gravatar image

Heya, what versions of the Glance client package are you using?

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2011-11-22 12:02:51 -0500

Seen: 696 times

Last updated: Dec 21 '11