{"record":{"id":"2a1362a48983e4cf","repo":"lima-vm/lima","slug":"invalid-plist-ioregistryentrychildren-not-found-o","errorCode":null,"errorMessage":"invalid plist: IORegistryEntryChildren not found or empty","messagePattern":"invalid plist: IORegistryEntryChildren not found or empty","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/osutil/machineid.go","lineNumber":72,"sourceCode":"\t\tif err == nil {\n\t\t\treturn strings.TrimSpace(string(b)), nil\n\t\t}\n\t}\n\treturn \"\", fmt.Errorf(\"no machine-id found, tried %v\", candidates)\n}\n\nfunc parseIOPlatformUUIDFromIOPlatformExpertDevice(r io.Reader) (string, error) {\n\tvar p plist.Plist\n\tdec := xml.NewDecoder(r)\n\tif err := dec.Decode(&p); err != nil {\n\t\treturn \"\", err\n\t}\n\tif p.Value.Dict == nil {\n\t\treturn \"\", errors.New(\"invalid plist: top-level value is not a dict\")\n\t}\n\tioRegistryEntryChildren, ok := p.Value.Dict[\"IORegistryEntryChildren\"]\n\tif !ok || ioRegistryEntryChildren.Array == nil || len(ioRegistryEntryChildren.Array) == 0 {\n\t\treturn \"\", errors.New(\"invalid plist: IORegistryEntryChildren not found or empty\")\n\t}\n\tfor _, child := range ioRegistryEntryChildren.Array {\n\t\tif child.Dict == nil {\n\t\t\tcontinue\n\t\t}\n\t\tioPlatformUUID, ok := child.Dict[\"IOPlatformUUID\"]\n\t\tif !ok || ioPlatformUUID.String == nil {\n\t\t\tcontinue\n\t\t}\n\t\treturn *ioPlatformUUID.String, nil\n\t}\n\n\treturn \"\", errors.New(\"invalid plist: IOPlatformUUID not found in any child of IORegistryEntryChildren\")\n}\n","sourceCodeStart":54,"sourceCodeEnd":87,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/osutil/machineid.go#L54-L87","documentation":"After confirming the plist root is a dict, the macOS machine-ID parser looks for the IORegistryEntryChildren key and requires a non-empty array under it. This error is returned when that key is absent, not an array, or empty — i.e. the ioreg dump lacks the expected child registry entries.","triggerScenarios":"machineID() on macOS parses an ioreg plist whose dict has no IORegistryEntryChildren key, or whose value is nil/empty array; also triggered by unit tests feeding malformed plists.","commonSituations":"Running ioreg with wrong flags (missing -c IOPlatformExpertDevice or wrong depth) producing an empty tree; VMs or Hackintosh-ish environments where IOPlatformExpertDevice exposes no children; truncated ioreg output.","solutions":["Run `ioreg -rd1 -c IOPlatformExpertDevice` manually and confirm IORegistryEntryChildren appears with entries.","Update macOS/lima if the ioreg output format changed.","Check that the full ioreg output (not truncated by a pipe) is being parsed.","Fall back to hostname identity; make sure the hostname is stable and unique."],"exampleFix":"// before (wrong flags, no children)\nioreg -c IOPlatformExpertDevice | head -1\n// after (full dump lima expects)\nioreg -rd1 -c IOPlatformExpertDevice","handlingStrategy":"validation","validationCode":"out, _ := exec.Command(\"ioreg\", \"-rd1\", \"-c\", \"IOPlatformExpertDevice\").Output()\nif !bytes.Contains(out, []byte(\"IORegistryEntryChildren\")) {\n    // environment will not yield IORegistryEntryChildren; skip machine-id and use hostname\n}","typeGuard":"func hasIORegistryEntryChildren(r io.Reader) bool {\n    var p plist.Plist\n    if err := xml.NewDecoder(r).Decode(&p); err != nil || p.Value.Dict == nil {\n        return false\n    }\n    ch, ok := p.Value.Dict[\"IORegistryEntryChildren\"]\n    return ok && ch.Array != nil && len(ch.Array) > 0\n}","tryCatchPattern":"id, err := osutil.MachineID(ctx)\nif err != nil && strings.Contains(err.Error(), \"IORegistryEntryChildren\") {\n    log.Warn(\"ioreg has no children; using hostname as machine id\")\n}","preventionTips":["Verify ioreg output on the target macOS/VM image before deployment","Capture the full ioreg output (avoid truncating pipes)","Keep fixtures updated when bumping macOS versions in CI"],"tags":["macos","plist","ioreg","machine-id"],"backgroundTag":"invalid-plist-structure","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}