Incorrect error handling for failed requests

Bug #1714460 reported by Dr. Jens Harbott
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-designateclient
Fix Released
Undecided
Dr. Jens Harbott

Bug Description

If the client receives some kind of unexpected response from the server, it may fail with an error like

__init__() got an unexpected keyword argument 'title'

instead of producing a proper error message. In order to reproduce this, let the dns endpoint lead to some other service like glance-registry (9191 instead of 9001 in the default setup), resulting in:

$ openstack --debug zone list
...
__init__() got an unexpected keyword argument 'title'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 400, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/cliff/display.py", line 113, in run
    column_names, data = self.take_action(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/designateclient/v2/cli/zones.py", line 94, in take_action
    data = get_all(client.zones.list, criterion)
  File "/usr/local/lib/python2.7/dist-packages/designateclient/v2/utils.py", line 69, in get_all
    data = function(*args, criterion=criterion)
  File "/usr/local/lib/python2.7/dist-packages/designateclient/v2/zones.py", line 51, in list
    return self._get(url, response_key="zones")
  File "/usr/local/lib/python2.7/dist-packages/designateclient/v2/base.py", line 30, in _get
    resp, body = self.client.session.get(url, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 304, in get
    return self.request(url, 'GET', **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/designateclient/v2/client.py", line 95, in request
    raise exceptions.NotFound(**response_payload)
TypeError: __init__() got an unexpected keyword argument 'title'

Changed in python-designateclient:
assignee: nobody → Dr. Jens Harbott (j-harbott)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-designateclient (master)

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

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

Reviewed: https://review.openstack.org/500003
Committed: https://git.openstack.org/cgit/openstack/python-designateclient/commit/?id=5b502b9f7849c7722d9c2737099b2e5d3380cda8
Submitter: Jenkins
Branch: master

commit 5b502b9f7849c7722d9c2737099b2e5d3380cda8
Author: Jens Harbott <email address hidden>
Date: Fri Sep 1 10:45:10 2017 +0000

    Make remote error handling more robust

    When a RemoteError is created, it is passed the complete content of the
    json response from the server. Thus is can happen that it contains
    unexpected entries, we should just ignore them.

    Change-Id: I2155d1d44432884f19ef926c02b9d0f99ade57d9
    Closes-Bug: 1714460

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

This issue was fixed in the openstack/python-designateclient 2.8.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.