apache/dolphinscheduler · error · GrpcTaskException
grpc unrecogenized condition %s
Error message
grpc unrecogenized condition %s
What it means
GrpcTask.validateResponse() evaluates the configured condition (grpcParameters.getCondition()) against the response status code. If parsing the condition throws IllegalArgumentException (unknown condition string), it throws GrpcTaskException('grpc unrecogenized condition %s'). The condition string is not one the checker recognizes.
Source
Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-grpc/src/main/java/org/apache/dolphinscheduler/plugin/task/grpc/GrpcTask.java:129
exitStatusCode = TaskConstants.EXIT_CODE_FAILURE;
return;
}
break;
case STATUS_CODE_CUSTOM:
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;
}
View on GitHub (pinned to 02eac45a1b)
Solutions
- Set condition to one of the supported values (e.g. EQ, NEQ as defined by GrpcTask's condition handling)
- Trim whitespace and fix casing of the condition in the task form
- Re-save the task definition and re-run
- If upgrading, migrate old condition values to the current accepted set
Example fix
// before
{"condition":"=="}
// after
{"condition":"EQ"} Defensive patterns
Strategy: validation
Validate before calling
Set<String> allowed = Set.of("EQ","NEQ","GT","LT","GE","LE"); // match GrpcTask's supported set
if (!allowed.contains(condition == null ? "" : condition.trim())) {
throw new IllegalArgumentException("unsupported condition: " + condition);
} Try / catch
try {
task.handle(null);
} catch (GrpcTaskException e) {
if (e.getMessage().startsWith("grpc unrecogenized condition")) {
// fix condition value in the task definition and re-run
}
throw e;
} Prevention
- Choose condition values only from the UI dropdown (no free text)
- Trim whitespace from condition strings
- Migrate old condition spellings after upgrades
- Add unit tests covering every supported condition string
When it happens
Trigger: grpcParameters.getCondition() contains an unrecognized operator/string (e.g. 'equals' vs '=', typo, or empty/whitespace) passed to an enum.valueOf-style parse that throws IllegalArgumentException.
Common situations: Hand-typing the condition in the UI; condition values from older task definitions no longer supported; copy-paste with extra spaces or wrong casing.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- gRPC task params is not valid, method definition may not cor
- grpc check condition %s not supported
- cannot merge json message to protobuf definition type <messa
- grpc task method name is invalid
- grpc exception: Unrecognized field label:
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/e9f9ace883ed5390.
Report an issue: GitHub.