Bug 2307351

Summary: [7.1z backport][GSS] TypeError in Ceph Dashboard when accessing /api/osd/settings after upgrade to Ceph 7 (18.2.0-192.el9cp)
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Ray <rayperez>
Component: Ceph-DashboardAssignee: Afreen <afrahman>
Status: CLOSED ERRATA QA Contact: Vinayak Papnoi <vpapnoi>
Severity: medium Docs Contact: Disha Walvekar <dwalveka>
Priority: unspecified    
Version: 7.0CC: afrahman, bkunal, ceph-eng-bugs, cephqe-warriors, kelwhite, mcaldeir, nia, rpollack, tserlin, vpapnoi
Target Milestone: ---   
Target Release: 7.1z3   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ceph-18.2.1-273.el9cp Doc Type: Bug Fix
Doc Text:
The Capacity section and the Pools page on the Ceph dashboard now work fine Previously, the inability to access OSD settings through the dashboard API impaired the monitoring and configuration capabilities in a live production environment. The Pools page and API also failed. As a result, the capacity section in the Ceph dashboard did not display the capacity and pool information correctly. With this fix, the code is changed a correct handler for checking invalid values in API calls is added and hence the Capacity section, Pools and the APIs work fine.
Story Points: ---
Clone Of:
: 2335767 2335768 (view as bug list) Environment:
Last Closed: 2025-02-24 15:42:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2335768    
Bug Blocks:    

Description Ray 2024-08-22 18:31:12 UTC
After upgrading from Ceph 5.3 to Ceph 7 (18.2.0-192.el9cp), we encountered multiple issues on the Ceph Dashboard, particularly with the "Capacity" section not displaying and resulting in error 500 - internal server errors.

### Error Details:
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

This error suggests that the 'results' variable, which should be a dictionary, is being treated as a string, leading to a TypeError when trying to access 'nearfull_ratio'.

### Environment Details:
- **Ceph Version:** 7.0 (18.2.0-192.el9cp)
- **Dashboard:** Ceph Dashboard included in the above Ceph version
- **Environment:** Live production environment
- **Test Environment:** Not affected; test environment with the same upgrade procedure works correctly

### Steps to Reproduce:
1. Upgrade from Ceph 5.3 to Ceph 7 (18.2.0-192.el9cp)
2. Access the Ceph Dashboard
3. Navigate to the "Capacity" section or trigger the /api/osd/settings endpoint
4. Observe error 500 and TypeError in logs

### Impact:
The Ceph Dashboard's "Capacity" section does not display, and the inability to access OSD settings via the dashboard API impairs the monitoring and configuration capabilities in a live production environment.

### Upstream Reference:
This issue appears to be related to an upstream bug tracked here: https://tracker.ceph.com/issues/62089
The upstream bug suggests that the issue arises due to the results variable being treated as a string instead of a dictionary.

Comment 4 Manny 2024-08-27 23:13:03 UTC
See also Ceph Upstream Tracker #62089, (https://tracker.ceph.com/issues/62089)

BR
Manny

Comment 7 Ray 2024-12-11 18:21:32 UTC
Hello 


    So I am a little confused on what the next steps for the customer should be?

Comment 22 errata-xmlrpc 2025-02-24 15:42:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat Ceph Storage 7.1 security, bug fix, enhancement, and known issue updates), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2025:1770