{"record":{"id":"af15aa991720d075","repo":"cilium/cilium","slug":"unexpected-event-buffer-config-value-format-shoul","errorCode":null,"errorMessage":"unexpected event buffer config value format, should be in format 'mapname=enabled_100_24h'","messagePattern":"unexpected event buffer config value format, should be in format 'mapname=enabled_100_24h'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/option/config.go","lineNumber":3570,"sourceCode":"// GetEventBufferConfig returns either the relevant config for a map name, or a default\n// one with enabled=false otherwise.\nfunc (d *DaemonConfig) GetEventBufferConfig(name string) BPFEventBufferConfig {\n\treturn d.bpfMapEventConfigs.get(name)\n}\n\nfunc (cs BPFEventBufferConfigs) get(name string) BPFEventBufferConfig {\n\treturn cs[name]\n}\n\n// ParseEventBufferTupleString parses a event buffer configuration tuple string.\n// For example: enabled_100_24h\n// Which refers to enabled=true, maxSize=100, ttl=24hours.\nfunc ParseEventBufferTupleString(optsStr string) (BPFEventBufferConfig, error) {\n\topts := strings.Split(optsStr, \"_\")\n\tenabled := false\n\tconf := BPFEventBufferConfig{}\n\tif len(opts) != 3 {\n\t\treturn conf, fmt.Errorf(\"unexpected event buffer config value format, should be in format 'mapname=enabled_100_24h'\")\n\t}\n\n\tif opts[0] != \"enabled\" && opts[0] != \"disabled\" {\n\t\treturn conf, fmt.Errorf(\"could not parse event buffer enabled: must be either 'enabled' or 'disabled'\")\n\t}\n\tif opts[0] == \"enabled\" {\n\t\tenabled = true\n\t}\n\tsize, err := strconv.Atoi(opts[1])\n\tif err != nil {\n\t\treturn conf, fmt.Errorf(\"could not parse event buffer maxSize int: %w\", err)\n\t}\n\tttl, err := time.ParseDuration(opts[2])\n\tif err != nil {\n\t\treturn conf, fmt.Errorf(\"could not parse event buffer ttl duration: %w\", err)\n\t}\n\tif size < 0 {\n\t\treturn conf, fmt.Errorf(\"event buffer max size cannot be less than zero (%d)\", conf.MaxSize)","sourceCodeStart":3552,"sourceCodeEnd":3588,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/pkg/option/config.go#L3552-L3588","documentation":"ParseEventBufferTupleString parses a BPF event-buffer config string of the form 'mapname=enabled_maxSize_ttl' (e.g. 'enabled_100_24h'). The string is split on '_' and must yield exactly 3 parts; this error is thrown when the split count differs, meaning the value is malformed.","triggerScenarios":"Calling ParseEventBufferTupleString with a string that, after splitting on '_', does not produce exactly 3 tokens — e.g. 'enabled_100', 'enabled_100_24h_extra', or a value missing the mapname=prefix format entirely.","commonSituations":"Users hand-editing ConfigMap/agent flags for BPFMapEventBuffers misspell the tuple, use commas or spaces instead of underscores, or supply only 'enabled' without size and TTL.","solutions":["Fix the value to have exactly three underscore-separated parts: enabled|disabled_maxSize_ttlDuration (e.g. 'enabled_100_24h').","Ensure the whole option string follows 'mapname=enabled_100_24h' including the map name and '=' prefix.","Quote or escape the value in your shell/manifest so it is not split or truncated before parsing."],"exampleFix":"// before\n--bpf-map-event-buffers=tracepoint_100_24h\n// after\n--bpf-map-event-buffers=tracepoint_syscalls=enabled_100_24h","handlingStrategy":"validation","validationCode":"parts := strings.Split(value, \"_\")\nif len(parts) != 3 {\n    return fmt.Errorf(\"event buffer tuple %q must be 'enabled|disabled_<size>_<ttl>'\", value)\n}","typeGuard":"func isValidEventBufferTuple(s string) bool {\n\tparts := strings.Split(s, \"_\")\n\treturn len(parts) == 3 && (parts[0] == \"enabled\" || parts[0] == \"disabled\")\n}","tryCatchPattern":"conf, err := ParseEventBufferTupleString(cfgStr)\nif err != nil {\n\treturn fmt.Errorf(\"bad event buffer config %q: %w\", cfgStr, err)\n}","preventionTips":["Keep tuple values in a shared constant or template with the exact format","Add a startup validation pass over all BPFMapEventBuffers entries","Use underscores only as separators; never inside map names or durations"],"tags":["go","config-parsing","bpf"],"backgroundTag":"config-parse-error","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}