pinpoint-apm/pinpoint · error · IllegalArgumentException

invalid operator - not found left operand. operator=

Error message

invalid operator - not found left operand. operator=${operator}

What it means

For binary MatcherOperator nodes (AND/OR), traversal requires both left and right operands. A binary operator whose left operand is null is structurally invalid and triggers IllegalArgumentException 'invalid operator - not found left operand'. (A null right operand throws the sibling message on the following lines.)

Solutions

  1. Ensure binary operators are created with both left and right operands (operand1.and(operand2) / .or(...))
  2. Validate the assembled MatcherOperand tree for null children before registering the matcher
  3. Trace the matcher construction code path to find where the left operand became null

Example fix

// before
MatcherOperator op = new AndMatcherOperator(null, rightOperand);
// after
MatcherOperator op = new AndMatcherOperator(leftOperand, rightOperand);
Defensive patterns

Strategy: validation

Validate before calling

if (operand instanceof MatcherOperator && !(operand instanceof NotMatcherOperator)) { MatcherOperator op = (MatcherOperator) operand; if (op.getLeftOperand() == null || op.getRightOperand() == null) throw new IllegalStateException("binary operator missing operand"); }

Try / catch

try { boolean r = matcher.match(classLoader, operand, meta); } catch (IllegalArgumentException e) { log.error("malformed binary operator: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Evaluating a matcher tree containing a binary operator built without a left operand, e.g. new AndMatcherOperator(null, right) or building via chaining without a base operand.

Common situations: Fluent operand chaining started from a null operand; refactoring that dropped the first operand of an AND/OR expression; custom matcher assembly code constructing binary nodes manually.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/d9e94bf0553ea657. Report an issue: GitHub.

Appendix: source

Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/transformer/DefaultTransformerMatcher.java:264

        return null;
    }

    boolean traversal(ClassLoader classLoader, MatcherOperand operand, InternalClassMetadata classMetadata) {
        if (operand instanceof NotMatcherOperator) {
            NotMatcherOperator operator = (NotMatcherOperator) operand;
            if (operator.getRightOperand() == null) {
                throw new IllegalArgumentException("invalid operator - not found right operand. operator=" + operator);
            }

            final MatcherOperand rightOperand = operator.getRightOperand();
            // NOT
            return match(classLoader, rightOperand, classMetadata) == false;
        }

        MatcherOperator operator = (MatcherOperator) operand;
        // for binary operator.
        if (operator.getLeftOperand() == null) {
            throw new IllegalArgumentException("invalid operator - not found left operand. operator=" + operator);
        }
        final MatcherOperand leftOperand = operator.getLeftOperand();

        if (operator.getRightOperand() == null) {
            throw new IllegalArgumentException("invalid operator - not found right operand. operator=" + operator);
        }
        final MatcherOperand rightOperand = operator.getRightOperand();

        MatcherOperand firstOperand = leftOperand;
        MatcherOperand secondOperand = rightOperand;
        if (leftOperand.getExecutionCost() > rightOperand.getExecutionCost()) {
            // cost-based execution plan.
            firstOperand = rightOperand;
            secondOperand = leftOperand;
        }

        if (operand instanceof OrMatcherOperator) {
            // OR

View on GitHub (pinned to 744c3d3075)