{"record":{"id":"e4387a19bd9ab961","repo":"appsmithorg/appsmith","slug":"pe-gsh-5000-e4387a","errorCode":"PE-GSH-5000","errorMessage":"Missing a valid response object.","messagePattern":"Missing a valid response object\\.","errorType":"exception","errorClass":"AppsmithPluginException","httpStatus":500,"severity":"error","filePath":"app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/RowsGetMethod.java","lineNumber":144,"sourceCode":"            return List.of(\n                    \"'\" + methodConfig.getSheetName() + \"'!\" + tableHeaderIndex + \":\" + tableHeaderIndex,\n                    \"'\" + methodConfig.getSheetName() + \"'!A\" + (tableHeaderIndex + 1) + \":ZZZ\");\n        } else if (\"RANGE\".equalsIgnoreCase(methodConfig.getQueryFormat())) {\n            Matcher matcher = findAllRowsPattern.matcher(methodConfig.getSpreadsheetRange());\n            matcher.find();\n            return List.of(\n                    \"'\" + methodConfig.getSheetName() + \"'!\" + matcher.group(1) + tableHeaderIndex + \":\"\n                            + matcher.group(2) + tableHeaderIndex,\n                    \"'\" + methodConfig.getSheetName() + \"'!\" + methodConfig.getSpreadsheetRange());\n        }\n        return List.of();\n    }\n\n    @Override\n    public JsonNode transformExecutionResponse(\n            JsonNode response, MethodConfig methodConfig, Set<String> userAuthorizedSheetIds) {\n        if (response == null) {\n            throw new AppsmithPluginException(\n                    GSheetsPluginError.QUERY_EXECUTION_FAILED, ErrorMessages.MISSING_VALID_RESPONSE_ERROR_MSG);\n        }\n\n        ArrayNode valueRanges = (ArrayNode) response.get(\"valueRanges\");\n        ArrayNode headers = (ArrayNode) valueRanges.get(0).get(\"values\");\n        ArrayNode values = (ArrayNode) valueRanges.get(1).get(\"values\");\n\n        if (headers == null || values == null || headers.isEmpty()) {\n            return this.objectMapper.createArrayNode();\n        }\n\n        int valueSize = 0;\n        for (int i = 0; i < values.size(); i++) {\n            valueSize = Math.max(valueSize, values.get(i).size());\n        }\n\n        final String valueRange = valueRanges.get(1).get(\"range\").asText();\n        headers = (ArrayNode) headers.get(0);","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/appsmithorg/appsmith/blob/8cd9021c24cdbea1c3c12c966073708e83db60c2/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/RowsGetMethod.java#L126-L162","documentation":"Thrown in RowsGetMethod.transformExecutionResponse when the Google Sheets API response JsonNode is null. Code is GSheetsPluginError.QUERY_EXECUTION_FAILED (PE-GSH-5000) not an argument error - this is a query-execution failure surface. Message: MISSING_VALID_RESPONSE_ERROR_MSG = \"Missing a valid response object.\". Note the lines immediately after also dereference valueRanges.get(0) and get(1) without null checks, so a non-null but malformed response can NPE later.","triggerScenarios":"The Sheets v4 batchGet (ranges) call returned an empty/204 body, or a proxy/transformer in the plugin chain returned Mono.empty() so transformExecutionResponse gets null. Network intermediary (gateway) stripping the body, an auth retry that swallowed the response, or an upstream 4xx that was not converted into an HTTP-status error.","commonSituations":"Self-hosted Appsmith behind a corporate proxy that drops bodies on certain status codes; intermittent 502 where the error handler returns empty; a misconfigured OAuth refresh that yields a 401 with empty body.","solutions":["Check Appsmith server logs for the underlying HTTP status from sheets.googleapis.com ($batchGet) - the null body usually wraps a real 4xx/5xx.","Re-authorize the Google Sheets datasource (refresh token may have expired).","If behind a reverse proxy, verify it does not buffer/strip the response body for application/json.","Confirm the spreadsheet/sheet still exists and is shared with the service account - a deleted sheet can return an empty response object.","On Appsmith side, file an issue: transformExecutionResponse should map null to a structured QUERY_EXECUTION_FAILED error containing the upstream status."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Appsmith query success/error callbacks\nGetRows.run({\n  onSuccess: (response) => {\n    if (!response || (response.valueRanges && response.valueRanges.length < 2)) {\n      showAlert('Sheets returned no usable data; check datasource auth and sharing', 'error');\n      return;\n    }\n    // proceed\n  },\n  onError: (err) => {\n    // err carries the PE-GSH-5000 message; surface server-side status if present\n    showAlert(err.message, 'error');\n  },\n});","preventionTips":["Keep the Google Sheets datasource authorized; re-run OAuth if token errors appear.","Ensure the service account has view access to the spreadsheet before running List Rows.","If behind a proxy, verify response bodies are not stripped.","Watch server logs for the upstream HTTP status wrapping the null response."],"tags":["appsmith","google-sheets","response-handling","null-response","query-execution"],"backgroundTag":null,"analyzedSha":"8cd9021c24cdbea1c3c12c966073708e83db60c2","analyzedAt":"2026-08-12T22:14:19.293Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}