SIGN IN SIGN UP
appsmithorg / appsmith UNCLAIMED

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.

0 0 68 TypeScript

fix: replace generic "Response not valid" with actionable error messages for better observability (#41769)

## Summary

- Replace the opaque "Response not valid" catch-all error with
meaningful, categorized messages that surface the actual failure reason
(Axios timeout, network error, server validation rejection)
- Fix the `runActionSaga` error cascade so specific transport error
messages are shown in the debugger console instead of falling through to
"An unexpected error occurred"
- Replace `result.setRequest(null)` in view mode with
`sanitizeRequestForViewMode()` that retains safe metadata (actionId,
requestedAt, httpMethod) while stripping sensitive fields (body,
headers, URL, params)
- Upgrade server-side execution error logging from
`System.out.println`/`printStackTrace()` to structured SLF4J with action
identity

Fixes
https://linear.app/appsmith/issue/APP-15199/replace-generic-response-not-valid-error-with-actionable-error

## Log level rationale

Action execution failures are typically caused by the **customer's
upstream API** (timeout, connection reset, invalid JSON content-type),
not by Appsmith itself. Logging these at `WARN`/`ERROR` level would
create production noise proportional to upstream error rates and could
trigger false alerts in monitoring systems.

We use **`log.debug`** for upstream-caused failures so self-hosted
operators can opt in by lowering the log level — making this an explicit
choice rather than default noise. The one exception is
`executionExceptionHandler`, which stays at **`log.warn`** because it
only fires for errors that escape the plugin's own error handling —
genuinely unexpected conditions that operators should know about.

| Log site | Level | Rationale |
|----------|-------|-----------|
| `RestApiPlugin` (upstream REST failure) | `debug` | Fires on every
upstream API error — could be very frequent. Error is already returned
to user in `ActionExecutionResult`. |
| `executionExceptionMapper` (error transformation) | `debug` |
Duplicated by `executionExceptionHandler` which runs right after. Only
fires for rare non-timeout/non-stale errors that escape the plugin. |
| `executionExceptionHandler` (catch-all) | **`warn`** | Only fires for
errors that escape plugin error handling — rare and genuinely
unexpected. One log line per such failure with action name and ID. |
| `RestAPIActivateUtils` (JSON parse fallback) | `debug` | Content-type
mismatch from upstream. Already surfaced to user via hint messages in
the response. |

The key improvement over the previous code is **structured SLF4J logging
with action identity** (replacing `System.out.println`,
`error.printStackTrace()`, and unstructured `log.debug`), not the log
level itself. When operators DO enable debug logging, they now get
actionable context instead of anonymous stack traces.

## Context

Enterprise customer (Plum) reported production debugging is impossible —
"Response not valid" errors cannot be traced to specific actions in view
mode. The root cause is a client-side catch-all that discards all error
context and a server-side request stripping that removes all correlation
metadata.

Slack thread:
https://theappsmith.slack.com/archives/C0341RERY4R/p1776882142131629
Linear (support): V2-3907

## Test plan

- [x] Unit tests for `extractExecutionErrorMessage` covering all error
categories
- [x] Server tests for `sanitizeRequestForViewMode` verifying sensitive
field stripping
- [x] CI (Spotless + lint + existing test suite)
- [ ] Manual: trigger a timeout in edit mode and verify the debugger
shows "Action execution timed out..." instead of "An unexpected error
occurred"
- [ ] Manual: trigger a network error in view mode and verify the JS
catch block receives a meaningful message

<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/25208490026>
> Commit: ce142c582025df62282f43fb953b0cf820f396db
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=25208490026&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Fri, 01 May 2026 10:02:25 UTC
<!-- end of auto-generated comment: Cypress test results  -->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* More informative error messages for transport/network issues and
timeouts instead of a generic fallback.
* View-mode action results now retain a sanitized request snapshot
(action ID, timestamp, HTTP method) for traceability.
* Server-side error handling now logs contextual details at debug/warn
levels instead of printing stack traces.

* **Tests**
* Added tests covering error message extraction and view-mode request
sanitization.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
S
subratadeypappu committed
287f1cd55ecea38288268fd16cbb8a8348b356c3
Parent: e498a7b
Committed by GitHub <noreply@github.com> on 5/6/2026, 10:05:12 AM