Project

General

Profile

Actions

Bug #74693

closed
ST SZ

MGR daemon crashes with assertion failure in `PyFormatter.h:84` when the telemetry module attempts to query metadata for a destroyed OSD that still exists in the CRUSH map.

Bug #74693: MGR daemon crashes with assertion failure in `PyFormatter.h:84` when the telemetry module attempts to query metadata for a destroyed OSD that still exists in the CRUSH map.

Added by Stephen Thompson 10 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Category:
telemetry module
Target version:
Due date:
% Done:

0%

Source:
Telemetry
Backport:
tentacle, umbrella
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Fixed In:
v21.3.0-1331-g635a92806d
Released In:
Upkeep Timestamp:
2026-08-28T01:42:12+00:00

Description

  1. Environment

- Ceph Version: v20.2.0 Tentacle (stable)
- OS: Rocky Linux (cephadm deployment)
- Affected Components: ceph-mgr, telemetry module

  1. Description

When an OSD has been destroyed (FSID set to `00000000-0000-0000-0000-000000000000`) but not fully purged from the cluster, the MGR telemetry module periodically attempts to query its metadata. This triggers an assertion failure in `PyFormatter::close_section()` because the formatter attempts to close a section that was never opened (the destroyed OSD has no metadata to format).

The MGR crashes every 60-90 seconds, cycling through all available MGR daemons.

  1. Assertion Failure

```
/ceph/rpmbuild/BUILD/ceph-20.2.0/src/mgr/PyFormatter.h: 84: FAILED ceph_assert(cursor != root)
```

  1. Stack Trace

```
Thread: telemetry

ceph::__ceph_assert_fail()
-> PyFormatter::close_section()
-> ActivePyModules::get_perf_schema_python()
```

  1. Log Messages

```
mgr get_metadata_python Requested missing service osd.123
mgr with_perf_counters Missing counter: 'mds_log.rss' (mds.quick.ssd.osd18.ysqwpx)
```

Note: The "Missing counter" warning is unrelated to the crash but appears in logs around the same time.

  1. Destroyed OSD State

```bash
$ ceph osd dump | grep osd.123
osd.123 down out weight 0 exists,new 00000000-0000-0000-0000-000000000000
```

The destroyed OSD has:
- FSID: `00000000-0000-0000-0000-000000000000` (null/destroyed marker)
- Status: down, out, weight 0
- No CRUSH location (empty host assignment)
- No network addresses (empty addrvec)

  1. Steps to Reproduce

1. Have a running Ceph Tentacle v20.2.0 cluster with telemetry module enabled
2. Destroy an OSD but don't purge it from the CRUSH map:
```bash
ceph osd destroy <osd_id> --yes-i-really-mean-it
```
3. Wait 60-90 seconds for telemetry module to query OSD metadata
4. MGR crashes with assertion failure

  1. Impact

- Severity: High
- MGR daemon crashes repeatedly (every 60-90 seconds)
- All MGR daemons in the cluster are affected
- Cluster health monitoring and management is degraded
- Crash reports fail to post due to MGR instability


Related issues 6 (3 open — 3 closed)

Related to mgr - Bug #75745: ActivePyModules fails an assert during perf schema generation when an OSD exists but has no perf counters.ResolvedLumir Sliva

Actions
Related to mgr - Bug #77384: Enhance telemetry upgrade tests to verify perf schema collectionFix Under ReviewLaura Flores

Actions
Related to mgr - Bug #77540: Misaligned OSD perf counters within the MgrIn Progress

Actions
Related to Ceph - Feature #79553: Add QA tests for get_perf_schema / get_unlabeled_perf_schema pathsNewSteven Zuraski

Actions
Copied to mgr - Backport #78617: tentacle: MGR daemon crashes with assertion failure in `PyFormatter.h:84` when the telemetry module attempts to query metadata for a destroyed OSD that still exists in the CRUSH map.ResolvedSteven Zuraski

Actions
Copied to mgr - Backport #78618: umbrella: MGR daemon crashes with assertion failure in `PyFormatter.h:84` when the telemetry module attempts to query metadata for a destroyed OSD that still exists in the CRUSH map.ResolvedSteven Zuraski

Actions

ST Updated by Stephen Thompson 10 months ago Actions #1

  1. Suggested Fix

