{"record":{"id":"e694859fc4f35ea0","repo":"appsmithorg/appsmith","slug":"pe-plg-5000-e69485","errorCode":"PE-PLG-5000","errorMessage":"Appsmith server failed to parse the type of sort condition. Please reach out to Appsmith customer support to resolve this.","messagePattern":"Appsmith server failed to parse the type of sort condition\\. Please reach out to Appsmith customer support to resolve this\\.","errorType":"error_code","errorClass":"AppsmithPluginException","httpStatus":500,"severity":"error","filePath":"app/server/appsmith-interfaces/src/main/java/com/appsmith/external/services/ce/FilterDataServiceCE.java","lineNumber":388,"sourceCode":"         * Checks if:\n         *  o `sortBy` condition list is null or empty\n         *  o all column names in the sortBy list are empty\n         */\n        if (isSortConditionEmpty(sortBy)) {\n            return;\n        }\n\n        sb.append(\" ORDER BY\");\n        sortBy.stream()\n                .filter(sortCondition -> !isBlank(sortCondition.get(SORT_BY_COLUMN_NAME_KEY)))\n                .forEachOrdered(sortCondition -> {\n                    String columnName = sortCondition.get(SORT_BY_COLUMN_NAME_KEY);\n                    SortType sortType;\n                    try {\n                        sortType = SortType.valueOf(\n                                sortCondition.get(SORT_BY_TYPE_KEY).toUpperCase());\n                    } catch (IllegalArgumentException e) {\n                        throw new AppsmithPluginException(\n                                AppsmithPluginError.PLUGIN_ERROR,\n                                \"Appsmith server failed \"\n                                        + \"to parse the type of sort condition. Please reach out to Appsmith customer support \"\n                                        + \"to resolve this.\");\n                    }\n                    sb.append(\" `\" + escapeBacktickIdentifier(columnName) + \"` \" + sortType + \",\");\n                });\n\n        sb.setLength(sb.length() - 1);\n    }\n\n    /**\n     * Checks if:\n     * o `sortBy` condition list is null or empty\n     * o all column names in the sortBy list are empty\n     */\n    private boolean isSortConditionEmpty(List<Map<String, String>> sortBy) {\n        if (CollectionUtils.isEmpty(sortBy)) {","sourceCodeStart":370,"sourceCodeEnd":406,"githubUrl":"https://github.com/appsmithorg/appsmith/blob/8cd9021c24cdbea1c3c12c966073708e83db60c2/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/services/ce/FilterDataServiceCE.java#L370-L406","documentation":"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.","triggerScenarios":"`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.","commonSituations":"A regression where validation is skipped; concurrent modification of the sortBy list; an Appsmith upgrade that changed the validation/build ordering.","solutions":["Treat as a server bug: capture the exact sortBy payload and report it to Appsmith support.","As a workaround, ensure every sort entry uses `order` = `ASCENDING`/`DESCENDING` so neither this branch nor error 105 can fire.","Avoid mutating the sortBy list between submitting the query and execution."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    filterDataService.filterDataNew(items, params);\n} catch (AppsmithPluginException e) {\n    if (\"PE-PLG-5000\".equals(e.getAppErrorCode())\n            && e.getMessage().contains(\"failed to parse the type of sort condition\")) {\n        // internal duplicate-parse failure; sanitize sortBy and retry\n        params.setSortBy(sanitizeSortOrders(params.getSortBy()));\n        return filterDataService.filterDataNew(items, params);\n    }\n    throw e;\n}","preventionTips":["Always run validateSortByColumns (or your own ASCENDING/DESCENDING check) before calling filterDataNew.","Do not mutate the sortBy list between validation and execution.","Treat this error as a server bug - report it with the full sortBy payload."],"tags":["appsmith","uqi","sort","internal-error"],"backgroundTag":null,"analyzedSha":"8cd9021c24cdbea1c3c12c966073708e83db60c2","analyzedAt":"2026-08-12T22:14:19.293Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}