{"record":{"id":"e763994beba5125f","repo":"appsmithorg/appsmith","slug":"pe-jsn-4000-e76399","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/dynamoPlugin/src/main/java/com/external/plugins/DynamoPlugin.java","lineNumber":219,"sourceCode":"                        final String action = actionConfiguration.getPath();\n                        if (!StringUtils.hasLength(action)) {\n                            throw new AppsmithPluginException(\n                                    AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,\n                                    DynamoErrorMessages.MISSING_ACTION_NAME_ERROR_MSG);\n                        }\n                        requestData.put(\"action\", action);\n                        requestParams.add(new RequestParamDTO(ACTION_CONFIGURATION_PATH, action, null, null, null));\n                        requestParams.add(new RequestParamDTO(ACTION_CONFIGURATION_BODY, body, null, null, null));\n\n                        Map<String, Object> parameters = null;\n                        try {\n                            if (StringUtils.hasLength(body)) {\n                                parameters = objectMapper.readValue(body, HashMap.class);\n                            }\n                        } catch (IOException e) {\n                            final String message = \"Error parsing the JSON body: \" + e.getMessage();\n                            log.warn(message, e);\n                            throw new AppsmithPluginException(\n                                    AppsmithPluginError.PLUGIN_JSON_PARSE_ERROR, body, e.getMessage());\n                        }\n                        requestData.put(\"parameters\", parameters);\n\n                        final Class<?> requestClass;\n                        try {\n                            requestClass = Class.forName(\n                                    \"software.amazon.awssdk.services.dynamodb.model.\" + action + \"Request\");\n                        } catch (ClassNotFoundException e) {\n                            throw new AppsmithPluginException(\n                                    DynamoPluginError.UNKNOWN_ACTION_NAME,\n                                    String.format(DynamoErrorMessages.UNKNOWN_ACTION_NAME_ERROR_MSG, action),\n                                    e.getMessage());\n                        }\n\n                        try {\n                            final Method actionExecuteMethod = DynamoDbClient.class.getMethod(\n                                    // Convert `ListTables` to `listTables`, which is the name of the method to execute","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/appsmithorg/appsmith/blob/8cd9021c24cdbea1c3c12c966073708e83db60c2/app/server/appsmith-plugins/dynamoPlugin/src/main/java/com/external/plugins/DynamoPlugin.java#L201-L237","documentation":"In execute(), the action body string is parsed as a JSON HashMap via objectMapper.readValue(body, HashMap.class). If parsing fails (IOException), the plugin throws PLUGIN_JSON_PARSE_ERROR (PE-JSN-4000) with the raw body and the parser's error detail. The body must be a valid JSON object representing the DynamoDB request parameters.","triggerScenarios":"The action body contains malformed JSON — trailing commas, unquoted keys, single-quoted strings, unmatched braces, or a non-JSON value injected by a mustache binding.","commonSituations":"Hand-typed JSON with syntax errors; a mustache binding that injects a raw string or unquoted value into the JSON; a body that is whitespace-only or contains a JSON array instead of an object; copy-paste introducing smart quotes.","solutions":["Validate the body with a JSON linter before saving the action.","Ensure mustache bindings inject valid JSON fragments — wrap string values in quotes or use JSONPath-style bindings.","Use double quotes for all keys and string values; remove trailing commas.","Confirm the body is a JSON object (starts with '{'), not an array or scalar."],"exampleFix":"// before — unquoted keys, trailing comma\nString body = \"{ TableName: 'Music', }\";\n\n// after\nString body = \"{\\\"TableName\\\":\\\"Music\\\"}\";","handlingStrategy":"validation","validationCode":"String body = actionConfiguration.getBody();\nif (StringUtils.hasLength(body)) {\n    try {\n        objectMapper.readTree(body); // validate parseability\n    } catch (IOException e) {\n        throw new IllegalArgumentException(\n            \"Action body is not valid JSON: \" + e.getMessage());\n    }\n}","typeGuard":null,"tryCatchPattern":"plugin.execute(actionConfiguration, dsConfig)\n    .onErrorResume(e -> e instanceof AppsmithPluginException ape\n            && \"PE-JSN-4000\".equals(ape.getErrorDTO().getAppErrorCode()),\n        e -> { log.warn(\"Bad JSON body\", e); return Mono.just(errorResult(e)); });","preventionTips":["Validate the JSON body with a linter before saving the action.","Ensure mustache bindings inject valid JSON fragments, not raw unquoted strings.","Confirm the body is a JSON object (starts with '{')."],"tags":["dynamodb","json-parse","body-validation","pe-jsn-4000"],"backgroundTag":null,"analyzedSha":"8cd9021c24cdbea1c3c12c966073708e83db60c2","analyzedAt":"2026-08-12T22:14:19.293Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}