In `ActivePyModules::get_perf_schema_python()`, check if the OSD exists and has valid metadata before attempting to format. If the OSD is destroyed (null FSID), skip it or return early without opening/closing formatter sections.

SZ Updated by Steven Zuraski 9 months ago Actions #2

  • Assignee changed from Yaarit Hatuka to Steven Zuraski

SZ Updated by Steven Zuraski 9 months ago Actions #3

Hey Stephen, could you elaborate the steps you took in order to reproduce this issue? Also, does the assert failure happen every time?

I was able to cause an assert failure inside get_perf_schema_python() with a unit test based on your description. I haven't been seeing this behavior in my test cluster however when destroying an OSD, so I wanted to verify that our order of operations from cluster start to OSD destroy to telemetry send are the same.

ST Updated by Stephen Thompson 9 months ago Actions #4

This is the process we followed so looks good.

SZ Updated by Steven Zuraski 8 months ago Actions #5

Hey Stephen, could you rerun with debug set to at least 20, and upload the logs?

ceph config set mgr debug_mgr 20

My destroyed OSD does not have the same result

[ceph: root@ceph-node-0 /]# ceph osd tree
ID CLASS WEIGHT TYPE NAME STATUS REWEIGHT PRI-AFF
-1 0.01959 root default
-5 0 host ceph-node-0
1 hdd 0 osd.1 destroyed 0 1.00000
-3 0.00980 host ceph-node-1
0 hdd 0.00980 osd.0 up 1.00000 1.00000
-7 0.00980 host ceph-node-2
sea 2 hdd 0.00980 osd.2 up 1.00000 1.00000
[ceph: root@ceph-node-0 /]# ceph osd dump | grep "osd.1"
osd.1 down out weight 0 up_from 7 up_thru 12 down_at 18 last_clean_interval [0,0) [v2:192.168.100.100:6802/2501638334,v1:192.168.100.100:6803/2501638334] [v2:192.168.100.100:6804/2501638334,v1:192.168.100.100:6805/2501638334] destroyed,exists,stop

SZ Updated by Steven Zuraski 8 months ago Actions #6

  • Related to Bug #75745: ActivePyModules fails an assert during perf schema generation when an OSD exists but has no perf counters. added

KC Updated by Kefu Chai 7 months ago Actions #7

  • Status changed from New to Fix Under Review
  • Pull request ID set to 67156

SZ Updated by Steven Zuraski 6 months ago Actions #9

  • Related to Bug #77384: Enhance telemetry upgrade tests to verify perf schema collection added

SZ Updated by Steven Zuraski 6 months ago Actions #10

  • Related to Bug #77540: Misaligned OSD perf counters within the Mgr added

SZ Updated by Steven Zuraski 4 months ago Actions #11

  • Pull request ID changed from 67156 to 69181

SZ Updated by Steven Zuraski 4 months ago Actions #12

  • Status changed from Fix Under Review to Pending Backport

UB Updated by Upkeep Bot 4 months ago Actions #13

  • Copied to Backport #78617: tentacle: MGR daemon crashes with assertion failure in `PyFormatter.h:84` when the telemetry module attempts to query metadata for a destroyed OSD that still exists in the CRUSH map. added

UB Updated by Upkeep Bot 4 months ago Actions #14

  • Copied to Backport #78618: umbrella: MGR daemon crashes with assertion failure in `PyFormatter.h:84` when the telemetry module attempts to query metadata for a destroyed OSD that still exists in the CRUSH map. added

UB Updated by Upkeep Bot 4 months ago Actions #15

  • Tags (freeform) set to backport_processed

UB Updated by Upkeep Bot 4 months ago Actions #16

  • Merge Commit set to 635a92806d102a6b0a8349c9699b0515871604ef
  • Fixed In set to v21.3.0-1331-g635a92806d
  • Upkeep Timestamp set to 2026-07-24T01:01:54+00:00

SZ Updated by Steven Zuraski 4 months ago Actions #17

  • Related to Feature #79553: Add QA tests for get_perf_schema / get_unlabeled_perf_schema paths added

SZ Updated by Steven Zuraski 3 months ago Actions #18

  • Status changed from Pending Backport to Resolved

UB Updated by Upkeep Bot 3 months ago Actions #19

  • Tags (freeform) deleted (backport_processed)
  • Upkeep Timestamp changed from 2026-07-24T01:01:54+00:00 to 2026-08-28T01:42:12+00:00
Actions

Also available in: PDF Atom