apache/dolphinscheduler · error · GrpcTaskException

grpc check condition %s not supported

Error message

grpc check condition %s not supported

What it means

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.

Source

Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-grpc/src/main/java/org/apache/dolphinscheduler/plugin/task/grpc/GrpcTask.java:134

                try {
                    Status.Code codeEnum = Status.Code.valueOf(grpcParameters.getCondition());
                    Status expectedCode = Status.fromCode(codeEnum);
                    if (statusCode != expectedCode) {
                        log.error(
                                "grpc request failed, url: {}, method: {}, statusCode: {} (expect {}), checkCondition: {}",
                                grpcParameters.getUrl(), grpcParameters.getMethodName(), statusCode.getCode(),
                                expectedCode,
                                GrpcCheckCondition.STATUS_CODE_DEFAULT.name());
                        exitStatusCode = TaskConstants.EXIT_CODE_FAILURE;
                        return;
                    }
                } catch (IllegalArgumentException e) {
                    throw new GrpcTaskException(
                            String.format("grpc unrecogenized condition %s", grpcParameters.getCondition()));
                }
                break;
            default:
                throw new GrpcTaskException(String.format("grpc check condition %s not supported",
                        grpcParameters.getGrpcCheckCondition()));
        }
        // default success log
        log.info("grpc request success, url: {}, method: {}, statusCode: {}", grpcParameters.getUrl(),
                grpcParameters.getMethodName(), statusCode.getCode());
        exitStatusCode = TaskConstants.EXIT_CODE_SUCCESS;
    }

    @Override
    public AbstractParameters getParameters() {
        return this.grpcParameters;
    }

    public void addDefaultOutput(String response) {
        Property outputProperty = new Property();
        outputProperty.setProp(String.format("%s.%s", taskExecutionContext.getTaskName(), "response"));
        outputProperty.setDirect(Direct.OUT);
        outputProperty.setType(DataType.VARCHAR);

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Set grpcCheckCondition to a supported value (STATUS_CODE_DEFAULT or STATUS_CODE_MATCHED)
  2. Re-save the task through the UI so the enum is validated on input
  3. If you need a new check mode, add a case in validateResponse() for the enum value
  4. Check for version skew between the API/UI writing params and the worker executing them

Example fix

// before
{"grpcCheckCondition":"STATUS_CODE_EQUALS"}
// after
{"grpcCheckCondition":"STATUS_CODE_DEFAULT"}
Defensive patterns

Strategy: type-guard

Validate before calling

for (GrpcCheckCondition c : GrpcCheckCondition.values()) { /* ensure switch in validateResponse covers all */ }
// before execution:
if (grpcCheckCondition != GrpcCheckCondition.STATUS_CODE_DEFAULT
    && grpcCheckCondition != GrpcCheckCondition.STATUS_CODE_MATCHED) {
    throw new IllegalArgumentException("unsupported grpcCheckCondition: " + grpcCheckCondition);
}

Type guard

boolean isSupportedCheckCondition(GrpcCheckCondition c) {
    return c == GrpcCheckCondition.STATUS_CODE_DEFAULT || c == GrpcCheckCondition.STATUS_CODE_MATCHED;
}

Try / catch

try {
    task.handle(null);
} catch (GrpcTaskException e) {
    if (e.getMessage().contains("not supported")) {
        // set grpcCheckCondition to a supported enum value and re-run
    }
    throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/3dc765128a889d4e. Report an issue: GitHub.