NotFound on deployment operation returns 500 REST response

Bug #1301657 reported by Steve Baker
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Steve Baker
Icehouse
Fix Released
High
Steve Baker

Bug Description

This is preventing a stack from being deleted when it contains a deployment resource but there is no deployment database record.

from heat-api when showing a deployment which is already deleted:

ERROR root [-] Unexpected error occurred serving API: Remote error: NotFound Deployment with i
d 41bc8585-8e7d-4cf0-89de-ec7dc5577680 not found
[u'Traceback (most recent call last):\n', u' File "/home/steveb/dev/localstack/heat/heat/engine/service.py", line 63,
 in wrapped\n return func(self, ctx, *args, **kwargs)\n', u' File "/home/steveb/dev/localstack/heat/heat/engine/se
rvice.py", line 1143, in show_software_deployment\n sd = db_api.software_deployment_get(cnxt, deployment_id)\n', u'
  File "/home/steveb/dev/localstack/heat/heat/db/api.py", line 250, in software_deployment_get\n return IMPL.softwa
re_deployment_get(context, deployment_id)\n', u' File "/home/steveb/dev/localstack/heat/heat/db/sqlalchemy/api.py", l
ine 671, in software_deployment_get\n deployment_id)\n', u'NotFound: Deployment with id 41bc8585-8e7d-4cf0-89de-ec7
dc5577680 not found\n'].

Changed in heat:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Steve Baker (steve-stevebaker)
milestone: none → juno-1
Changed in heat:
milestone: juno-1 → icehouse-rc2
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

This is preventing a stack from being deleted when it contains a deployment resource but there is no deployment database record.

description: updated
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/86195

Changed in heat:
status: Triaged → In Progress
Changed in heat:
milestone: icehouse-rc2 → juno-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : 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

Changed in heat:
status: In Progress → Fix Committed
Revision history for this message
Kiall Mac Innes (kiall) wrote :

This bug exists in icehouse too, the fix should be backported :)

tags: added: icehouse-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/icehouse)

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

Alan Pevec (apevec)
tags: removed: icehouse-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : 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

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