Output traceback when deleting non-existed arq

Bug #1937251 reported by Eric Xie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cyborg (OpenStack)
Fix Released
Undecided
Unassigned

Bug Description

When deleting non-existed arq, got error as below:

openstack accelerator arq delete b8ba271e-7b45-4edf-97ef-d63b6b49f57a
ResourceNotFound: 404: Client Error for url: http://cyborg.openstack.svc.cn-north-3.myinspurcloud.com/v2/accelerator_requests/b8ba271e-7b45-4edf-97ef-d63b6b49f57a, ExtArq not found with uuid=b8ba271e-7b45-4edf-97ef-d63b6b49f57a
Traceback (most recent call last):

  File "/var/lib/openstack/lib/python3.8/site-packages/cyborg/db/sqlalchemy/api.py", line 902, in extarq_get
    return query.one()

  File "/var/lib/openstack/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3473, in one
    raise orm_exc.NoResultFound("No row was found for one()")

sqlalchemy.orm.exc.NoResultFound: No row was found for one()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/var/lib/openstack/lib/python3.8/site-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming
    res = self.dispatcher.dispatch(message)

  File "/var/lib/openstack/lib/python3.8/site-packages/oslo_messaging/rpc/dispatcher.py", line 309, in dispatch
    return self._do_dispatch(endpoint, method, ctxt, args)

  File "/var/lib/openstack/lib/python3.8/site-packages/oslo_messaging/rpc/dispatcher.py", line 229, in _do_dispatch
    result = func(ctxt, **new_args)

  File "/var/lib/openstack/lib/python3.8/site-packages/cyborg/conductor/manager.py", line 87, in arq_delete_by_uuid
    ExtARQ.delete_by_uuid(context, arqlist)

  File "/var/lib/openstack/lib/python3.8/site-packages/cyborg/objects/ext_arq.py", line 158, in delete_by_uuid
    obj_extarq = objects.ExtARQ.get(context, uuid)

  File "/var/lib/openstack/lib/python3.8/site-packages/cyborg/objects/ext_arq.py", line 94, in get
    db_extarq = cls.dbapi.extarq_get(context, uuid)

  File "/var/lib/openstack/lib/python3.8/site-packages/oslo_db/api.py", line 154, in wrapper
    ectxt.value = e.inner_exc

  File "/var/lib/openstack/lib/python3.8/site-packages/oslo_utils/excutils.py", line 220, in __exit__
    self.force_reraise()

  File "/var/lib/openstack/lib/python3.8/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
    six.reraise(self.type_, self.value, self.tb)

  File "/var/lib/openstack/lib/python3.8/site-packages/six.py", line 703, in reraise
    raise value

  File "/var/lib/openstack/lib/python3.8/site-packages/oslo_db/api.py", line 142, in wrapper
    return f(*args, **kwargs)

  File "/var/lib/openstack/lib/python3.8/site-packages/cyborg/db/sqlalchemy/api.py", line 904, in extarq_get
    raise exception.ResourceNotFound(

cyborg.common.exception.ResourceNotFound: ExtArq not found with uuid=b8ba271e-7b45-4edf-97ef-d63b6b49f57a

Should catch this exception and give humanable output like "ExtArq not found with uuid=b8ba271e-7b45-4edf-97ef-d63b6b49f57a"

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

Reviewed: https://review.opendev.org/c/openstack/python-cyborgclient/+/802004
Committed: https://opendev.org/openstack/python-cyborgclient/commit/9d5bdc5f170f7469f73cf6a0cea3000a2f2abea9
Submitter: "Zuul (22348)"
Branch: master

commit 9d5bdc5f170f7469f73cf6a0cea3000a2f2abea9
Author: ericxiett <eric_xiett@163.com>
Date: Fri Jul 23 11:05:56 2021 +0000

    Hide the traceback when deleting a non-existent ARQ

    This patch catches the 'ResourceNotFound' exception and adds
     some unittests.

    Closes-Bug: #1937251
    Change-Id: I1e07528e9b551ff192ee707d1988a8c07bf349a0

Changed in openstack-cyborg:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-cyborgclient 1.4.0

This issue was fixed in the openstack/python-cyborgclient 1.4.0 release.

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.