HostBinaryNotFound exception isn't caught in service_update

Bug #1273139 reported by Haiwei Xu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Haiwei Xu

Bug Description

When I update a service with not existing hostname or binary , I got the 500 error in nova api log.

2014-01-28 03:15:29.829 ERROR nova.api.openstack.extensions [req-5b1f3fc5-349a-4415-a4f5-63eab1c259a0 admin demo] Unexpected exception in API method
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions Traceback (most recent call last):
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/openstack/extensions.py", line 470, in wrapped
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions return f(*args, **kwargs)
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/openstack/compute/plugins/v3/services.py", line 172, in update
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions self.host_api.service_update(context, host, binary, status_detail)
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/compute/api.py", line 3122, in service_update
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions binary)
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/objects/base.py", line 112, in wrapper
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions result = fn(cls, context, *args, **kwargs)
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/objects/service.py", line 105, in get_by_args
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions db_service = db.service_get_by_args(context, host, binary)
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/db/api.py", line 131, in service_get_by_args
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions return IMPL.service_get_by_args(context, host, binary)
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 112, in wrapper
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions return f(*args, **kwargs)
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 469, in service_get_by_args
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions raise exception.HostBinaryNotFound(host=host, binary=binary)
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions HostBinaryNotFound: Could not find binary nova-cert on host xu-de.
2014-01-28 03:15:29.829 TRACE nova.api.openstack.extensions

Haiwei Xu (xu-haiwei)
Changed in nova:
assignee: nobody → Haiwei Xu (xu-haiwei)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: New → In Progress
summary: - HostBinaryNotFound exception isn't catched in service_update
+ HostBinaryNotFound exception isn't caught in service_update
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/69342
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=a6d28e811ad916d686e350ce2dd8f6b8b0e128d6
Submitter: Jenkins
Branch: master

commit a6d28e811ad916d686e350ce2dd8f6b8b0e128d6
Author: Haiwei Xu <email address hidden>
Date: Tue Jan 28 03:24:11 2014 +0900

    Catch HostBinaryNotFound exception when updating a service

    When updating a service with a wrong host or binary name,
    HostBinaryNotFound exception is raised. However this exception
    isn't caught and the ServiceNotFound exception which won't happen
    here is caught instead.
    This patch fixes this bug.

    Change-Id: I64b138bad74c39d087addcd766b890c4076a2ce8
    Closes-Bug: #1273139

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → icehouse-3
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

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

Reviewed: https://review.openstack.org/81684
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=53dcf34a18d261d0f49fa25917ce199d72fd05d3
Submitter: Jenkins
Branch: master

commit 53dcf34a18d261d0f49fa25917ce199d72fd05d3
Author: Haiwei Xu <email address hidden>
Date: Thu Mar 20 19:26:40 2014 +0900

    Catch HostBinaryNotFound exception in V2 API

    When updating a service with a wrong host or binary name,
    HostBinaryNotFound exception will be raised.
    However the ServiceNotFound exception which won't happen here
    is caught instead of HostBinaryNotFound.
    The similar fix has been merged in V3 API.
    I64b138bad74c39d087addcd766b890c4076a2ce8

    Change-Id: I37cf7a56c5478bb1273ef038bb197d80af0ae7b5
    Closes-Bug: #1273139

Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-3 → 2014.1
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.