{"record":{"id":"3dc765128a889d4e","repo":"apache/dolphinscheduler","slug":"grpc-check-condition-s-not-supported","errorCode":null,"errorMessage":"grpc check condition %s not supported","messagePattern":"grpc check condition (.+?) not supported","errorType":"validation","errorClass":"GrpcTaskException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-grpc/src/main/java/org/apache/dolphinscheduler/plugin/task/grpc/GrpcTask.java","lineNumber":134,"sourceCode":"                try {\n                    Status.Code codeEnum = Status.Code.valueOf(grpcParameters.getCondition());\n                    Status expectedCode = Status.fromCode(codeEnum);\n                    if (statusCode != expectedCode) {\n                        log.error(\n                                \"grpc request failed, url: {}, method: {}, statusCode: {} (expect {}), checkCondition: {}\",\n                                grpcParameters.getUrl(), grpcParameters.getMethodName(), statusCode.getCode(),\n                                expectedCode,\n                                GrpcCheckCondition.STATUS_CODE_DEFAULT.name());\n                        exitStatusCode = TaskConstants.EXIT_CODE_FAILURE;\n                        return;\n                    }\n                } catch (IllegalArgumentException e) {\n                    throw new GrpcTaskException(\n                            String.format(\"grpc unrecogenized condition %s\", grpcParameters.getCondition()));\n                }\n                break;\n            default:\n                throw new GrpcTaskException(String.format(\"grpc check condition %s not supported\",\n                        grpcParameters.getGrpcCheckCondition()));\n        }\n        // default success log\n        log.info(\"grpc request success, url: {}, method: {}, statusCode: {}\", grpcParameters.getUrl(),\n                grpcParameters.getMethodName(), statusCode.getCode());\n        exitStatusCode = TaskConstants.EXIT_CODE_SUCCESS;\n    }\n\n    @Override\n    public AbstractParameters getParameters() {\n        return this.grpcParameters;\n    }\n\n    public void addDefaultOutput(String response) {\n        Property outputProperty = new Property();\n        outputProperty.setProp(String.format(\"%s.%s\", taskExecutionContext.getTaskName(), \"response\"));\n        outputProperty.setDirect(Direct.OUT);\n        outputProperty.setType(DataType.VARCHAR);","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-grpc/src/main/java/org/apache/dolphinscheduler/plugin/task/grpc/GrpcTask.java#L116-L152","documentation":"validateResponse() switches on grpcParameters.getGrpcCheckCondition(); the default branch throws GrpcTaskException('grpc check condition %s not supported') when the enum-configured check condition is not one of the implemented strategies (e.g. STATUS_CODE_DEFAULT, STATUS_CODE_MATCHED). This protects against silently passing with an unimplemented check mode.","triggerScenarios":"grpcCheckCondition holds a value outside the switch's supported cases, typically from a stale task definition, hand-edited params, or a version where the enum gained values not yet handled in code.","commonSituations":"Upgrading DolphinScheduler where new GrpcCheckCondition enum values exist but the task execution path wasn't updated; params JSON edited manually with an invalid enum string (also causing enum parse issues); copy of a task from another environment with different enum values.","solutions":["Set grpcCheckCondition to a supported value (STATUS_CODE_DEFAULT or STATUS_CODE_MATCHED)","Re-save the task through the UI so the enum is validated on input","If you need a new check mode, add a case in validateResponse() for the enum value","Check for version skew between the API/UI writing params and the worker executing them"],"exampleFix":"// before\n{\"grpcCheckCondition\":\"STATUS_CODE_EQUALS\"}\n// after\n{\"grpcCheckCondition\":\"STATUS_CODE_DEFAULT\"}","handlingStrategy":"type-guard","validationCode":"for (GrpcCheckCondition c : GrpcCheckCondition.values()) { /* ensure switch in validateResponse covers all */ }\n// before execution:\nif (grpcCheckCondition != GrpcCheckCondition.STATUS_CODE_DEFAULT\n    && grpcCheckCondition != GrpcCheckCondition.STATUS_CODE_MATCHED) {\n    throw new IllegalArgumentException(\"unsupported grpcCheckCondition: \" + grpcCheckCondition);\n}","typeGuard":"boolean isSupportedCheckCondition(GrpcCheckCondition c) {\n    return c == GrpcCheckCondition.STATUS_CODE_DEFAULT || c == GrpcCheckCondition.STATUS_CODE_MATCHED;\n}","tryCatchPattern":"try {\n    task.handle(null);\n} catch (GrpcTaskException e) {\n    if (e.getMessage().contains(\"not supported\")) {\n        // set grpcCheckCondition to a supported enum value and re-run\n    }\n    throw e;\n}","preventionTips":["Only select check conditions exposed by the current UI version","Add exhaustive switch cases for all GrpcCheckCondition values in code","Watch for version skew between API writers and worker executors of params","Validate enum values at task-save time, not execution time"],"tags":["grpc","enum","unsupported","validation"],"backgroundTag":"unsupported-enum-value","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}