{"record":{"id":"24e8e1aaf980bab3","repo":"thanos-io/thanos","slug":"log-decision-combination-is-not-supported","errorCode":null,"errorMessage":"log decision combination is not supported","messagePattern":"log decision combination is not supported","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/logging/grpc.go","lineNumber":87,"sourceCode":"\t\tglobalLevel = protocolOptionConfig.Level\n\t\tglobalStart = protocolOptionConfig.Decision.LogStart\n\t\tglobalEnd = protocolOptionConfig.Decision.LogEnd\n\t}\n\treturn globalLevel, globalStart, globalEnd, nil\n}\n\n// getGRPCLoggingOption returns the logging ENUM based on logStart and logEnd values.\nfunc getGRPCLoggingOption(logStart, logEnd bool) (grpc_logging.Option, error) {\n\tif !logStart && !logEnd {\n\t\treturn grpc_logging.WithLogOnEvents(), nil\n\t}\n\tif !logStart && logEnd {\n\t\treturn grpc_logging.WithLogOnEvents(grpc_logging.FinishCall), nil\n\t}\n\tif logStart && logEnd {\n\t\treturn grpc_logging.WithLogOnEvents(grpc_logging.StartCall, grpc_logging.FinishCall), nil\n\t}\n\treturn nil, fmt.Errorf(\"log decision combination is not supported\")\n}\n\n// validateLevel validates the list of level entries.\n// Raise an error if empty or log level not in uppercase.\nfunc validateLevel(level string) error {\n\tif level == \"\" {\n\t\treturn fmt.Errorf(\"level field in YAML file is empty\")\n\t}\n\tif level == \"INFO\" || level == \"DEBUG\" || level == \"ERROR\" || level == \"WARNING\" {\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"the format of level is invalid. Expected INFO/DEBUG/ERROR/WARNING, got this %v\", level)\n}\n\nfunc InterceptorLogger(l log.Logger) grpc_logging.Logger {\n\treturn grpc_logging.LoggerFunc(func(_ context.Context, lvl grpc_logging.Level, msg string, fields ...any) {\n\t\tlargs := append([]any{\"msg\", msg}, fields...)\n\t\tswitch lvl {","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/logging/grpc.go#L69-L105","documentation":"getGRPCLoggingOption maps the logStart/logEnd booleans onto grpc_logging.WithLogOnEvents values. All supported combinations (neither, end-only, start-only, both) are handled by the preceding ifs; reaching the final return means the inputs were invalid (e.g. a start-only combination rejected upstream), so the function reports an unsupported decision combination.","triggerScenarios":"Calling NewGRPCOption with a decision combination that falls through all if-branches — practically, logStart=true with logEnd=false after prior validations did not reject it, or misuse of the internal API.","commonSituations":"Programmatic construction of logging options passing booleans in the wrong order, or YAML where only logStart is enabled in a code path that does not support it.","solutions":["Set both logStart and logEnd to true, or both false, or logEnd only.","Check NewGRPCOption inputs so unsupported start-only combinations are filtered before calling.","Use the documented YAML decision keys instead of constructing options manually."],"exampleFix":"// before\nNewGRPCOption(level, logStart=true, logEnd=false) // unsupported in this path\n// after\nNewGRPCOption(level, logStart=true, logEnd=true)","handlingStrategy":"validation","validationCode":"if !(logStart == logEnd || (logEnd && !logStart)) {\n  return fmt.Errorf(\"only end-only or start+end logging supported\")\n}","typeGuard":null,"tryCatchPattern":"opt, err := logging.NewGRPCOption(level, logStart, logEnd)\nif err != nil { return nil, fmt.Errorf(\"unsupported log decision: %w\", err) }","preventionTips":["Use documented YAML decision keys instead of manual construction","Restrict UI/config generators to supported combinations","Cover option mapping with table-driven tests"],"tags":["grpc","logging","config-validation"],"backgroundTag":"conflicting-config-options","analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}