Ceph: TypeError in Ceph Dashboard when accessing /api/osd/settings.

Solution Verified - Updated -

Issue

TypeError in Ceph Dashboard when accessing /api/osd/settings.

With dashboard debug enabled, the following error is seen in the logs when the system accesses the /api/osd/settings endpoint:

Traceback (most recent call last):
  File "/usr/share/ceph/mgr/dashboard/controllers/osd.py", line 173, in settings
    'nearfull_ratio': results['nearfull_ratio'],
TypeError: string indices must be integers

There are many ways to get to the same issue, example:

Jul 17 20:14:04 ceph-node-02 ceph-mgr2127: [dashboard INFO request] [::ffff:172.18.101.1:50930] [GET] [200] [0.072s] [admin] [97.0B] /api/health/get_cluster_capacity
Jul 17 20:14:04 ceph-node-02 ceph-mgr2127: [dashboard ERROR ceph_service] unable to load command response as json
Jul 17 20:14:04 ceph-node-02 ceph-mgr2127: [dashboard ERROR exception] Internal Server Error
Traceback (most recent call last):
File "/usr/share/ceph/mgr/dashboard/services/exception.py", line 47, in dashboard_exception_handler
return handler(args, **kwargs)
File "/lib/python3.6/site-packages/cherrypy/_cpdispatch.py", line 54, in call
return self.callable(*self.args, **self.kwargs)
File "/usr/share/ceph/mgr/dashboard/controllers/_base_controller.py", line 263, in inner
ret = func(*args, **kwargs)
File "/usr/share/ceph/mgr/dashboard/controllers/_rest_controller.py", line 191, in wrapper
return func(*vpath, **params)
File "/usr/share/ceph/mgr/dashboard/controllers/osd.py", line 173, in settings
'nearfull_ratio': result['nearfull_ratio'],
TypeError: string indices must be integers
Jul 17 20:14:04 ceph-node-02 ceph-mgr2127: [dashboard ERROR request] [::ffff:172.18.101.1:50922] [GET] [500] [1.702s] [admin] [513.0B] /api/osd/settings
Jul 17 20:14:04 ceph-node-02 ceph-mgr2127: [dashboard ERROR request] [b'{"status": "500 Internal Server Error", "detail": "The server encountered an unexpected condition which prevented it from fulfilling the request.", "request_id": "b3fb6df8-4bfa-4774-b173-1e0552a3a1d3"}

Environment

Red Hat Ceph Storage (RHCS) 7
Red Hat Ceph Storage (RHCS) 8

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content