{"record":{"id":"e0c568a73f0092f9","repo":"prometheus/node_exporter","slug":"did-not-parse-a-single-q-metric","errorCode":null,"errorMessage":"did not parse a single %q metric","messagePattern":"did not parse a single %q metric","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"collector/zfs_linux.go","lineNumber":250,"sourceCode":"\t\t// TODO: when other KSTAT_DATA_* types arrive, much of this will need to be restructured\n\t\tkey := fmt.Sprintf(\"kstat.zfs.misc.%s.%s\", fmtExt, parts[0])\n\t\tswitch parts[1] {\n\t\tcase kstatDataUint64:\n\t\t\tvalue, err := strconv.ParseUint(parts[2], 10, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"could not parse expected unsigned integer value for %q: %w\", key, err)\n\t\t\t}\n\t\t\thandler(zfsSysctl(key), value)\n\t\tcase kstatDataInt64:\n\t\t\tvalue, err := strconv.ParseInt(parts[2], 10, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"could not parse expected signed integer value for %q: %w\", key, err)\n\t\t\t}\n\t\t\thandler(zfsSysctl(key), value)\n\t\t}\n\t}\n\tif !parseLine {\n\t\treturn fmt.Errorf(\"did not parse a single %q metric\", fmtExt)\n\t}\n\n\treturn scanner.Err()\n}\n\nfunc (c *zfsCollector) parsePoolProcfsFile(reader io.Reader, zpoolPath string, handler func(string, zfsSysctl, uint64)) error {\n\tscanner := bufio.NewScanner(reader)\n\n\tparseLine := false\n\tvar fields []string\n\tfor scanner.Scan() {\n\t\tline := strings.Fields(scanner.Text())\n\n\t\tif !parseLine && len(line) >= 12 && line[0] == \"nread\" {\n\t\t\t//Start parsing from here.\n\t\t\tparseLine = true\n\t\t\tfields = make([]string, len(line))\n\t\t\tcopy(fields, line)","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/prometheus/node_exporter/blob/17ddd77c59ba27e1508e9f7894b1e55b44d6aed3/collector/zfs_linux.go#L232-L268","documentation":"parseProcfsFile finished reading the ZFS kstat file for the given format but parsed zero metrics from it, so the parser returns this error rather than silently producing nothing. This fires when the file is empty, has no `name type data` header, or all lines were skipped — e.g. truncated output or a changed file layout.","triggerScenarios":"Thrown at collector/zfs_linux.go:250 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the kstat file content directly, e.g. `cat /proc/spl/kstat/zfs/arcstats`, confirming the `name type data` header and data rows exist.","Verify the ZFS module is fully loaded (not mid-load) and the file is populated.","Compare the file layout with the ZFS version node_exporter expects; upgrade the exporter for newer ZFS formats."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"17ddd77c59ba27e1508e9f7894b1e55b44d6aed3","analyzedAt":"2026-09-07T17:54:06.211Z","contentChangedAt":"2026-09-07T17:54:06.211Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}