Ask Your Question
0

glance unknown accept header ?

asked 2013-07-22 13:27:37 -0600

Eduard Barrera gravatar image

updated 2014-02-23 18:09:16 -0600

rahmu gravatar image

Hi All,

I'm installing openstack and I'm having a problem with glance, can someone point me in the right direction ?

What I'm doing wrong ?

Thanks in advance!

I'm using the following versions:

openstack-keystone-2012.1.3-3.fc17.noarch
openstack-utils-2013.1-7.fc17.noarch
openstack-glance-2012.1.2-2.fc17.noarch

And this is the command and the output:

#[root@localhost ~]# glance index
/usr/lib/python2.7/site-packages/webob/dec.py:142: DeprecationWarning: Response.request and Response.environ are deprecated
  req.response.request = req
/usr/lib/python2.7/site-packages/webob/dec.py:142: DeprecationWarning: Response.request and Response.environ are deprecated
  req.response.request = req
2013-07-20 14:26:20 6771    DEBUG [glance.api.middleware.version_negotiation] Processing request: GET /images Accept: 
2013-07-20 14:26:20 6771    DEBUG [glance.api.middleware.version_negotiation] Unknown accept header: ...returning version choices.
2013-07-20 14:26:20 6771    DEBUG [eventlet.wsgi.server] 127.0.0.1 - - [20/Jul/2013 14:26:20] "GET /images?limit=10 HTTP/1.1" 300 343 0.001660
Traceback (most recent call last):
  File "/bin/glance", line 1048, in <module>
    result = command(options, args)
  File "/bin/glance", line 63, in wrapper
    ret = func(*args, **kwargs)
  File "/bin/glance", line 559, in images_index
    print_header=True)
  File "/bin/glance", line 501, in _images_index
    images = client.get_images(**parameters)
  File "/usr/lib/python2.7/site-packages/glance/client.py", line 60, in get_images
    res = self.do_request("GET", "/images", params=params)
  File "/usr/lib/python2.7/site-packages/glance/common/client.py", line 58, in wrapped
    return func(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/glance/common/client.py", line 420, in do_request
    headers=headers)
  File "/usr/lib/python2.7/site-packages/glance/common/client.py", line 75, in wrapped
    return func(self, method, url, body, headers)
  File "/usr/lib/python2.7/site-packages/glance/common/client.py", line 549, in _do_request
    raise exception.MultipleChoices(body=res.read())
glance.common.exception.MultipleChoices: 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://127.0.0.1:9292/v1/", "rel": "self"}]}, {"status": "SUPPORTED", "id": "v1.0", "links": [{"href": "http://127.0.0.1:9292/v1/", "rel": "self"}]}]}

Here's my environment

#env
OS_PASSWORD=mypassword
OS_AUTH_URL=http://localhost:5000/v2.0/
OS_USERNAME=admin
OS_TENANT_NAME=mytenant
SERVICE_ENDPOINT=http://127.0.0.1:35357/v2.0
SERVICE_TOKEN=myauthtoken

#glance config


2013-07-21 11:32:55 6771    DEBUG [glance.api.middleware.version_negotiation] Processing request: GET /images Accept: 
2013-07-21 11:32:55 6771    DEBUG [glance.api.middleware.version_negotiation] Unknown accept header: ...returning version choices.
2013-07-21 11:32:55 6771    DEBUG [eventlet.wsgi.server] 127.0.0.1 - - [21/Jul/2013 11:32:55] "GET /images?limit=10 HTTP/1.1" 300 343 0.001110
2013-07-21 11:34:17 6771    DEBUG [glance.api.middleware.version_negotiation] Processing request: GET /images Accept: 
2013-07-21 11:34:17 6771    DEBUG [glance.api.middleware.version_negotiation] Unknown accept header: ...returning version choices.
2013-07-21 11:34:17 6771    DEBUG ...
(more)
edit retag flag offensive close merge delete

Comments

Are you using ceph as backend etorage?

Alen Komljen gravatar imageAlen Komljen ( 2013-07-29 03:20:46 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-02-23 18:10:40 -0600

rahmu gravatar image

glance index is deprecated. You should use glance image-list instead. Here's the help:

$ glance help image-list
usage: glance image-list [--name <NAME>] [--status <STATUS>]
                         [--container-format <CONTAINER_FORMAT>]
                         [--disk-format <DISK_FORMAT>] [--size-min <SIZE>]
                         [--size-max <SIZE>] [--property-filter <KEY=VALUE>]
                         [--page-size <SIZE>] [--human-readable]
                         [--sort-key {name,status,container_format,disk_format,size,id,created_at,updated_at}]
                         [--sort-dir {asc,desc}] [--is-public {True,False}]
                         [--owner <TENANT_ID>] [--all-tenants]

List images you can access.

Optional arguments:
  --name <NAME>         Filter images to those that have this name.
  --status <STATUS>     Filter images to those that have this status.
  --container-format <CONTAINER_FORMAT>
                        Filter images to those that have this container
                        format. Acceptable formats: ami, ari, aki, bare, and
                        ovf.
  --disk-format <DISK_FORMAT>
                        Filter images to those that have this disk format.
                        Acceptable formats: ami, ari, aki, vhd, vmdk, raw,
                        qcow2, vdi, and iso.
  --size-min <SIZE>     Filter images to those with a size greater than this.
  --size-max <SIZE>     Filter images to those with a size less than this.
  --property-filter <KEY=VALUE>
                        Filter images by a user-defined image property.
  --page-size <SIZE>    Number of images to request in each paginated request.
  --human-readable      Print image size in a human-friendly format.
  --sort-key {name,status,container_format,disk_format,size,id,created_at,updated_at}
                        Sort image list by specified field.
  --sort-dir {asc,desc}
                        Sort image list in specified direction.
  --is-public {True,False}
                        Allows the user to select a listing of public or non
                        public images.
  --owner <TENANT_ID>   Display only images owned by this tenant id. Filtering
                        occurs on the client side so may be inefficient. This
                        option is mainly intended for admin use. Use an empty
                        string ('') to list images with no owner. Note: This
                        option overrides the --is-public argument if present.
                        Note: the v2 API supports more efficient server-side
                        owner based filtering.
  --all-tenants         Allows the admin user to list all images irrespective
                        of the image's owner or is_public value.
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-07-22 13:27:37 -0600

Seen: 715 times

Last updated: Feb 23 '14