Univention Bugzilla – Bug 37606
Improve error handling when entering cloud service URLs
Last modified: 2023-06-28 10:46:03 CEST
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
(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.
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"}}
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"}]}]}}'
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.