ImageDownloadFailed exception passed incorrect argument

Bug #1811184 reported by Brian Rosmaita
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Brian Rosmaita
Rocky
Fix Committed
Undecided
Brian Rosmaita

Bug Description

This requires some backstory.

I want to backport the fix for Bug #1799221 to Queens, but that requires backporting an exception introduced as part of the fix to Bug #1798147. But it seems dumb to backport only the exception and not the small, isolated code that fixes the bug for which the exception was introduced (which was backported to Rocky, by the way).

However, change If7c22ac4516f8c2a6ccd8bf6b6ed98409312b138 that fixed Bug #1798147 did not contain any tests. I figured it would increase the odds of the stable cores approving the backport if I added a test, but in adding the test, I noticed that the code fixing Bug #1798147 is passing the context to the exception instead of the image_id, which makes for an ugly and uninformative exception message, to wit:

Failed to download image <cinder.context.RequestContext object at 0x7fa67a870210>, reason: image contains no data.

So. the patch that adds a test for Bug #1798147 should also fix the code so that it passes the image_id when it creates the exception instead of the context.

And that patch should be backported to Rocky so it can fix the code there.

The backport to Queens will actually be more complicated, but I'll discuss that in a comment on Bug #1799221.

Changed in cinder:
assignee: nobody → Brian Rosmaita (brian-rosmaita)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/629766
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=16b4346171d2027bb3c2630d5f28f6f002878870
Submitter: Zuul
Branch: master

commit 16b4346171d2027bb3c2630d5f28f6f002878870
Author: Brian Rosmaita <email address hidden>
Date: Wed Jan 9 23:37:29 2019 -0500

    Pass image_id to ImageDownloadFailed

    When an ImageDownloadFailed exception is created in the
    GlanceImageService, it's being passed the context whereas what
    makes sense for the error message is the image_id. This patch
    makes the change and adds a unit test for a previous fix for
    Bug #1798147 (which was the real point of this patch).

    Change-Id: I6d8dedfd056add3414f8f4bf7f7279eae4763286
    Closes-bug: #1811184

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/631997

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/rocky)

Reviewed: https://review.openstack.org/631997
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=844b627c38bb810abd3ef0b464577191f193ad7d
Submitter: Zuul
Branch: stable/rocky

commit 844b627c38bb810abd3ef0b464577191f193ad7d
Author: Brian Rosmaita <email address hidden>
Date: Wed Jan 9 23:37:29 2019 -0500

    Pass image_id to ImageDownloadFailed

    When an ImageDownloadFailed exception is created in the
    GlanceImageService, it's being passed the context whereas what
    makes sense for the error message is the image_id. This patch
    makes the change and adds a unit test for a previous fix for
    Bug #1798147 (which was the real point of this patch).

    Change-Id: I6d8dedfd056add3414f8f4bf7f7279eae4763286
    Closes-bug: #1811184
    (cherry picked from commit 16b4346171d2027bb3c2630d5f28f6f002878870)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to cinder (stable/queens)
Download full text (3.8 KiB)

Reviewed: https://review.openstack.org/629463
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=937af5be0e7c17b34860e25cc434a219d7143387
Submitter: Zuul
Branch: stable/queens

