openvstorage / framework-alba-plugin

The Framework ALBA plugin extends the OpenvStorage GUI with functionality to manage ASDs (Alternate Storage Daemon) and Seagate Kinetic drives.
Other
2 stars 3 forks source link

Backend gui not loading due to namespace with wrong preset name #597

Closed jeroenmaelbrancke closed 6 years ago

jeroenmaelbrancke commented 6 years ago

Problem

With the manually fixes of Romain/Ops to reattach a volume back to the ABM cluster, it could be that a namespace is reattached with a wrong preset or a preset that doesn't exists.

for example:

018-06-04 14:37:48 39300 +0200 - NY2SRV0011 - 11813/140460485877584 - api/middleware - 386 - ERROR - An unhandled exception occurred: 'global-no-encrypt'
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.7/dist-packages/rest_framework/viewsets.py", line 78, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/rest_framework/views.py", line 399, in dispatch
    response = self.handle_exception(exc)
  File "/usr/lib/python2.7/dist-packages/rest_framework/views.py", line 396, in dispatch
    response = handler(request, *args, **kwargs)
  File "/opt/OpenvStorage/webapps/api/backend/decorators.py", line 589, in new_function
    return_value = f(*args, **kwargs)
  File "/opt/OpenvStorage/webapps/api/backend/decorators.py", line 86, in new_function
    result = f(*args, **kw)
  File "/opt/OpenvStorage/webapps/api/backend/decorators.py", line 411, in new_function
    data = FullSerializer(object_type, contents=contents, instance=obj).data
  File "/usr/lib/python2.7/dist-packages/rest_framework/serializers.py", line 573, in data
    self._data = self.to_native(obj)
  File "/usr/lib/python2.7/dist-packages/rest_framework/serializers.py", line 349, in to_native
    value = field.field_to_native(obj, field_name)
  File "/usr/lib/python2.7/dist-packages/rest_framework/fields.py", line 198, in field_to_native
    value = get_component(value, component)
  File "/usr/lib/python2.7/dist-packages/rest_framework/fields.py", line 56, in get_component
    val = getattr(obj, attr_name)
  File "/opt/OpenvStorage/ovs/dal/dataobject.py", line 348, in <lambda>
    fget = lambda s: s._get_dynamic_property(dynamic)
  File "/opt/OpenvStorage/ovs/dal/dataobject.py", line 417, in _get_dynamic_property
    return self._backend_property(data_loader, dynamic)
  File "/opt/OpenvStorage/ovs/dal/dataobject.py", line 1030, in _backend_property
    dynamic_data = fct()
  File "/opt/OpenvStorage/ovs/dal/hybrids/albabackend.py", line 293, in _presets
    preset = preset_dict[namespace['namespace']['preset_name']]
KeyError: 'global-no-encrypt'

Not sure if the gui should not load if a namespace have a wrong preset name. Maybe just throw an error on the gui instead of an empty page.

image

JeffreyDevloo commented 6 years ago

Quite difficult to propagate serializer exceptions back to the GUI. We catch and log exceptions when we can anticipate them. Fiddling around with some metadata in Alba is not something we expect though.

wimpers commented 6 years ago

Closing this one down as result of manual incorrect steps.