{"record":{"id":"25fe0be41c694030","repo":"appsmithorg/appsmith","slug":"pe-jsn-4000-25fe0b","errorCode":"PE-JSN-4000","errorMessage":"Plugin failed to parse JSON \"{0}\"","messagePattern":"Plugin failed to parse JSON \"(.+?)\"","errorType":"exception","errorClass":"AppsmithPluginException","httpStatus":500,"severity":"error","filePath":"app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/RowsBulkAppendMethod.java","lineNumber":87,"sourceCode":"                        ErrorMessages.INVALID_TABLE_HEADER_INDEX,\n                        e.getMessage());\n            }\n        } else {\n            throw new AppsmithPluginException(\n                    AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, ErrorMessages.INVALID_TABLE_HEADER_INDEX);\n        }\n        JsonNode bodyNode;\n        try {\n            bodyNode = this.objectMapper.readTree(methodConfig.getRowObjects());\n        } catch (IllegalArgumentException e) {\n            if (!StringUtils.hasLength(methodConfig.getRowObjects())) {\n                throw new AppsmithPluginException(\n                        AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,\n                        ErrorMessages.EMPTY_ROW_ARRAY_OBJECT_MESSAGE);\n            }\n            throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, e.getMessage());\n        } catch (JsonProcessingException e) {\n            throw new AppsmithPluginException(\n                    AppsmithPluginError.PLUGIN_JSON_PARSE_ERROR,\n                    methodConfig.getRowObjects(),\n                    ErrorMessages.EXPECTED_LIST_OF_ROW_OBJECTS_ERROR_MSG + \" Error: \" + e.getMessage());\n        }\n\n        if (!bodyNode.isArray()) {\n            throw new AppsmithPluginException(\n                    AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, ErrorMessages.REQUEST_BODY_NOT_ARRAY);\n        }\n        return true;\n    }\n\n    /**\n     * We need to execute this prerequisite even for append, so that we can maintain the column ordering as\n     * received from the sheet itself.\n     */\n    @Override\n    public Mono<Object> executePrerequisites(MethodConfig methodConfig, OAuth2 oauth2) {","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/appsmithorg/appsmith/blob/8cd9021c24cdbea1c3c12c966073708e83db60c2/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/RowsBulkAppendMethod.java#L69-L105","documentation":"Thrown by RowsBulkAppendMethod.validateExecutionMethodRequest when readTree raises JsonProcessingException — the rowObjects string is non-empty and JSON-like but syntactically broken. Code PE-JSN-4000 (PLUGIN_JSON_PARSE_ERROR, message 'Plugin failed to parse JSON \"{0}\"', category 'Invalid JSON found', INTERNAL_ERROR). The thrown detail includes the raw input and the appended Jackson error.","triggerScenarios":"A bulk-append row array with JSON syntax errors — unquoted keys, trailing commas, single quotes, mismatched brackets. readTree throws JsonProcessingException and the catch wraps it as PLUGIN_JSON_PARSE_ERROR.","commonSituations":"Hand-written JSON arrays, template strings that produced broken output, smart-quote paste artifacts.","solutions":["Lint the array JSON and fix the syntax error named in the appended 'Error:' detail.","Bind via JSON.stringify so Appsmith serializes correctly: {{ JSON.stringify([{Name:'Alice'}]) }}.","Use double-quoted keys and remove trailing commas."],"exampleFix":"// before\n[{Name: 'Alice',}]   // unquoted keys, trailing comma, single quotes\n\n// after\n[{\"Name\":\"Alice\"}]","handlingStrategy":"validation","validationCode":"// Reject malformed JSON arrays before the plugin parses them\nString rowObjects = methodConfig.getRowObjects();\ntry {\n    com.fasterxml.jackson.databind.JsonNode n = objectMapper.readTree(rowObjects);\n    if (!n.isArray()) throw new IllegalArgumentException(\"Expected a JSON array\");\n} catch (com.fasterxml.jackson.core.JsonProcessingException e) {\n    // show e.getMessage() and abort\n}","typeGuard":"boolean isValidJsonArray(ObjectMapper om, String s) {\n    try { return om.readTree(s).isArray(); } catch (Exception e) { return false; }\n}","tryCatchPattern":null,"preventionTips":["Use JSON.stringify for array payloads.","Double-quote keys and avoid trailing commas.","Lint array JSON in the editor before running."],"tags":["google-sheets","appsmith","json","validation","parsing","row-object","array"],"backgroundTag":null,"analyzedSha":"8cd9021c24cdbea1c3c12c966073708e83db60c2","analyzedAt":"2026-08-12T22:14:19.293Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}