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-11-22 16:43:45 -0500

jaypipes gravatar image

Would you mind paste-binning your glance-api log contents. Please remove any security credentials from the paste!

Thanks! -jay

edit flag offensive delete link more
0

answered 2011-11-23 04:28:59 -0500

chnzzw gravatar image

1.OK,the glance-api log and glance --debug index result as follow. 2.I fix the bugs of the glance but still have the error.
3.please help me solve the error,thanks all.

2011-11-23 12:24:03 DEBUG [glance-api] ************************* 2011-11-23 12:24:03 DEBUG [glance-api] Configuration options gathered from config file: 2011-11-23 12:24:03 DEBUG [glance-api] /etc/glance/glance-api.conf 2011-11-23 12:24:03 DEBUG [glance-api] ================================================ 2011-11-23 12:24:03 DEBUG [glance-api] bind_host 0.0.0.0 2011-11-23 12:24:03 DEBUG [glance-api] bind_port 9292 2011-11-23 12:24:03 DEBUG [glance-api] debug True 2011-11-23 12:24:03 DEBUG [glance-api] default_store file 2011-11-23 12:24:03 DEBUG [glance-api] delayed_delete False 2011-11-23 12:24:03 DEBUG [glance-api] filesystem_store_datadir /var/lib/glance/images/ 2011-11-23 12:24:03 DEBUG [glance-api] image_cache_datadir /var/lib/glance/image-cache/ 2011-11-23 12:24:03 DEBUG [glance-api] image_cache_enabled False 2011-11-23 12:24:03 DEBUG [glance-api] image_cache_stall_timeout 86400 2011-11-23 12:24:03 DEBUG [glance-api] log_file /var/log/glance/api.log 2011-11-23 12:24:03 DEBUG [glance-api] notifier_strategy noop 2011-11-23 12:24:03 DEBUG [glance-api] rabbit_host localhost 2011-11-23 12:24:03 DEBUG [glance-api] rabbit_notification_topic glance_notifications 2011-11-23 12:24:03 DEBUG [glance-api] rabbit_password guest 2011-11-23 12:24:03 DEBUG [glance-api] rabbit_port 5672 2011-11-23 12:24:03 DEBUG [glance-api] rabbit_use_ssl false 2011-11-23 12:24:03 DEBUG [glance-api] rabbit_userid guest 2011-11-23 12:24:03 DEBUG [glance-api] rabbit_virtual_host / 2011-11-23 12:24:03 DEBUG [glance-api] registry_host 0.0.0.0 2011-11-23 12:24:03 DEBUG [glance-api] registry_port 9191 2011-11-23 12:24:03 DEBUG [glance-api] s3_store_access_key <20-char AWS access key> 2011-11-23 12:24:03 DEBUG [glance-api] s3_store_bucket <lowercased 20-char="" aws="" access="" key="">glance 2011-11-23 12:24:03 DEBUG [glance-api] s3_store_create_bucket_on_put False 2011-11-23 12:24:03 DEBUG [glance-api] s3_store_host 127.0.0.1:8080/v1.0/ 2011-11-23 12:24:03 DEBUG [glance-api] s3_store_secret_key <40-char AWS secret key> 2011-11-23 12:24:03 DEBUG [glance-api] swift_enable_snet False 2011-11-23 12:24:03 DEBUG [glance-api] swift_store_auth_address 127.0.0.1:8080/v1.0/ 2011-11-23 12:24:03 DEBUG [glance-api] swift_store_container glance 2011-11-23 12:24:03 DEBUG [glance-api] swift_store_create_container_on_put False 2011-11-23 12:24:03 DEBUG [glance-api] swift_store_key a86850deb2742ec3cb41518e26aa2d89 2011-11-23 12:24:03 DEBUG [glance-api] swift_store_large_object_chunk_size 200 2011-11-23 12:24:03 DEBUG [glance-api] swift_store_large_object_size 5120 2011-11-23 12:24:03 DEBUG [glance-api] swift_store_user jdoe 2011-11-23 12:24:03 DEBUG [glance-api] use_syslog False 2011-11-23 12:24:03 DEBUG [glance-api] verbose True 2011-11-23 12:24:03 DEBUG [glance-api] ************************* 2011-11-23 12:24:03 DEBUG [routes.middleware] Initialized with method overriding = True, and path info altering = True 2011-11-23 12:24:03 DEBUG [eventlet.wsgi.server] (15053) wsgi starting up on http://0.0.0.0:9292/ 2011-11-23 12:24:26 DEBUG [glance.api.middleware.version_negotiation] Processing request: POST /v1.1/2/images Accept: 2011-11-23 12:24:26 DEBUG [glance.api.middleware.version_negotiation] Unknown version in versioned URI: 1.1. Returning version choices. 2011-11-23 12:24:27 DEBUG [eventlet.wsgi.server] 127.0.0.1 - - [23/Nov/2011 12:24:27] "POST /v1.1/2/images HTTP/1.1" 300 339 0.883178

