{"record":{"id":"a0564af832fedbb5","repo":"slackhq/nebula","slug":"error-while-setting-up-graphite-sink-s","errorCode":null,"errorMessage":"error while setting up graphite sink: %s","messagePattern":"error while setting up graphite sink: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"stats.go","lineNumber":350,"sourceCode":"\tif cfg.typ == \"\" || cfg.typ == \"none\" {\n\t\treturn cfg, nil\n\t}\n\n\tcfg.interval = c.GetDuration(\"stats.interval\", 0)\n\tif cfg.interval <= 0 {\n\t\treturn cfg, fmt.Errorf(\"stats.interval was an invalid duration: %s\", c.GetString(\"stats.interval\", \"\"))\n\t}\n\n\tswitch cfg.typ {\n\tcase \"graphite\":\n\t\tcfg.graphite.protocol = c.GetString(\"stats.protocol\", \"tcp\")\n\t\tcfg.graphite.host = c.GetString(\"stats.host\", \"\")\n\t\tif cfg.graphite.host == \"\" {\n\t\t\treturn cfg, errors.New(\"stats.host can not be empty\")\n\t\t}\n\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","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/stats.go#L332-L368","documentation":"When stats.type is graphite, loadStatsConfig resolves the graphite host via net.ResolveTCPAddr using the configured protocol (tcp/udp) and host. A DNS or address-format failure is wrapped as 'error while setting up graphite sink'. This fails config load, so nebula will not start until the graphite endpoint is resolvable or stats are disabled.","triggerScenarios":"stats.host is set to an unresolvable hostname, a malformed address (missing port, bad characters), or the protocol/address combination is invalid for net.ResolveTCPAddr; DNS outage at startup.","commonSituations":"Typo in the graphite hostname; DNS not available in containers at boot; forgetting the port (e.g. 'graphite.internal' instead of 'graphite.internal:2003'); IPv6 literals not bracketed.","solutions":["Set stats.host to host:port, e.g. graphite.example.com:2003","Verify DNS resolution from the nebula host: getent hosts <hostname>","Use an IP address instead of a hostname if DNS is unreliable at startup","For IPv6 literals use bracketed form: [::1]:2003","Set stats.type: none if graphite is not actually in use"],"exampleFix":"// before\nstats:\n  type: graphite\n  host: graphite.internal\n// after\nstats:\n  type: graphite\n  host: graphite.internal:2003","handlingStrategy":"validation","validationCode":"# Resolve the graphite endpoint the way nebula will, before starting\ngetent hosts graphite.internal\ncase \"$(uname -s)\" in Linux) ;; esac\n# Go equivalent:\nif _, err := net.ResolveTCPAddr(\"tcp\", \"graphite.internal:2003\"); err != nil {\n\tlog.Fatalf(\"graphite endpoint unresolvable: %v\", err)\n}","typeGuard":null,"tryCatchPattern":"try {\n  loadConfig(path)\n} catch (e) {\n  if (e.message.includes(\"error while setting up graphite sink\")) {\n    console.error(\"stats.host must be resolvable host:port; check DNS and port syntax\")\n  }\n  throw e\n}","preventionTips":["Always include the port: host:port format (graphite.internal:2003)","Prefer IPs or well-known DNS names verified from the nebula host at boot time","Bracket IPv6 literals: [2001:db8::1]:2003"],"tags":["config","stats","graphite","dns","network","nebula"],"backgroundTag":"dns-resolution-failed","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"}