Glance fails to authenticate unless directly passed an os_auth_token

Bug #989181 reported by James Kyle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Invalid
Undecided
James Kyle

Bug Description

Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise

ii glance 2012.1-0ubuntu2
ii glance-api 2012.1-0ubuntu2
ii glance-client 2012.1-0ubuntu2
ii glance-common 2012.1-0ubuntu2
ii glance-registry 2012.1-0ubuntu2
ii keystone 2012.1-0ubuntu1
ii python-glance 2012.1-0ubuntu2
ii python-keystone 2012.1-0ubuntu1
ii python-keystoneclient 2012.1-0ubuntu1

Behavior: Glance throws a 404 object not found error unless os_auth_token is retrieved manually and explicitly passed.

Environment:
% env | grep "OS\_"

OS_REGION_NAME=myregion
OS_PASSWORD=ospass
OS_AUTH_USER=myadmin
OS_AUTH_URL=http://127.0.0.1:5000/v2.0/
OS_USERNAME=myadmin
OS_TENANT_NAME=openstackDemo

Example:

% glance index

Failed to show index. Got error:
An object with the specified identifier was not found.
Details: 404 Not Found

The resource could not be found.

Retrieve auth token using same username and pass:

curl -d '{"auth": {"tenantName": "openstackDemo", "passwordCredentials": {"username": "myadmin", "password": "ospass"}}}' -H "Content-type: application/json" http://127.0.0.1:35357/v2.0/tokens | python -mjson.tool

       "token": {
            "expires": "2012-04-27T18:31:45Z",
            "id": "25768987345c436fa031d8f16072cbc8",
            "tenant": {
                "description": "Default Tenant",
                "enabled": true,
                "id": "65d487cc8d034cbc9b88c7d8840533b3",
                "name": "openstackDemo"
            }

Now, use the token:

% glance --os_auth_token=25768987345c436fa031d8f16072cbc8 index

ID Name Disk Format Container Format Size
------------------------------------ ------------------------------ -------------------- -------------------- --------------
92bb79d1-f7bb-48ea-a774-236fb2d5f268 tty-linux-ramdisk ari ari 96629
ecd759d8-3c06-43e2-97df-f0b193cc2141 tty-linux-kernel aki aki 4404752

====EDIT======

I inserted a print(self.auth_token) after glance.common.auth:243. The auth_body returns a valid token. If I pass that exact token to glance cli, query succeeds.

James Kyle (jkyle)
description: updated
Revision history for this message
James Kyle (jkyle) wrote :

Patch incoming.

Revision history for this message
James Kyle (jkyle) wrote :

Patch attached

James Kyle (jkyle)
Changed in glance:
assignee: nobody → james@jameskyle.org (jkyle)
Revision history for this message
Eoghan Glynn (eglynn) wrote :

Hi James,

Thanks for the bug report and patch.

Can you propose this fix for code review via gerrit?

    http://wiki.openstack.org/GerritWorkflow

Thanks,
Eoghan

Revision history for this message
James Kyle (jkyle) wrote :

This produces a new bug, I've changed the patch and will submit for review.

Revision history for this message
James Kyle (jkyle) wrote :

The Gerrit instructions are for git, but this is a bzr repository...I assume I should be using this: https://github.com/openstack/glance

Revision history for this message
Brian Waldon (bcwaldon) wrote :

James:

Did you have any luck getting set up with our code review system? I'd be more than happy to catch up with you on IRC and try to get you going.

Changed in glance:
status: New → Incomplete
Revision history for this message
Brian Waldon (bcwaldon) wrote :

James:

Trying to wrap my head around this bug...What auth url is being requested if you don't explicitly pass an auth token?

Revision history for this message
Brian Waldon (bcwaldon) wrote :

I debugged what appeared to be the same issue with rmk on IRC, and it ended up being a bad catalog entry in Keystone. Can you verify that your catalog is set up properly?

Revision history for this message
Brian Waldon (bcwaldon) wrote :

Anything?

Brian Waldon (bcwaldon)
Changed in glance:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.