Unimplemented Operations for Datastores Spraying Stacktrace to Users

Bug #1276860 reported by Auston McReynolds
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
High
Andrew Bramley

Bug Description

In a datastore's manager, it's common to see this type of logic:

    def list_users(self, context, limit=None, marker=None, include_marker=False):
        raise exception.TroveError(ERROR_MSG)

to indicate that the operation in question is not supported for that particular datastore.

the problem is that the following is returned to the user:

$ trove user-list 64c8f37d-a126-4e8d-bfb8-23cb44432a99

ERROR: An error occurred communicating with the guest: Remote error: TroveError Not supported [u'Traceback (most recent call last):\n', u' File "/home/stack/trove/trove/openstack/common/rpc/amqp.py", line 440, in _process_data\n **args)\n', u' File "/home/stack/trove/trove/openstack/common/rpc/dispatcher.py", line 172, in dispatch\n result = getattr(proxyobj, method)(ctxt, **kwargs)\n', u' File "/home/stack/trove/trove/guestagent/datastore/mongodb/manager.py", line 130, in list_users\n raise exception.TroveError(ERROR_MSG)\n', u'TroveError: Not supported\n']..
please test your next attempt before pushing the patch-set.

The stracktrace should not be shown (for multiple reasons, an important one being user experience), and the message can be more helpful than "Not supported".

Fix should result in something like:

    $ trove user-list 64c8f37d-a126-4e8d-bfb8-23cb44432a99

    ERROR: This operation is not supported for this datastore at this time

Changed in trove:
milestone: none → icehouse-3
Changed in trove:
importance: Undecided → High
Revision history for this message
Morgan Jones (6-morgan) wrote :

I suggest the error should be:

ERROR: The "user-list" operation is not supported for the redis datastore at this time (/home/stack/trove/trove/openstack/common/rpc/amqp.py:440).

Andrew Bramley (andrlw)
Changed in trove:
assignee: nobody → Andrew Bramley (andrlw)
Andrew Bramley (andrlw)
Changed in trove:
status: New → In Progress
Changed in trove:
milestone: icehouse-3 → icehouse-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

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

Reviewed: https://review.openstack.org/80173
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=914935f14860390d4a5e50eb4887ae19f775da00
Submitter: Jenkins
Branch: master

commit 914935f14860390d4a5e50eb4887ae19f775da00
Author: Andrew Bramley <email address hidden>
Date: Mon Mar 3 10:58:44 2014 -0500

    Improve Datastore Not Implemented exceptions

    Added exception for not implemented exceptions
    that indicates the operation name.
    Added missing un-implemented methods to redis.
    Change handling of remote errors from guest agent
    api to only pass along the root exception message
    rather than the full traceback

    Change-Id: I0d4fdc5340bfb40370595636cc57cc5c87889507
    Closes-Bug: #1276860

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