← Back to team overview

openstack team mailing list archive

401 not authorized with glance

 

Hi
I configured glance and swift + keystone backend. The username and password I picked are (glanceadmin, verybadpass) and (swiftadmin, verybadpass). 

I think I varified the user name password and rights with the following command. But "glance add" still gives me the "401 not authorized" message. 
Thanks in advance for your help.


[root@keystone glance]# swift -v -V 2.0 -A http://127.0.0.1:5000/v2.0/ -U service:glanceadmin -K verybadpass statStorageURL: http://127.0.0.1:8080/v1/AUTH_8baec00689c64b0791d2a5a4f110575a
Auth Token: 5346c5ba184840c1a95d762ebec86405
   Account: AUTH_8baec00689c64b0791d2a5a4f110575a
Containers: 1
   Objects: 0
     Bytes: 0
Accept-Ranges: bytes
X-Trans-Id: txe9e92ce3dec14e2cae71e8372bd42dcb


[root@keystone glance]# curl -d '{"auth": {"tenantName": "service", "passwordCredentials":{"username": "glanceadmin", "password": "verybadpass"}}}' -H "Content-type: application/json"  http://127.0.0.1:35357/v2.0/tokens | python -mjson.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2255    0  2142  100   113  11680    616 --:--:-- --:--:-- --:--:-- 11704
{
    "access": {
        "serviceCatalog": [
            {
                "endpoints": [
                    {
                        "adminURL": "http://localhost:8774/v1.1/8baec00689c64b0791d2a5a4f110575a";;, 
                        "internalURL": "http://localhost:8774/v1.1/8baec00689c64b0791d2a5a4f110575a";;, 
                        "publicURL": "http://localhost:8774/v1.1/8baec00689c64b0791d2a5a4f110575a";;, 
                        "region": "RegionOne"
                    }
                ], 
                "endpoints_links": [], 
                "name": "nova", 
                "type": "compute"
            }, 
            {
                "endpoints": [
                    {
                        "adminURL": "http://localhost:9292/v1";;, 
                        "internalURL": "http://localhost:9292/v1";;, 
                        "publicURL": "http://localhost:9292/v1";;, 
                        "region": "RegionOne"
                    }
                ], 
                "endpoints_links": [], 
                "name": "glance", 
                "type": "image"
            }, 
            {
                "endpoints": [
                    {
                        "adminURL": "http://localhost:8776/v1/8baec00689c64b0791d2a5a4f110575a";;, 
                        "internalURL": "http://localhost:8776/v1/8baec00689c64b0791d2a5a4f110575a";;, 
                        "publicURL": "http://localhost:8776/v1/8baec00689c64b0791d2a5a4f110575a";;, 
                        "region": "RegionOne"
                    }
                ], 
                "endpoints_links": [], 
                "name": "nova-volume", 
                "type": "volume"
            }, 
            {
                "endpoints": [
                    {
                        "adminURL": "http://localhost:8773/services/Admin";;, 
                        "internalURL": "http://localhost:8773/services/Cloud";;, 
                        "publicURL": "http://localhost:8773/services/Cloud";;, 
                        "region": "RegionOne"
                    }
                ], 
                "endpoints_links": [], 
                "name": "ec2", 
                "type": "ec2"
            }, 
            {
                "endpoints": [
                    {
                        "adminURL": "http://127.0.0.1:8080/v1/AUTH_8baec00689c64b0791d2a5a4f110575a";;, 
                        "internalURL": "http://127.0.0.1:8080/v1/AUTH_8baec00689c64b0791d2a5a4f110575a";;, 
                        "publicURL": "http://127.0.0.1:8080/v1/AUTH_8baec00689c64b0791d2a5a4f110575a";;, 
                        "region": "regionOne"
                    }
                ], 
                "endpoints_links": [], 
                "name": "swift", 
                "type": "object-store"
            }, 
            {
                "endpoints": [
                    {
                        "adminURL": "http://localhost:35357/v2.0";;, 
                        "internalURL": "http://localhost:35357/v2.0";;, 
                        "publicURL": "http://localhost:5000/v2.0";;, 
                        "region": "RegionOne"
                    }
                ], 
                "endpoints_links": [], 
                "name": "keystone", 
                "type": "identity"
            }
        ], 
        "token": {
            "expires": "2012-05-04T19:01:27Z", 
            "id": "8bb7add1ae4c4396bf974082604248fc", 
            "tenant": {
                "description": null, 
                "enabled": true, 
                "id": "8baec00689c64b0791d2a5a4f110575a", 
                "name": "service"
            }
        }, 
        "user": {
            "id": "8d79596669964ae483265b15c8672f6d", 
            "name": "glanceadmin", 
            "roles": [
                {
                    "id": "227ca9ac2e784195b6d276601a4b6a2d", 
                    "name": "admin"
                }
            ], 
            "roles_links": [], 
            "username": "glanceadmin"
        }
    }
}
[root@keystone glance]# 

[root@keystone glance]# curl -v -H 'X-Auth-Token: 8bb7add1ae4c4396bf974082604248fc' http://127.0.0.1:8080/v1/AUTH_8baec00689c64b0791d2a5a4f110575a
* About to connect() to 127.0.0.1 port 8080 (#0)
*   Trying 127.0.0.1...
* connected
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET /v1/AUTH_8baec00689c64b0791d2a5a4f110575a HTTP/1.1
> User-Agent: curl/7.24.0 (x86_64-redhat-linux-gnu) libcurl/7.24.0 NSS/3.13.3.0 zlib/1.2.5 libidn/1.24 libssh2/1.4.1
> Host: 127.0.0.1:8080
> Accept: */*
> X-Auth-Token: 8bb7add1ae4c4396bf974082604248fc
> 
< HTTP/1.1 200 OK
< X-Account-Object-Count: 0
< X-Account-Bytes-Used: 0
< X-Account-Container-Count: 1
< Accept-Ranges: bytes
< Content-Length: 7
< Content-Type: text/plain; charset=utf-8
< X-Trans-Id: tx691dd298c0414cd6b818bbc628bc05a5
< Date: Thu, 03 May 2012 19:02:46 GMT
< 
glance
* Connection #0 to host 127.0.0.1 left intact
* Closing connection #0
[root@keystone glance]#  glance -A 8bb7add1ae4c4396bf974082604248fc -I glanceadmin  -K verybadpass -T service add name=f16-heos is_public=true disk_format=qcow2 container_format=ovf copy_from=http://berrange.fedorapeople.org/images/2012-02-29/f16-x86_64-openstack-sda.qcow2
Failed to add image. Got error:
Data supplied was not valid.
Details: 400 Bad Request

The server could not comply with the request since it is either malformed or otherwise incorrect.

 Error uploading image: (ClientException): Auth GET failed: http://127.0.0.1:5000/v2.0/tokens 401 Not Authorized  
Note: Your image metadata may still be in the registry, but the image's status will likely be 'killed'.