linux-rskn:/usr/lib64/python2.6/site-packages ... (more)

edit flag offensive delete link more
0

answered 2011-11-24 03:27:39 -0500

chnzzw gravatar image
  1. glance version: glance-2011.3.tar.gz GLANCE_VERSION = ['2011', '3']

2.keystone: keystone-1.0-py2.6.egg-info

I use the diablo version of the openstack including the nova,glance and the keystone. . I think that the glance is the newest version. what is the reason?

please give the way to solve the error.

Thanks.

edit flag offensive delete link more
0

answered 2011-11-25 17:24:17 -0500

jaypipes gravatar image

The URI that your client is attempting to hit is this:

/v1.1/2/images

That is not a valid Glance images URL. That looks like a Compute API URL (it includes the tenant "2" after a /v1.1/ version identifier.

I have a suspicion that your application pipeline is not set correctly. Could you please pastebin your glance-api.conf and glance-registry.conf please?

Thanks! -jay

edit flag offensive delete link more
0

answered 2011-11-26 08:33:53 -0500

chnzzw gravatar image

linux-iop5:~ # keystone-manage user list

id enabled tenant

1 1 None 2 1 None linux-iop5:~ # keystone-manage role list

id name

1 Admin 2 Member 3 KeystoneAdmin 4 KeystoneServiceAdmin linux-iop5:~ # keystone-manage tenant list

id name enabled

1 admin 1 2 demo 1 linux-iop5:~ # keystone-manage service list

id name type

1 nova compute 2 glance image 3 keystone identity linux-iop5:~ # keystone-manage endpointTemplates list All EndpointTemplates

service region Public URL

nova RegionOne http://127.0.0.1:8774/v1.1/%25tenant_id%25 (http://127.0.0.1:8774/v1.1/%tenant_id%) glance RegionOne http://127.0.0.1:9292/v1.1/%25tenant_id%25 (http://127.0.0.1:9292/v1.1/%tenant_id%) keystone RegionOne http://127.0.0.1:5000/v2.0 linux-iop5:~ #

edit flag offensive delete link more
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-11-26 08:48:11 -0500

chnzzw gravatar image

sqlite> select * from endpoint_templates; 1|RegionOne|1|http://127.0.0.1:8774/v1.1/%tenant_id%|http://127.0.0.1:8774/v1.1/%tenant_id%|http://127.0.0.1:8774/v1.1/%tenant_id%|1|1 2|RegionOne|2|http://127.0.0.1:9292/v1.1/%tenant_id%|http://127.0.0.1:9292/v1.1/%tenant_id%|http://127.0.0.1:9292/v1.1/%tenant_id%|1|1 3|RegionOne|3|http://127.0.0.1:5000/v2.0|http://127.0.0.1:35357/v2.0|http://127.0.0.1:5000/v2.0|1|1

edit flag offensive delete link more
0

answered 2011-12-10 18:05:05 -0500

thingee gravatar image

I'm also having the same problem mentioned above:

$ glance add -A $TOKEN name="image test" is_public=true < ~/image_test.iso --host=192.168.106.191 Failed to add image. Got error: The request returned a 302 Multiple Choices. This generally means that you have not included a version indicator in a request URI.

I've tried both removing %tenant_id% from the endpointTemplates for glance and passing the token...still no luck.

edit flag offensive delete link more
0

answered 2011-12-10 20:18:09 -0500

thingee gravatar image

Oh doi...yay late nights going into the morning. :)

Thanks for your reply Jay! Well unfortunately the problem is still present.

thingee@nibbler:~$ /opt/stack/glance/bin/glance -A $token add name="image test" is_public=true --host=192.168.106.191 < ~/image_test.iso Failed to add image. 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"}]}]} Note: Your image metadata may still be in the registry, but the image's status will likely be 'killed'. thingee@nibbler:~$ env | grep OS_AUTH OS_AUTH_USER=demo OS_AUTH_STRATEGY=keystone OS_AUTH_URL=http://127.0.0.1:5000/v2.0/ OS_AUTH_TENANT=demo OS_AUTH_KEY=secrete

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