appsmithorg/appsmith · error · AppsmithPluginException

PE-GSH-5000

PE-GSH-5000

Error message

Missing a valid response object.

What it means

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.

Source

Thrown at app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/RowsGetMethod.java:144

            return List.of(
                    "'" + methodConfig.getSheetName() + "'!" + tableHeaderIndex + ":" + tableHeaderIndex,
                    "'" + methodConfig.getSheetName() + "'!A" + (tableHeaderIndex + 1) + ":ZZZ");
        } else if ("RANGE".equalsIgnoreCase(methodConfig.getQueryFormat())) {
            Matcher matcher = findAllRowsPattern.matcher(methodConfig.getSpreadsheetRange());
            matcher.find();
            return List.of(
                    "'" + methodConfig.getSheetName() + "'!" + matcher.group(1) + tableHeaderIndex + ":"
                            + matcher.group(2) + tableHeaderIndex,
                    "'" + methodConfig.getSheetName() + "'!" + methodConfig.getSpreadsheetRange());
        }
        return List.of();
    }

    @Override
    public JsonNode transformExecutionResponse(
            JsonNode response, MethodConfig methodConfig, Set<String> userAuthorizedSheetIds) {
        if (response == null) {
            throw new AppsmithPluginException(
                    GSheetsPluginError.QUERY_EXECUTION_FAILED, ErrorMessages.MISSING_VALID_RESPONSE_ERROR_MSG);
        }

        ArrayNode valueRanges = (ArrayNode) response.get("valueRanges");
        ArrayNode headers = (ArrayNode) valueRanges.get(0).get("values");
        ArrayNode values = (ArrayNode) valueRanges.get(1).get("values");

        if (headers == null || values == null || headers.isEmpty()) {
            return this.objectMapper.createArrayNode();
        }

        int valueSize = 0;
        for (int i = 0; i < values.size(); i++) {
            valueSize = Math.max(valueSize, values.get(i).size());
        }

        final String valueRange = valueRanges.get(1).get("range").asText();
        headers = (ArrayNode) headers.get(0);

View on GitHub (pinned to 8cd9021c24)

Solutions

  1. Check Appsmith server logs for the underlying HTTP status from sheets.googleapis.com ($batchGet) - the null body usually wraps a real 4xx/5xx.
  2. Re-authorize the Google Sheets datasource (refresh token may have expired).
  3. If behind a reverse proxy, verify it does not buffer/strip the response body for application/json.
  4. Confirm the spreadsheet/sheet still exists and is shared with the service account - a deleted sheet can return an empty response object.
  5. On Appsmith side, file an issue: transformExecutionResponse should map null to a structured QUERY_EXECUTION_FAILED error containing the upstream status.
Defensive patterns

Strategy: try-catch

Try / catch

// Appsmith query success/error callbacks
GetRows.run({
  onSuccess: (response) => {
    if (!response || (response.valueRanges && response.valueRanges.length < 2)) {
      showAlert('Sheets returned no usable data; check datasource auth and sharing', 'error');
      return;
    }
    // proceed
  },
  onError: (err) => {
    // err carries the PE-GSH-5000 message; surface server-side status if present
    showAlert(err.message, 'error');
  },
});

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of appsmithorg/appsmith@8cd9021c24 (2026-08-12). Data as JSON: /api/errors/e4387a19bd9ab961. Report an issue: GitHub.