Bug 37606 - Improve error handling when entering cloud service URLs
Improve error handling when entering cloud service URLs
Status: CLOSED WONTFIX
Product: UCS
Classification: Unclassified
Component: Virtualization - UVMM
UCS 4.2
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-01-23 14:18 CET by Philipp Hahn
Modified: 2023-06-28 10:46 CEST (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 1: Cosmetic issue or missing function but workaround exists
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.006
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Error handling
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2015-01-23 14:18:08 CET
2015-01-23 14:15:45,099 - uvmmd.unix - ERROR - [82] Exception: Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/univention/uvmm/unix.py", line 149, in handle_command
    res = cmd(self, command)
  File "/usr/lib/pymodules/python2.7/univention/uvmm/commands.py", line 68, in L_CLOUD_ADD
    cloudnode.cloudconnections.add_connection(request.args, request.testconnection)
  File "/usr/lib/pymodules/python2.7/univention/uvmm/cloudnode.py", line 123, in add_connection
    newconnection.connect(cloud, testconnection)
  File "/usr/lib/pymodules/python2.7/univention/uvmm/cloudconnection.py", line 107, in connect
    self._create_connection(cloud, testconnection)
  File "/usr/lib/pymodules/python2.7/univention/uvmm/openstackcloud.py", line 139, in _create_connection
    self._instances = self._exec_libcloud(lambda: self.driver.list_nodes())
  File "/usr/lib/pymodules/python2.7/univention/uvmm/openstackcloud.py", line 449, in _exec_libcloud
    return func()
  File "/usr/lib/pymodules/python2.7/univention/uvmm/openstackcloud.py", line 139, in <lambda>
    self._instances = self._exec_libcloud(lambda: self.driver.list_nodes())
  File "/usr/lib/python2.7/dist-packages/libcloud/compute/drivers/openstack.py", line 150, in list_nodes
    self.connection.request('/servers/detail', params=params).object)
  File "/usr/lib/python2.7/dist-packages/libcloud/common/openstack.py", line 200, in request
    raw=raw)
  File "/usr/lib/python2.7/dist-packages/libcloud/common/base.py", line 657, in request
    action = self.morph_action_hook(action)
  File "/usr/lib/python2.7/dist-packages/libcloud/common/openstack.py", line 255, in morph_action_hook
    self._populate_hosts_and_request_paths()
  File "/usr/lib/python2.7/dist-packages/libcloud/common/openstack.py", line 288, in _populate_hosts_and_request_paths
    osa = osa.authenticate(**kwargs)  # may throw InvalidCreds
  File "/usr/lib/python2.7/dist-packages/libcloud/common/openstack_identity.py", line 841, in authenticate
    return self._authenticate_2_0_with_password()
  File "/usr/lib/python2.7/dist-packages/libcloud/common/openstack_identity.py", line 866, in _authenticate_2_0_with_password
    return self._authenticate_2_0_with_body(reqbody)
  File "/usr/lib/python2.7/dist-packages/libcloud/common/openstack_identity.py", line 884, in _authenticate_2_0_with_body
    access = body['access']
TypeError: string indices must be integers, not str
Comment 1 Philipp Hahn univentionstaff 2015-01-23 14:31:47 CET
(In reply to Philipp Hahn from comment #0)
that was with
 auth=http://xen11.knut.univention.de/
 service=http://xen11.knut.univention.de/


With
 auth=http://192.168.0.79:5000/v2.0
 service=http://192.168.0.79:8774/v2/fabc5f6a205d463596398c46d7d69b86
I get:
> Exception: {"error": {"message": "get_version_v2() got an unexpected keyword argument 'auth'", "code": 400, "title": "Bad Request"}}


So error handling should be improved when invalid URLs are given.
Comment 2 Philipp Hahn univentionstaff 2017-05-03 16:20:24 CEST
I can still re-produce the error message by entering a wrong Service URL with UCS-4.2:
>An error occurred
>Internal server error.
>
>Server error message:
>
>Exception: {"error": {"message": "get_version_v2() got an unexpected keyword argument 'auth'", "code": 400, "title": "Bad Request"}}
Comment 3 Philipp Hahn univentionstaff 2017-05-03 16:22:04 CEST
One more because I entered "http://192.168.0.79:5000/" with the trailing "/":

>Exception: <MalformedResponseException in <libcloud.compute.drivers.openstack.OpenStack_1_1_NodeDriver object at 0x7f55fa559950> 'Malformed response'>: 'code: 300 body: {"versions": {"values": [{"status": "stable", "updated": "2013-03-06T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}, {"base": "application/xml", "type": "application/vnd.openstack.identity-v3+xml"}], "id": "v3.0", "links": [{"href": "http://192.168.0.79:5000/v3/", "rel": "self"}]}, {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}, {"base": "application/xml", "type": "application/vnd.openstack.identity-v2.0+xml"}], "id": "v2.0", "links": [{"href": "http://192.168.0.79:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/api/openstack-identity-service/2.0/content/", "type": "text/html", "rel": "describedby"}, {"href": "http://docs.openstack.org/api/openstack-identity-service/2.0/identity-dev-guide-2.0.pdf", "type": "application/pdf", "rel": "describedby"}]}]}}'
Comment 4 Ingo Steuwer univentionstaff 2020-07-03 20:51:34 CEST
This issue has been filed against UCS 4.2.

UCS 4.2 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen it and update the UCS version. In this case please provide detailed information on how this issue is affecting you.