Exceptions Error and ResourceFailure cannot be serialized over RPC

Bug #1304743 reported by Steve Baker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Jeff Peeler

Bug Description

Deserialization silently fails for these exceptions because their __init__ methods have mandatory arguments.

This results in heat-api treating these exceptions as unknown and logging a stack trace.

The fix for this bug should include tests which put every subclass of HeatException through rpc_common.serialize_remote_exception and rpc_common.deserialize_remote_exception to ensure they can all be deserialized.

description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to heat (master)

Reviewed: https://review.openstack.org/86195
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=712faf1717760da16a60e9528a564b6dcd6acddc
Submitter: Jenkins
Branch: master

commit 712faf1717760da16a60e9528a564b6dcd6acddc
Author: Steve Baker <email address hidden>
Date: Wed Apr 9 14:38:48 2014 +1200

    Allow NotFound to be created without args

    It appears that the serialization used to wrap RPC exceptions
    requires that the class be instantiated without any arguments.

    Since the NotFound exception required a msg_fmt it could not be
    deserialized in heat-api, which lead to no mapping in the FaultWrapper
    so a 500 was raised instead of a 404.

    This change adds a default value for msg_fmt for the NotFound exception.

    The classes Error and ResourceFailure likely have this issue too, but it
    is not as serious since they will raise a 500 error anyway.

    Config/deployment API tests now check that NotFound can be deserialized by
    calling to_remote_error, and checks that FaultWrapper converts that to
    HTTPNotFound.

    Change-Id: Ieb8de26465cb26aa015f15c134f80a06ebcae95c
    Closes-Bug: #1301657
    Related-Bug: #1304743

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to heat (stable/icehouse)

Related fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/95917

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to heat (stable/icehouse)

Reviewed: https://review.openstack.org/95917
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=08154b043c35a00e911592d63f648e654e14baa6
Submitter: Jenkins
Branch: stable/icehouse

commit 08154b043c35a00e911592d63f648e654e14baa6
Author: Steve Baker <email address hidden>
Date: Wed Apr 9 14:38:48 2014 +1200

    Allow NotFound to be created without args

    It appears that the serialization used to wrap RPC exceptions
    requires that the class be instantiated without any arguments.

    Since the NotFound exception required a msg_fmt it could not be
    deserialized in heat-api, which lead to no mapping in the FaultWrapper
    so a 500 was raised instead of a 404.

    This change adds a default value for msg_fmt for the NotFound exception.

    The classes Error and ResourceFailure likely have this issue too, but it
    is not as serious since they will raise a 500 error anyway.

    Config/deployment API tests now check that NotFound can be deserialized by
    calling to_remote_error, and checks that FaultWrapper converts that to
    HTTPNotFound.

    Change-Id: Ieb8de26465cb26aa015f15c134f80a06ebcae95c
    Closes-Bug: #1301657
    Related-Bug: #1304743

tags: added: in-stable-icehouse
Alan Pevec (apevec)
tags: removed: in-stable-icehouse
Thierry Carrez (ttx)
Changed in heat:
milestone: juno-1 → juno-2
Revision history for this message
Zane Bitter (zaneb) wrote :

ResourceFailure should always be caught and never bubble up to the RPC layer. If we see it in heat-api, we probably *should* log a stack trace.

Revision history for this message
Steven Hardy (shardy) wrote :

Is this actually fixed by the related fixes above, or are we still pending further patches?

Steven Hardy (shardy)
Changed in heat:
milestone: juno-2 → juno-3
Thierry Carrez (ttx)
Changed in heat:
milestone: juno-3 → juno-rc1
Jeff Peeler (jpeeler-z)
Changed in heat:
assignee: nobody → Jeff Peeler (jpeeler-z)
Jeff Peeler (jpeeler-z)
Changed in heat:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Revision history for this message
Zane Bitter (zaneb) wrote :

AIUI the bug is fixed, and we're just waiting for some extra tests (which Jeff has proposed).

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/122274
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=31960a92d16c1d5aeaaea9858a92ac3c63b24137
Submitter: Jenkins
Branch: master

commit 31960a92d16c1d5aeaaea9858a92ac3c63b24137
Author: Jeff Peeler <email address hidden>
Date: Wed Sep 17 17:09:32 2014 -0400

    Add test to serialize and deserialize exceptions

    Every subclass of HeatException is serialized and then deserialized.
    For those classes which don't have a special init method, a generic
    inspection is done to test each class. There are four exceptions
    that are different, so their arguments are manually constructed.

    Change-Id: I9bb21d134f8997c478cd4ee8ef0031e03b053204
    Closes-Bug: #1304743

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: juno-rc1 → 2014.2
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.