langfuse/langfuse · error · InvalidRequestError
Evaluator filters are invalid. Remove unsupported or incompl
Error message
Evaluator filters are invalid. Remove unsupported or incomplete filters and try again.
What it means
Thrown as an InvalidRequestError by the evalRouter createJob mutation when validateEvaluatorFiltersForTarget reports the supplied filter array is invalid for the evaluator's target object. The thrown message is the first validation issue's message if present, otherwise this generic fallback text (e.g. when issues exist but carry no message).
Source
Thrown at web/src/features/evals/server/router.ts:598
projectId: input.projectId,
scope: "evalJob:CUD",
});
assertCanCreateLegacyEvalJob({
projectId: input.projectId,
target: input.target,
});
const variableMappingForTarget = validateVariableMappingForTarget({
targetObject: input.target,
mapping: input.mapping,
});
const filterValidation = validateEvaluatorFiltersForTarget({
targetObject: input.target,
filter: input.filter ?? [],
});
if (!filterValidation.isValid) {
throw new InvalidRequestError(
filterValidation.issues[0]?.message ??
"Evaluator filters are invalid. Remove unsupported or incomplete filters and try again.",
);
}
const validatedFilter = filterValidation.validatedFilters;
const compatibility = new LegacyEvalCompatibilityService(ctx.prisma);
const template = await compatibility.getTemplate(
input.projectId,
input.evalTemplateId,
);
if (!template) {
throw new LangfuseNotFoundError("Evaluator template not found");
}
if (template.type === EvalTemplateType.CODE) {
assertCodeEvalTemplateCanRun({
sourceCodeLanguage: template.sourceCodeLanguage,
});View on GitHub (pinned to 59d92c7cf3)
Solutions
- Remove unsupported or incomplete filter entries — only send filters valid for the evaluator's target object
- Rebuild the filter in the current UI's search-bar grammar and copy the resulting filter state
- Validate input.filter with validateEvaluatorFiltersForTarget client-side before submitting createJob
- If the first issue message is unhelpful (generic fallback text), inspect all filterValidation.issues via a dry-run or API echo to find the offending entry
Defensive patterns
Strategy: validation
Validate before calling
import { validateEvaluatorFiltersForTarget } from '...';
const { isValid } = validateEvaluatorFiltersForTarget({
targetObject: input.target,
filter: input.filter ?? [],
});
if (!isValid) {
// strip/fix invalid filters before createJob
} Type guard
function hasValidFilters(target: string, filter: unknown[]): boolean {
return validateEvaluatorFiltersForTarget({ targetObject: target, filter }).isValid;
} Prevention
- Validate filters with validateEvaluatorFiltersForTarget before submitting
- Build filters with the current search-bar grammar rather than hand-writing JSON
- Ensure every filter entry has column, operator, and value/type fields complete
When it happens
Trigger: Calling evalRouter.createJob with input.filter containing filter entries unsupported for input.target, or incomplete filter objects that fail validation but produce issues without messages.
Common situations: Filters copied from a trace-level UI into an observation-level evaluator; filter entries missing required fields (column/operator/value); legacy clients sending old filter shapes after the evaluator migration narrowed supported filters to what InMemoryFilterService can process.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- invalid_filter_value
- BAD_REQUEST
- ${result.issues.map(({ message }) => message).join(" ")}
- invalid_request
- invalid_request
AI-assisted analysis of langfuse/langfuse@59d92c7cf3 (2026-08-27).
Data as JSON: /api/errors/c0f526fc62bf4fb9.
Report an issue: GitHub.