{"record":{"id":"4bb5797a7c691a15","repo":"prometheus/node_exporter","slug":"couldn-t-get-sysctl-w","errorCode":null,"errorMessage":"couldn't get sysctl: %w","messagePattern":"couldn't get sysctl: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"collector/netisr_freebsd.go","lineNumber":92,"sourceCode":"\t\t\t\tvalueType:   prometheus.GaugeValue,\n\t\t\t},\n\t\t\t{\n\t\t\t\tname:        \"maxthreads\",\n\t\t\t\tdescription: \"netisr maximum thread count\",\n\t\t\t\tmib:         \"net.isr.maxthreads\",\n\t\t\t\tdataType:    bsdSysctlTypeUint32,\n\t\t\t\tvalueType:   prometheus.GaugeValue,\n\t\t\t},\n\t\t},\n\t\tlogger: logger,\n\t}, nil\n}\n\nfunc (c *netisrCollector) Update(ch chan<- prometheus.Metric) error {\n\tfor _, m := range c.sysctls {\n\t\tv, err := m.Value()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"couldn't get sysctl: %w\", err)\n\t\t}\n\n\t\tch <- prometheus.MustNewConstMetric(\n\t\t\tprometheus.NewDesc(\n\t\t\t\tprometheus.BuildFQName(namespace, netisrCollectorSubsystem, m.name),\n\t\t\t\tm.description,\n\t\t\t\tnil, nil,\n\t\t\t), m.valueType, v)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":74,"sourceCodeEnd":105,"githubUrl":"https://github.com/prometheus/node_exporter/blob/17ddd77c59ba27e1508e9f7894b1e55b44d6aed3/collector/netisr_freebsd.go#L74-L105","documentation":"The FreeBSD netisr collector reads each configured sysctl OID (via the gosysctl-style m.Value() call) to export netisr queue/processing metrics. Any failure reading a sysctl value is wrapped as 'couldn't get sysctl' and aborts the Update, dropping all node_netisr_* metrics for that scrape.","triggerScenarios":"m.Value() fails for one of c.sysctls: the OID does not exist on this kernel (netisr disabled or renamed), the sysctl name string is malformed, or reading is denied by permissions/jail restrictions.","commonSituations":"Running inside a FreeBSD jail where netisr sysctls are hidden; FreeBSD version differences that renamed or removed net.*.netisr OIDs; building with a stale sysctl list after a FreeBSD upgrade; typos in collector-maintained sysctl names.","solutions":["Run `sysctl net.isr` (or the specific OID) manually on the host to confirm it exists and is readable.","If inside a jail, run node_exporter on the host or grant the jail access to the needed sysctls.","Check the FreeBSD version matches what the node_exporter release supports; upgrade the exporter for newer/renamed OIDs.","Read the wrapped inner error to see which sysctl name failed.","Temporarily disable the collector (--collector.disable-defaults, enable others) if netisr metrics are not required."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// preflight on FreeBSD: verify sysctl OIDs are readable\nfor _, name := range []string{\"net.isr.num_threads\", \"net.isr.drop\"} {\n\tif _, err := sysctl.Sysctl(name); err != nil {\n\t\treturn fmt.Errorf(\"sysctl %s unreadable: %w\", name, err)\n\t}\n}","typeGuard":null,"tryCatchPattern":"err := collector.Update(ch)\nif err != nil && strings.Contains(err.Error(), \"couldn't get sysctl\") {\n\tlogger.Warn(\"netisr sysctl unavailable; skipping netisr scrape\", \"cause\", err)\n\treturn nil\n}","preventionTips":["Verify `sysctl net.isr` output on the target host before enabling the collector","Do not run inside jails without sysctl access; run on the host instead","Match node_exporter version to FreeBSD release (OID names change across versions)","Track the wrapped sysctl name in logs to spot renamed OIDs after upgrades"],"tags":["freebsd","sysctl","network"],"backgroundTag":"file-read-failed","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"}