{"record":{"id":"8ebedf7bc970bfff","repo":"grpc/grpc-go","slug":"outlierdetectionloadbalancingconfig-failurepercent-8ebedf","errorCode":null,"errorMessage":"OutlierDetectionLoadBalancingConfig.FailurePercentageEjection.enforcement_percentage = %v; must be <= 100","messagePattern":"OutlierDetectionLoadBalancingConfig\\.FailurePercentageEjection\\.enforcement_percentage = (.+?); must be <= 100","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/xds/balancer/outlierdetection/balancer.go","lineNumber":149,"sourceCode":"\t\treturn nil, fmt.Errorf(\"OutlierDetectionLoadBalancingConfig.interval = %s; must be >= 0\", lbCfg.Interval)\n\tcase lbCfg.BaseEjectionTime < 0:\n\t\treturn nil, fmt.Errorf(\"OutlierDetectionLoadBalancingConfig.base_ejection_time = %s; must be >= 0\", lbCfg.BaseEjectionTime)\n\tcase lbCfg.MaxEjectionTime < 0:\n\t\treturn nil, fmt.Errorf(\"OutlierDetectionLoadBalancingConfig.max_ejection_time = %s; must be >= 0\", lbCfg.MaxEjectionTime)\n\n\t// \"The fields max_ejection_percent,\n\t// success_rate_ejection.enforcement_percentage,\n\t// failure_percentage_ejection.threshold, and\n\t// failure_percentage.enforcement_percentage must have values less than or\n\t// equal to 100.\" - A50\n\tcase lbCfg.MaxEjectionPercent > 100:\n\t\treturn nil, fmt.Errorf(\"OutlierDetectionLoadBalancingConfig.max_ejection_percent = %v; must be <= 100\", lbCfg.MaxEjectionPercent)\n\tcase lbCfg.SuccessRateEjection != nil && lbCfg.SuccessRateEjection.EnforcementPercentage > 100:\n\t\treturn nil, fmt.Errorf(\"OutlierDetectionLoadBalancingConfig.SuccessRateEjection.enforcement_percentage = %v; must be <= 100\", lbCfg.SuccessRateEjection.EnforcementPercentage)\n\tcase lbCfg.FailurePercentageEjection != nil && lbCfg.FailurePercentageEjection.Threshold > 100:\n\t\treturn nil, fmt.Errorf(\"OutlierDetectionLoadBalancingConfig.FailurePercentageEjection.threshold = %v; must be <= 100\", lbCfg.FailurePercentageEjection.Threshold)\n\tcase lbCfg.FailurePercentageEjection != nil && lbCfg.FailurePercentageEjection.EnforcementPercentage > 100:\n\t\treturn nil, fmt.Errorf(\"OutlierDetectionLoadBalancingConfig.FailurePercentageEjection.enforcement_percentage = %v; must be <= 100\", lbCfg.FailurePercentageEjection.EnforcementPercentage)\n\t}\n\treturn lbCfg, nil\n}\n\nfunc (bb) Name() string {\n\treturn Name\n}\n\n// scUpdate wraps a subConn update to be sent to the child balancer.\ntype scUpdate struct {\n\tscw   *subConnWrapper\n\tstate balancer.SubConnState\n}\n\ntype ejectionUpdate struct {\n\tscw       *subConnWrapper\n\tisEjected bool // true for ejected, false for unejected\n}","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/grpc/grpc-go/blob/03255a9237b6eb32710f6bc4f2de9a675b99fe36/internal/xds/balancer/outlierdetection/balancer.go#L131-L167","documentation":"Returned by outlier detection ParseConfig (internal/xds/balancer/outlierdetection/balancer.go:148) when the optional `failure_percentage_ejection` block is present and its `enforcement_percentage` exceeds 100. gRFC A50 caps this field at 100; it controls the probability a failure-percentage outlier is actually ejected.","triggerScenarios":"ParseConfig gets JSON with a `failurePercentageEjection` object whose `enforcementPercentage` is > 100. Only checked when the block is non-nil.","commonSituations":"Control plane emits the value on a 0-1000 scale; operator confusion about percent vs fraction; misconfigured policy.","solutions":["Set `failurePercentageEjection.enforcementPercentage` to 0-100 (omit the block to disable)","Correct the upstream OutlierDetection failure_percentage_ejection config","Range-check enforcement percentages before publishing"],"exampleFix":"// before\n{\"failurePercentageEjection\":{\"enforcementPercentage\":200}}\n// after\n{\"failurePercentageEjection\":{\"enforcementPercentage\":100}}","handlingStrategy":"validation","validationCode":"var probe struct{ FPE struct{ EnforcementPercentage uint32 `json:\"enforcement_percentage\"` } `json:\"failure_percentage_ejection\"` }\n_ = json.Unmarshal(raw, &probe)\nif probe.FPE.EnforcementPercentage > 100 {\n    return fmt.Errorf(\"failure_percentage enforcement_percentage must be <= 100, got %d\", probe.FPE.EnforcementPercentage)\n}","typeGuard":null,"tryCatchPattern":"lbCfg, err := outlierBB.ParseConfig(raw)\nif err != nil {\n    logger.Warningf(\"rejecting outlier detection config: %v\", err)\n    return fallbackLBConfig\n}","preventionTips":["Treat enforcement_percentage as 0-100 integer","Validate only when failure_percentage_ejection is present"],"tags":["grpc","xds","outlier-detection","load-balancing","config","go"],"analyzedSha":"03255a9237b6eb32710f6bc4f2de9a675b99fe36","analyzedAt":"2026-08-07T00:29:34.215Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}