appsmithorg/appsmith · error · AppsmithPluginException

PE-PLG-5000

PE-PLG-5000

Error message

Appsmith server failed to parse the type of sort condition. Please reach out to Appsmith customer support to resolve this.

What it means

An INTERNAL `PLUGIN_ERROR` (PE-PLG-5000) raised in `addSortCondition` when `SortType.valueOf(...)` fails a second time during query building. It is a defensive duplicate of the validation in error 105 and explicitly asks you to contact support - reaching it means `validateSortByColumns` did not run (or did not guard) before `addSortCondition`, which Appsmith treats as a server-side bug.

Source

Thrown at app/server/appsmith-interfaces/src/main/java/com/appsmith/external/services/ce/FilterDataServiceCE.java:388

         * Checks if:
         *  o `sortBy` condition list is null or empty
         *  o all column names in the sortBy list are empty
         */
        if (isSortConditionEmpty(sortBy)) {
            return;
        }

        sb.append(" ORDER BY");
        sortBy.stream()
                .filter(sortCondition -> !isBlank(sortCondition.get(SORT_BY_COLUMN_NAME_KEY)))
                .forEachOrdered(sortCondition -> {
                    String columnName = sortCondition.get(SORT_BY_COLUMN_NAME_KEY);
                    SortType sortType;
                    try {
                        sortType = SortType.valueOf(
                                sortCondition.get(SORT_BY_TYPE_KEY).toUpperCase());
                    } catch (IllegalArgumentException e) {
                        throw new AppsmithPluginException(
                                AppsmithPluginError.PLUGIN_ERROR,
                                "Appsmith server failed "
                                        + "to parse the type of sort condition. Please reach out to Appsmith customer support "
                                        + "to resolve this.");
                    }
                    sb.append(" `" + escapeBacktickIdentifier(columnName) + "` " + sortType + ",");
                });

        sb.setLength(sb.length() - 1);
    }

    /**
     * Checks if:
     * o `sortBy` condition list is null or empty
     * o all column names in the sortBy list are empty
     */
    private boolean isSortConditionEmpty(List<Map<String, String>> sortBy) {
        if (CollectionUtils.isEmpty(sortBy)) {

View on GitHub (pinned to 8cd9021c24)

Solutions

  1. Treat as a server bug: capture the exact sortBy payload and report it to Appsmith support.
  2. As a workaround, ensure every sort entry uses `order` = `ASCENDING`/`DESCENDING` so neither this branch nor error 105 can fire.
  3. Avoid mutating the sortBy list between submitting the query and execution.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    filterDataService.filterDataNew(items, params);
} catch (AppsmithPluginException e) {
    if ("PE-PLG-5000".equals(e.getAppErrorCode())
            && e.getMessage().contains("failed to parse the type of sort condition")) {
        // internal duplicate-parse failure; sanitize sortBy and retry
        params.setSortBy(sanitizeSortOrders(params.getSortBy()));
        return filterDataService.filterDataNew(items, params);
    }
    throw e;
}

Prevention

When it happens

Trigger: `addSortCondition` is called with a sort entry whose `order` (uppercased) is not `ASCENDING`/`DESCENDING`, AND this was not caught earlier by `validateSortByColumns` - e.g. the sortBy list was mutated between validation and SQL generation, or a code path bypasses validation.

Common situations: A regression where validation is skipped; concurrent modification of the sortBy list; an Appsmith upgrade that changed the validation/build ordering.

Understand the failure class

Related errors


AI-assisted analysis of appsmithorg/appsmith@8cd9021c24 (2026-08-12). Data as JSON: /api/errors/e694859fc4f35ea0. Report an issue: GitHub.