commit 937af5be0e7c17b34860e25cc434a219d7143387
Author: Francois Deppierraz <email address hidden>
Date: Mon Oct 22 15:33:25 2018 +0200

    cinder-volume: Stop masking IOError different than ENOSPC

    When glanceclient raises an IOError with a different errno than ENOSPC,
    cinder-volume silently masked it and continued its volume creation
    process. The result was volumes with invalid content being successfuly
    created.

    With the patch, an ImageDownloadFailed exception is raised in this case,
    which makes the volume creation process fail and gives enough
    information to operators for troubleshooting.

    As explained in detail below, this patch is a squash of four cherry
    picks to fix Bug #1799221. The cherry-picks are being squashed
    instead of done separately per normal cinder practice because they
    are dependent; this will make sure that one of them isn't further
    backported without the supporting patches.

    Here's the relationship between the four cherry-picks:
    (1) The purpose of this backport is to fix Bug #1799221, which was
        introduced in Pike. It is fixed in Stein and Rocky by
        Ic011fe30b4840e5098db1a594ea276ec98768bff
    (2) That change requires an exception introduced in Stein and backported
        to Rocky by If7c22ac4516f8c2a6ccd8bf6b6ed98409312b138 to fix Bug
        #1798147 (which defect is also present in Queens and Pike)
    (3) The change in (2) introduced Bug #1808443 which was fixed in Stein
        and Rocky by I6d8dedfd056add3414f8f4bf7f7279eae4763286
    (4) The change in (2) also introduced Bug #1811184, which is fixed by
        I6d8dedfd056add3414f8f4bf7f7279eae4763286 in Stein and Rocky, and
        which adds a unit test for Bug #1798147.
    In short, in order to backport the fix for (1), we need to backport (2),
    but in order to backport (2) we need to follow up immediately with
    backports of (3) and (4) to fix the defects (2) introduces.

    The attentive reader will note that this patch smuggles in the fix for
    Bug #1798147. We could have left this out, but it's a very small
    isolated change, the defect is present in Queens and Pike (remember that
    Bug #1799221, the subject of this patch, was introduced in Pike), and it
    has a unit test (see (4), above). Finally, leaving out the fix for
    Bug #1798147 and backporting only the exception would still require
    backporting the fixes for Bug #1808443 and Bug #1811184, so it really
    would not simplify this patch.

    To summarize what's being included here:
    commit changeId fixed bug
    805368e If7c22ac4516f8c2a6ccd8bf6b6ed98409312b138 Bug #1798147
    9c696ce I2aa56da73660794c6dedcbb8a66e84bcec511a9c Bug #1808443
    844b627 I6d8dedfd056add3414f8f4bf7f7279eae4763286 Bug #1811184
    bf89f76 Ic011fe30b4840e5098db1a594ea276ec98768bff Bug #1799221

    Change-Id: Ic011fe30b4840e5098db1a594ea276ec98768bf...

Read more...

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to cinder (stable/pike)

Related fix proposed to branch: stable/pike
Review: https://review.openstack.org/633015

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 13.0.3

This issue was fixed in the openstack/cinder 13.0.3 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to cinder (stable/pike)
Download full text (3.9 KiB)

Reviewed: https://review.openstack.org/633015
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=0551f0a9ff7b787fcb3e1b686b83e25f99cad874
Submitter: Zuul
Branch: stable/pike

commit 0551f0a9ff7b787fcb3e1b686b83e25f99cad874
Author: Francois Deppierraz <email address hidden>
Date: Mon Oct 22 15:33:25 2018 +0200

    cinder-volume: Stop masking IOError different than ENOSPC

    When glanceclient raises an IOError with a different errno than ENOSPC,
    cinder-volume silently masked it and continued its volume creation
    process. The result was volumes with invalid content being successfuly
    created.

    With the patch, an ImageDownloadFailed exception is raised in this case,
    which makes the volume creation process fail and gives enough
    information to operators for troubleshooting.

    As explained in detail below, this patch is a squash of four cherry
    picks to fix Bug #1799221. The cherry-picks are being squashed
    instead of done separately per normal cinder practice because they
    are dependent; this will make sure that one of them isn't further
    backported without the supporting patches.

    Here's the relationship between the four cherry-picks:
    (1) The purpose of this backport is to fix Bug #1799221, which was
        introduced in Pike. It is fixed in Stein and Rocky by
        Ic011fe30b4840e5098db1a594ea276ec98768bff
    (2) That change requires an exception introduced in Stein and backported
        to Rocky by If7c22ac4516f8c2a6ccd8bf6b6ed98409312b138 to fix Bug
        #1798147 (which defect is also present in Queens and Pike)
    (3) The change in (2) introduced Bug #1808443 which was fixed in Stein
        and Rocky by I6d8dedfd056add3414f8f4bf7f7279eae4763286
    (4) The change in (2) also introduced Bug #1811184, which is fixed by
        I6d8dedfd056add3414f8f4bf7f7279eae4763286 in Stein and Rocky, and
        which adds a unit test for Bug #1798147.
    In short, in order to backport the fix for (1), we need to backport (2),
    but in order to backport (2) we need to follow up immediately with
    backports of (3) and (4) to fix the defects (2) introduces.

    The attentive reader will note that this patch smuggles in the fix for
    Bug #1798147. We could have left this out, but it's a very small
    isolated change, the defect is present in Queens and Pike (remember that
    Bug #1799221, the subject of this patch, was introduced in Pike), and it
    has a unit test (see (4), above). Finally, leaving out the fix for
    Bug #1798147 and backporting only the exception would still require
    backporting the fixes for Bug #1808443 and Bug #1811184, so it really
    would not simplify this patch.

    To summarize what's being included here:
    commit changeId fixed bug
    805368e If7c22ac4516f8c2a6ccd8bf6b6ed98409312b138 Bug #1798147
    9c696ce I2aa56da73660794c6dedcbb8a66e84bcec511a9c Bug #1808443
    844b627 I6d8dedfd056add3414f8f4bf7f7279eae4763286 Bug #1811184
    bf89f76 Ic011fe30b4840e5098db1a594ea276ec98768bff Bug #1799221

    Change-Id: Ic011fe30b4840e5098db1a594ea276ec98768bff
...

Read more...

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 14.0.0.0rc1

This issue was fixed in the openstack/cinder 14.0.0.0rc1 release candidate.

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.