Non-deterministic failure with certain sequence of calls to glanceclient

Bug #1392853 reported by David Kranz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Invalid
Undecided
Unassigned

Bug Description

This is very strange. Running the following script in glanceclient 0.14.1 will often but not always result in an unexpected HttpBadRequest. The script does not fail if the upload call is comment out, or if the glance client object is re-created between the upload and get. This was run against icehouse.

import glanceclient as glance_client
import keystoneclient.v2_0.client as keystone_client

kc = keystone_client.Client(username="admin",
                            password="xxxxxxxxx",
                            tenant_name="admin",
                            auth_url="http://x.y.z.w:35357/v2.0/",
                            insecure=False)
token = kc.auth_token
catalog = kc.service_catalog
endpoint = catalog.url_for(service_type='image',
                           endpoint_type='publicURL')
ic = glance_client.Client("1", endpoint=endpoint,
                          token=token,
                          insecure=False)

def list():
    print "getting"
    try:
        return ic.images.get("xxxx")
    except glance_client.exc.HTTPNotFound:
        pass

def upload():
    print "uploading"
    with open("/etc/hosts") as data:
        return ic.images.create(name="yyyy", disk_format="qcow2",
                                container_format="bare",
                                data=data, is_public="true")

upload()
list()

Revision history for this message
David Kranz (david-kranz) wrote :

The other strange thing about this is that when it fails, the upload actually happens but there is no visible call to GET in the glance-api server log. There is a call to GET when it succeeds. I am not 100% positive this bug is just in the client.

Revision history for this message
David Kranz (david-kranz) wrote :

I investigated a little more and it seems the problem is with the requests library. I was using 1.2.3 which should be ok according to the requirements.txt

requests>=1.2.1,!=2.4.0

but it fails as described in this ticket with 1.2.3.

Revision history for this message
Alan Pevec (apevec) wrote :

requests was bumped in global-requirements.txt to 2.2.0 post-Juno, but looks like it was already at that level during the whole Juno cycle :(
https://github.com/openstack/requirements/commit/7d8b2bd69a47ecf170af7c3d9cc46c8cde307aed

We clearly need something to test minimal boundaries in requirements.

Revision history for this message
Alan Pevec (apevec) wrote :

> I was using 1.2.3

Which OS was that and where did you get python-requests 1.2.3 from?

Changed in python-glanceclient:
status: New → Incomplete
Revision history for this message
Ian Cordasco (icordasc) wrote :

This appears to have been marked as incomplete for over two years. Further, python-requests now has a much higher lower bound and Juno is EOL (as is Kilo). I'm closing this as invalid since it no longer affects supported python-glanceclient versions.

Changed in python-glanceclient:
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.