appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

[Bug]: Client-side timeout error page displays misleading "504" HTTP status code

Open m-k8s opened this issue 9 months ago • 4 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Description

When a client-side request timeout occurs (Axios ECONNABORTED), the error page displays 504 as the error code. This is misleading because:

  • No HTTP 504 response was received - the timeout is purely client-side
  • Debugging confusion - administrators search for 504 errors in server/proxy logs but find none
  • Misdiagnosis - users assume the proxy or backend returned a 504 Gateway Timeout when the issue is purely client-side
  • False root cause analysis - teams may incorrectly tune server/proxy timeouts when the actual issue is client-side timeout configuration

Expected behavior: The error page should either display no HTTP status code (since none was received) or use a textual label like "Request Timeout" instead of a fake numeric HTTP status code.

Steps To Reproduce

  1. Create slow-proxy.py (a minimal HTTP proxy that introduces a 25-second delay on specific API calls):
#!/usr/bin/env python3

import http.server, socketserver, urllib.request, urllib.error, time

PORT = 3001
TARGET = "http://localhost:80"
DELAY = 25
PATH = "/api/v1/actions/view?applicationId"

class Proxy(http.server.BaseHTTPRequestHandler):
    def do_GET(self): self._proxy()
    def do_POST(self): self._proxy()
    def do_PUT(self): self._proxy()
    def do_DELETE(self): self._proxy()
    def log_message(self, format, *args): pass

    def _proxy(self):
        if PATH in self.path:
            print(f"SLOW {DELAY}s: {self.path[:60]}")
            time.sleep(DELAY)

        body = self.rfile.read(int(self.headers.get("Content-Length", 0))) or None
        headers = {k: v for k, v in self.headers.items() if k.lower() not in {"host", "connection"}}

        try:
            req = urllib.request.Request(f"{TARGET}{self.path}", body, headers, method=self.command)
            with urllib.request.urlopen(req, timeout=60) as r:
                self.send_response(r.status)
                [self.send_header(k, v) for k, v in r.headers.items() if k.lower() != "transfer-encoding"]
                self.end_headers()
                self.wfile.write(r.read())
        except urllib.error.HTTPError as e:
            self.send_response(e.code)
            self.end_headers()
            self.wfile.write(e.read())
        except BrokenPipeError:
            pass  # Client closed connection (timeout) - expected behavior

print(f"Go to http://localhost:{PORT}/app/your-app-slug to see the 504 error page after {DELAY}s.")
socketserver.ThreadingTCPServer(("", PORT), Proxy).serve_forever()
  1. Start the proxy: python3 slow-proxy.py
  2. Navigate to http://localhost:3001/app/your-app-slug in a browser
  3. Wait ~20 seconds for the Appsmith error page to appear
  4. Observe: The error page displays "504" status code
  5. Verify no actual 504 occurred:
    • Network tab: request was aborted client-side (no HTTP response)
    • Server/proxy logs: no 504 error logged

Public Sample App

No response

Environment

Production

Severity

Low (Cosmetic UI issues)

Issue video log

No response

Version

v1.90

m-k8s avatar Feb 05 '26 06:02 m-k8s

APP-14876

linear[bot] avatar Feb 05 '26 06:02 linear[bot]

I would like to work on this

AyushK5ingh avatar Mar 23 '26 21:03 AyushK5ingh

Hi opened a PR for this: #41747 (https://github.com/appsmithorg/appsmith/pull/41747).

The fix drops the misleading 504 badge from the client-side timeout error page (and removes the now-unused PAGE_SERVER_TIMEOUT_ERROR_CODE constant). Title/description on the page are unchanged. Happy to expand scope (e.g. rewording the title so it doesn't imply the server responded) if maintainers prefer.

itsmejay80 avatar Apr 18 '26 22:04 itsmejay80

cc @Nikhil-Nandagopal @pranavkanade PR is at #41747 whenever you have a moment.

itsmejay80 avatar Apr 18 '26 22:04 itsmejay80