Image v1 json client timeout while checking that image was deleted

Bug #1373073 reported by Roman Sokolkov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Invalid
Undecided
Unassigned
tempest
Invalid
Undecided
Unassigned

Bug Description

Description:
- Icehouse Openstack cloud
- Tempest commit 4b1b8cfd4526203e5706ec387cf6362ecaa5ed5b

I'm getting tearDown class error after executing image tests

<testcase classname="" name="tearDownClass (tempest.api.image.v1.test_images.CreateRegisterImagesTest)" time="0.000">
<failure type="testtools.testresult.real._StringException">_StringException: Traceback (most recent call last):
  File "/home/user/WF_tempest/tempest-icehouse/tempest/api/image/base.py", line 58, in tearDownClass
    cls.client.wait_for_resource_deletion(image_id)
  File "/home/user/WF_tempest/tempest-icehouse/tempest/common/rest_client.py", line 551, in wait_for_resource_deletion
    raise exceptions.TimeoutException
TimeoutException: Request timed out

After some investiogation, i've found that client tried to check deleted VM by

    def is_resource_deleted(self, id):
        try:
            self.get_image_meta(id)
        except exceptions.NotFound:
            return True
        return False

But get_image_meta able to get metadata of deleted image, it just has status = deleted.

My quick fix was:

    def is_resource_deleted(self, id):
        try:
            _, meta = self.get_image_meta(id)
            if meta['status'] == 'deleted':
                return True
        except exceptions.NotFound:
            return True
        return False

Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :

Glance shows deleted images when doing a show or a list with a filter such as the "changes-since" filter .
With Admin credential, by default deleted image is visible with show but with non-admin credential show will not show the deleted image. If show is run as non-admin credential then, It will return NotFound error.

Tempest images tests are run as non-admin credential and expect NotFound from self.get_image_meta(id) (when image is deleted) which is correct.

IMO, there is no issue in Tempest's is_resource_deleted(self, id) function. If this could have been the issue as mentioned by you in quick fix then, it should fail every time. On gate those tests pass.

Can you please provide glance log so that timeout error can be debugged more?

Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :

Above is comment valid if we get image through nova or glance V1 API.

for Glance V2 API, I think glance does not provide the deleted images in SHOW API. Images has been fetched from image repo with 'force_show_deleted' param as false (default value) - https://github.com/openstack/glance/blob/master/glance/api/v2/images.py#L111

Changed in tempest:
status: New → Invalid
Revision history for this message
Roman Sokolkov (rsokolkov) wrote :

I could confirm that it was because of admin rights that user had. Looks like the bug is invalid

Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :

Thanks Roman for confirmation.

Changed in glance:
status: New → Invalid
Jun Hong Li (junhongl)
information type: Public → Public Security
information type: Public Security → Public
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.