pinpoint-apm/pinpoint · error · InvalidParameterException

Invalid order by type : +orderBy+ not supported.

Error message

Invalid order by type : +orderBy+ not supported.

What it means

ExceptionTraceQueryParameter.Builder.setOrderBy converts the orderBy string via OrderByAttributes.fromValue. When the value does not match any supported attribute, InvalidParameterException('Invalid order by type : ... not supported.') is thrown, enforcing that sort columns come from a fixed enum of allowed fields.

Source

Thrown at exceptiontrace/exceptiontrace-web/src/main/java/com/navercorp/pinpoint/exceptiontrace/web/util/ExceptionTraceQueryParameter.java:171

        public Builder setExceptionId(long exceptionId) {
            this.exceptionId = exceptionId;
            return self();
        }

        public Builder setTimeWindowRangeCount(long timeWindowRangeCount) {
            this.timeWindowRangeCount = timeWindowRangeCount;
            return self();
        }

        public Builder setHardLimit(int limit) {
            this.hardLimit = Ints.constrainToRange(limit, 50, 200);
            return self();
        }

        public Builder setOrderBy(String orderBy) {
            OrderByAttributes order = OrderByAttributes.fromValue(orderBy);
            if (order == null) {
                throw new InvalidParameterException("Invalid order by type : " + orderBy + " not supported.");
            }
            this.orderBy = order;
            return self();
        }

        public Builder setIsDesc(boolean desc) {
            if (desc) {
                this.isDesc = "desc";
            } else {
                this.isDesc = "asc";
            }
            return self();
        }

        public Builder setGroupByAttributes(List<GroupByAttributes> groupByAttributes) {
            this.groupByAttributes.addAll(groupByAttributes);
            return self();
        }

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Check OrderByAttributes.fromValue(orderBy) != null before calling setOrderBy, or catch and default to a safe order
  2. Restrict UI to a whitelist of sortable columns matching the enum
  3. Update client values after a version rename of sortable fields

Example fix

// before
builder.setOrderBy(request.getParameter("orderBy")); // arbitrary user input
// after
String orderBy = request.getParameter("orderBy");
if (OrderByAttributes.fromValue(orderBy) != null) {
    builder.setOrderBy(orderBy);
} else {
    builder.setOrderBy("timestamp"); // default
}
Defensive patterns

Strategy: validation

Validate before calling

if (orderBy == null || OrderByAttributes.fromValue(orderBy) == null) {
    orderBy = "timestamp"; // safe default
}
builder.setOrderBy(orderBy);

Type guard

boolean isSupportedOrderBy(String orderBy) {
    return orderBy != null && OrderByAttributes.fromValue(orderBy) != null;
}

Try / catch

try {
    builder.setOrderBy(orderBy);
} catch (InvalidParameterException e) {
    logger.warn("Unsupported orderBy '{}', using default", orderBy);
    builder.setOrderBy("timestamp");
}

Prevention

When it happens

Trigger: Calling setOrderBy with a string not in OrderByAttributes — e.g. a column name from an untrusted UI request, wrong case, or a field renamed in a newer version.

Common situations: Web client sending an arbitrary orderBy query parameter; API change between versions renaming a sortable attribute; typos like 'timestamp' vs the supported value.

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


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