{"record":{"id":"c3ea032951686428","repo":"slackhq/nebula","slug":"stats-type-was-not-understood-s","errorCode":null,"errorMessage":"stats.type was not understood: %s","messagePattern":"stats\\.type was not understood: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"stats.go","lineNumber":366,"sourceCode":"\t\taddr, err := net.ResolveTCPAddr(cfg.graphite.protocol, cfg.graphite.host)\n\t\tif err != nil {\n\t\t\treturn cfg, fmt.Errorf(\"error while setting up graphite sink: %s\", err)\n\t\t}\n\t\tcfg.graphite.resolvedAddr = addr.String()\n\t\tcfg.graphite.prefix = c.GetString(\"stats.prefix\", \"nebula\")\n\tcase \"prometheus\":\n\t\tcfg.prom.listen = c.GetString(\"stats.listen\", \"\")\n\t\tif cfg.prom.listen == \"\" {\n\t\t\treturn cfg, errors.New(\"stats.listen should not be empty\")\n\t\t}\n\t\tcfg.prom.path = c.GetString(\"stats.path\", \"\")\n\t\tif cfg.prom.path == \"\" {\n\t\t\treturn cfg, errors.New(\"stats.path should not be empty\")\n\t\t}\n\t\tcfg.prom.namespace = c.GetString(\"stats.namespace\", \"\")\n\t\tcfg.prom.subsystem = c.GetString(\"stats.subsystem\", \"\")\n\tdefault:\n\t\treturn cfg, fmt.Errorf(\"stats.type was not understood: %s\", cfg.typ)\n\t}\n\n\treturn cfg, nil\n}\n","sourceCodeStart":348,"sourceCodeEnd":371,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/stats.go#L348-L371","documentation":"loadStatsConfig switches on cfg.typ after handling graphite and prometheus; any other stats.type value falls to the default case and is rejected with this message. Empty or 'none' types return earlier, so this specifically means an unrecognized non-empty type string.","triggerScenarios":"stats.type is set to an unsupported value such as 'statsd', 'Graphite' (case-sensitive), 'prom', or any typo, while being non-empty.","commonSituations":"Copy-pasting configs from other projects that use statsd; capitalization mistakes; assuming aliases like 'prom' work.","solutions":["Set stats.type to exactly one of: graphite, prometheus, none","Check casing — the comparison is case-sensitive","Replace statsd-style configs with the supported prometheus listener (stats.listen) if migrating","Remove the stats block entirely if metrics are not needed"],"exampleFix":"// before\nstats:\n  type: statsd\n// after\nstats:\n  type: prometheus\n  listen: 127.0.0.1:8080\n  path: /metrics","handlingStrategy":"validation","validationCode":"const validTypes = new Set([\"\", \"none\", \"graphite\", \"prometheus\"])\nif (!validTypes.has(cfg.stats?.type ?? \"none\")) {\n  throw new Error(`stats.type must be one of graphite|prometheus|none, got ${cfg.stats.type}`)\n}","typeGuard":null,"tryCatchPattern":"try {\n  loadConfig(path)\n} catch (e) {\n  if (e.message.includes(\"stats.type was not understood\")) {\n    console.error(\"fix stats.type casing/spelling; supported: graphite, prometheus, none\")\n  }\n  throw e\n}","preventionTips":["Use only the exact enum values: graphite, prometheus, none (lowercase)","Add a config schema check in CI for stats.type","Don't assume aliases (statsd, prom) — they are rejected"],"tags":["config","stats","validation","nebula"],"backgroundTag":"invalid-enum-config-value","analyzedSha":"dd8f660c0ac37903ec4080ca4d3c861ba9342ceb","analyzedAt":"2026-09-03T11:13:55.444Z","contentChangedAt":"2026-09-03T11:13:55.444Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}