prometheus/node_exporter · error

no CPU power status with error code 0x%08x

Error message

no CPU power status with error code 0x%08x

What it means

This error comes from the macOS thermal collector when the IOKit CPU power status query returns a failure other than kIOReturnNotFound. The collector reads the CPU power status dictionary from IOKit via cgo; any IOReturn code other than success (and other than the specifically-handled 'not recorded' case) is wrapped into this message with the code in hex. It signals that IOKit itself rejected or failed the query rather than simply having no recorded status.

Solutions

  1. Check the printed 0x%08x code against IOKit IOReturn.h (e.g. 0xe00002c7 = kIOReturnNotPrivileged) to identify the failure cause.
  2. Re-run the exporter without sandbox/restriction so IOKit power queries are permitted.
  3. Disable the thermal collector (or this platform path) on hosts/VMs known not to expose CPU power status.
  4. Verify the macOS/IOKit version supports the CPU power status dictionary; treat it as platform-specific and degrade gracefully.

Example fix

// before
return nil, fmt.Errorf("no CPU power status with error code 0x%08x", int(cfDictRef.ret))
// after
if C.kIOReturnNotPrivileged == cfDictRef.ret {
    return nil, ErrNoData // degrade instead of failing the scrape
}
return nil, fmt.Errorf("no CPU power status with error code 0x%08x", int(cfDictRef.ret))
Defensive patterns

Strategy: try-catch

Validate before calling

// Go: check the wrapped IOReturn code before deciding how to handle
var errKIOReturnNotPrivileged = errors.New("kIOReturnNotPrivileged")
if strings.Contains(err.Error(), "error code 0xe00002c7") { /* privileged query unavailable */ }

Type guard

func isCPUPowerStatusCode(err error) (uint32, bool) {
    var code uint32
    if _, e := fmt.Sscanf(err.Error(), "no CPU power status with error code 0x%08x", &code); e == nil {
        return code, true
    }
    return 0, false
}

Try / catch

if _, err := collector.Update(ch); err != nil {
    if errors.Is(err, ErrNoData) {
        return // skip scrape, expected on unsupported Macs
    }
    log.Printf("thermal collector unavailable: %v", err) // degrade, don't crash
}

Prevention

When it happens

Trigger: Calling fetchCPUPowerStatus (via thermalCollector.Update) when C.kIOReturnSuccess != cfDictRef.ret and the code is not kIOReturnNotFound, e.g. IOKit privilege/entitlement failures or driver-level errors on macOS.

Common situations: Running node_exporter on a macOS host where the power-management IOKit service denies access (unsandboxed vs sandboxed contexts), on virtual machines that don't emulate Apple's SMC/power status keys, or on macOS versions where the kIOSCPUStatusKey dictionary is unavailable and the driver returns an unexpected IOReturn code.

Understand the failure class

Background: "invalid response format", "malformed payload", "missing data field": when an API returns 200 but the response shape is wrong — this error's family across 23 libraries.

Related errors


AI-assisted analysis of prometheus/node_exporter@17ddd77c59 (2026-09-07). Data as JSON: /api/errors/93db849e83811c1a. Report an issue: GitHub.

Appendix: source

Thrown at collector/thermal_darwin.go:142

	}

	return c.updateTemperatures(ch)
}

func fetchCPUPowerStatus() (map[string]int, error) {
	cfDictRef, _ := C.FetchThermal()
	defer func() {
		if cfDictRef.ref != 0x0 {
			C.CFRelease(C.CFTypeRef(cfDictRef.ref))
		}
	}()

	if C.kIOReturnNotFound == cfDictRef.ret {
		return nil, errors.New("no CPU power status has been recorded")
	}

	if C.kIOReturnSuccess != cfDictRef.ret {
		return nil, fmt.Errorf("no CPU power status with error code 0x%08x", int(cfDictRef.ret))
	}

	// mapping CFDictionary to map
	cfDict := CFDict(cfDictRef.ref)
	return mappingCFDictToMap(cfDict), nil
}

type CFDict uintptr

func mappingCFDictToMap(dict CFDict) map[string]int {
	if C.CFNullRef(dict) == C.kCFNull {
		return nil
	}
	cfDict := C.CFDictionaryRef(dict)

	var result map[string]int
	count := C.CFDictionaryGetCount(cfDict)
	if count > 0 {

View on GitHub (pinned to 17ddd77c59)