kadalu/gdash

Loading dashboard, volumes, bricks causes HTTP 500

MrApe opened this issue · 4 comments

MrApe commented

Loading pages other than peers results in a HTTP 500 error:

Bildschirmfoto 2022-03-18 um 13 46 21

The CLI shows the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/cherrypy/_cprequest.py", line 638, in respond
    self._do_respond(path_info)
  File "/usr/local/lib/python3.6/dist-packages/cherrypy/_cprequest.py", line 697, in _do_respond
    response.body = self.handler()
  File "/usr/local/lib/python3.6/dist-packages/cherrypy/lib/encoding.py", line 223, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/cherrypy/lib/jsontools.py", line 59, in json_handler
    value = cherrypy.serving.request._json_inner_handler(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/cherrypy/_cpdispatch.py", line 54, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/dist-packages/gdash/__main__.py", line 99, in volumes
    return volume.status_detail(group_subvols=True)
  File "/usr/local/lib/python3.6/dist-packages/glustercli/cli/volume.py", line 189, in status_detail
    group_subvols=group_subvols)
  File "/usr/local/lib/python3.6/dist-packages/glustercli/cli/parsers.py", line 307, in parse_volume_status
    brick_online = brick_status_data.get("online", False)
AttributeError: 'NoneType' object has no attribute 'get'

Any ideas how to debug this?

We'r running glusterfs version 4.1.5 on Ubuntu 18.04 with python 3.6.9.

MrApe commented

Digging a bit into the problem showed, that it might have to do with a stopped volume.

Using the following code to list volumes manually...

from glustercli.cli import volume
volist = volume.vollist()
for vol in volist:
  print(volume.status_detail(vol))

...works for some volumes but then raises an error:

Traceback (most recent call last):
  File "test.py", line 4, in <module>
    print(volume.status_detail(vol))
  File "/usr/local/lib/python3.6/dist-packages/glustercli/cli/volume.py", line 187, in status_detail
    return parse_volume_status(volume_execute_xml(cmd),
  File "/usr/local/lib/python3.6/dist-packages/glustercli/cli/utils.py", line 202, in volume_execute_xml
    return gluster_execute_xml(cmd)
  File "/usr/local/lib/python3.6/dist-packages/glustercli/cli/utils.py", line 187, in gluster_execute_xml
    return execute_or_raise(cmd)
  File "/usr/local/lib/python3.6/dist-packages/glustercli/cli/utils.py", line 170, in execute_or_raise
    check_for_xml_errors((out, err))
  File "/usr/local/lib/python3.6/dist-packages/glustercli/cli/utils.py", line 162, in check_for_xml_errors
    raise GlusterCmdException((int(op_ret), '', op_err))
glustercli.cli.utils.GlusterCmdException: (-1, '', 'Volume [NAME_REMOVED] is not started')

I will look into the issue this week. Thanks for reporting.

MrApe commented

Any news here? Can we support somehow?

New release of GlusterCLI python bindings is available now. https://github.com/gluster/glustercli-python/releases/tag/0.8.3

Please upgrade glustercli by running pip3 install --upgrade glustercli and restart the gdash service.