Unreachable 'ImageSizeLimitExceeded' exception block in upload call

Bug #1734832 reported by Abhishek Kekane on 2017-11-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Undecided
Abhishek Kekane

Bug Description

ImageSizeLimitExceeded exception block [1] is unreachable in upload because
it is caught at [2] and raised StorageQuotaFull exception from there.

Further as it raised StorageQuataFull exception it prints None as a size in the glance-api logs.

Reference glance-api-logs:
Nov 28 07:04:13 devstack <email address hidden>[11453]: ERROR glance.api.v2.image_data [None req-17b243db-9b3d-46d9-97f0-05f74bc76e18 admin admin] Image exceeds the storage quota: The size of the data None will exceed the limit. None bytes remaining.: StorageQuotaFull: The size of the data None will exceed the limit. None bytes remaining.

To make it correct we need to remove code from [2] where ImageSizeLimitExceeded is caught and StorageQuotaFull is raised so that it will be reachable in the controller [1].

[1] https://github.com/openstack/glance/blob/master/glance/api/v2/image_data.py#L232
[2] https://github.com/openstack/glance/blob/master/glance/quota/__init__.py#L305

Changed in glance:
assignee: nobody → Abhishek Kekane (abhishek-kekane)

After making change as explained in the description it logs below error in glance-api logs:

Nov 28 08:59:25 devstack <email address hidden>[18318]: ERROR glance.api.v2.image_data [None req-818de15e-a968-4103-8666-1e187aa6bd19 admin admin] The incoming image is too large: The provided image is too large.: ImageSizeLimitExceeded: The provided image is too large.

Fix proposed to branch: master
Review: https://review.openstack.org/523366

Changed in glance:
status: New → In Progress
description: updated

After making changes as per mentioned in patch https://review.openstack.org/#/c/523366/2

May 30 04:47:44 ubuntu-old glance-api[31469]: DEBUG glance.api.v2.image_data [None req-1ff7caed-f610-485f-8c42-3ef7d92238e8 admin admin] The incoming image is too large: The provided image is too large.

If user creates image using glanceclient then following message will be printed on console:

413 Request Entity Too Large: The incoming image is too large: The provided image is too large. (HTTP 413)

Reviewed: https://review.openstack.org/523366
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=ffc3923e93dc1d4eea789ce5163d176efb7d685b
Submitter: Zuul
Branch: master

commit ffc3923e93dc1d4eea789ce5163d176efb7d685b
Author: Abhishek Kekane <email address hidden>
Date: Tue Nov 28 09:51:02 2017 +0000

    Fix unreachable 'ImageSizeLimitExceeded' exception in image-upload

    ImageSizeLimitExceeded exception block [1] is unreachable in upload because
    it is caught at [2] and raised StorageQuotaFull exception from there. The
    problem here is that we have nested usage of the limiting reader.

    To make it correct changed the limiting reader to accept
    exception class as parameter so that we can pass the StorageQuotaFull
    in case LimitingReader is used for quota check and ImageSizeExceeded exception
    if it is used for image size cap check.

    [1] https://github.com/openstack/glance/blob/fd16fa4f258fd3f77c14900a019e97bb90bc5ac0/glance/api/v2/image_data.py#L230
    [2] https://github.com/openstack/glance/blob/fd16fa4f258fd3f77c14900a019e97bb90bc5ac0/glance/quota/__init__.py#L305

    Closes-Bug: #1734832
    Change-Id: I5a419b763bee7f983c2a94c6f3a2245281e86743

Changed in glance:
status: In Progress → Fix Released

This issue was fixed in the openstack/glance 17.0.0.0b2 development milestone.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers