{"record":{"id":"3433478d276543d4","repo":"appsmithorg/appsmith","slug":"pe-gsh-5000-343347","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/FileInfoMethod.java","lineNumber":117,"sourceCode":"    @Override\n    public WebClient.RequestHeadersSpec<?> getExecutionClient(WebClient webClient, MethodConfig methodConfig) {\n\n        UriComponentsBuilder uriBuilder = getBaseUriBuilder(\n                this.BASE_DRIVE_API_URL,\n                methodConfig.getSpreadsheetId()\n                        + \"?supportsAllDrives=true&fields=id,name,permissions/role,permissions/emailAddress,createdTime,modifiedTime\");\n\n        return webClient\n                .method(HttpMethod.GET)\n                .uri(uriBuilder.build(false).toUri())\n                .body(BodyInserters.empty());\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        Map<String, Object> responseObj = new HashMap<>();\n        if (methodConfig.getBody() instanceof List) {\n            responseObj.put(\"sheets\", methodConfig.getBody());\n        }\n        Iterator<String> fieldNames = response.fieldNames();\n        while (fieldNames.hasNext()) {\n            String fieldName = fieldNames.next();\n            responseObj.put(fieldName, response.get(fieldName));\n        }\n        return this.objectMapper.valueToTree(responseObj);\n    }\n\n    @Override\n    public boolean validateTriggerMethodRequest(MethodConfig methodConfig) {\n        return this.validateExecutionMethodRequest(methodConfig);","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/appsmithorg/appsmith/blob/8cd9021c24cdbea1c3c12c966073708e83db60c2/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/FileInfoMethod.java#L99-L135","documentation":"Thrown by FileInfoMethod.transformExecutionResponse (FileInfoMethod.java:117) with code PE-GSH-5000. The 'Get Spreadsheet Details' action expects a non-null JSON response from the Drive API `files/{id}?fields=...` call to merge metadata into the output map. A null response aborts the transform before `methodConfig.getBody()` is read.","triggerScenarios":"The Drive API metadata GET returned a body that arrived as null at the transform step — e.g. an empty 204, an adapter that nulled a non-JSON error, or a Webclient filter that consumed the body. The null check is the first line of transformExecutionResponse.","commonSituations":"Expired/revoked OAuth token causing a non-JSON 401 that gets normalized to null; the spreadsheet was deleted between validation and the GET; a misconfigured response adapter strips the body; rate-limit (429) body lost in error mapping.","solutions":["Enable plugin HTTP logging to capture the real status code and body from the Drive API.","Re-authorize the Google Sheets datasource if the OAuth token expired (re-run the auth flow).","Confirm the target spreadsheet still exists and the account has access.","If patching the plugin, coerce a null/empty body to an empty object node before invoking transformExecutionResponse."],"exampleFix":"// before — transform receives null\npublic JsonNode transformExecutionResponse(JsonNode response, ...) {\n    if (response == null) { throw ...; }\n    ...\n}\n// after — framework coerces empty body\nJsonNode node = body == null ? objectMapper.createObjectNode() : objectMapper.readTree(body);\nreturn method.transformExecutionResponse(node, config, ids);","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Retry once on the null-response error; it is often transient (token/expiry).\nasync function getInfoSafe() {\n  try { return await getInfo.run(); }\n  catch (e) {\n    if (e && /Missing a valid response object/.test(e.message)) {\n      await refreshAuth(); // re-run datasource auth if available\n      return await getInfo.run();\n    }\n    throw e;\n  }\n}","preventionTips":["Keep the Google Sheets datasource OAuth token fresh.","Enable HTTP logging to inspect the real Drive API response.","Confirm the target spreadsheet still exists and is shared with the account."],"tags":["google-sheets","appsmith","response-handling","get-spreadsheet-info","null-response"],"backgroundTag":null,"analyzedSha":"8cd9021c24cdbea1c3c12c966073708e83db60c2","analyzedAt":"2026-08-12T22:14:19.293Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}