appsmithorg/appsmith · error · AppsmithPluginException

PE-GSH-5000

PE-GSH-5000

Error message

Missing a valid response object.

What it means

Thrown by FileDeleteMethod.transformExecutionResponse (FileDeleteMethod.java:57) with code PE-GSH-5000 (QUERY_EXECUTION_FAILED). After the Drive API DELETE returns, the plugin expects a JSON response node to transform; if `response` is null the transform cannot proceed. On success this method returns a synthetic `{"message":"Deleted spreadsheet successfully!"}`.

Source

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

    @Override
    public Mono<Object> executePrerequisites(MethodConfig methodConfig, OAuth2 oauth2) {
        return Mono.just(true);
    }

    @Override
    public WebClient.RequestHeadersSpec<?> getExecutionClient(WebClient webClient, MethodConfig methodConfig) {

        UriComponentsBuilder uriBuilder =
                getBaseUriBuilder(this.BASE_DRIVE_API_URL, methodConfig.getSpreadsheetId(), /* spreadsheet Id */ true);

        return webClient.method(HttpMethod.DELETE).uri(uriBuilder.build(true).toUri());
    }

    @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);
        }

        String errorMessage = "Deleted spreadsheet successfully!";

        return this.objectMapper.valueToTree(Map.of("message", errorMessage));
    }
}

View on GitHub (pinned to 8cd9021c24)

Solutions

  1. Check the plugin's Webclient configuration / response adapter — a 204 with no body should be coerced to an empty object node, not null, before transform.
  2. Inspect the actual HTTP status and body received from the Drive API (enable plugin request/response logging).
  3. If extending the plugin, wrap `transformExecutionResponse` callers to pass `objectMapper.createObjectNode()` instead of null on empty 2xx bodies.
  4. Verify OAuth2 credentials and scopes are still valid — an expired token can yield a non-JSON error that gets nulled out upstream.

Example fix

// before (framework-level: response arrives null)
public JsonNode transformExecutionResponse(JsonNode response, ...) {
    if (response == null) { throw ...; }   // trips on 204 No Content
    ...
}
// after — caller coerces empty body to an object node
JsonNode node = (body == null || body.isEmpty())
    ? objectMapper.createObjectNode()
    : objectMapper.readTree(body);
return method.transformExecutionResponse(node, config, ids);
Defensive patterns

Strategy: try-catch

Try / catch

// Wrap the action call; treat the plugin error as a likely framework/body-handling issue.
try {
  await deleteSpreadsheet.run();
} catch (e) {
  if (e && /Missing a valid response object/.test(e.message)) {
    // 204 No Content is a successful delete — verify via the Drive API list if needed.
    showToast("Delete sent but response was empty; verify the file is gone.", "warning");
  } else { throw e; }
}

Prevention

When it happens

Trigger: The DELETE request to the Drive API returned a 2xx with an empty/null body, or an upstream filter/adapter converted the body to null before transformExecutionResponse was called. The null check is the first statement, so any null response trips it immediately.

Common situations: Google Drive's DELETE endpoint legitimately returns `204 No Content` (empty body); a Webclient filter strips the body; a plugin error handler maps a non-JSON error body to null; a network layer returned an empty buffer. Since success itself has no body, a null here often indicates the response-handling pipeline rather than the API.

Related errors


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