gravitational/teleport · error
http.StatusText(code)
Error message
http.StatusText(code)
What it means
The AWS signer handler's formatForwardResponseError writes the standard status text (http.StatusText of the code derived from the trace error) as the response body when proxying a signed AWS API request fails; the literal is the reason phrase for the mapped code.
Source
Thrown at lib/srv/app/aws/handler.go:123
var err error
handler.fwd, err = reverseproxy.New(
reverseproxy.WithRoundTripper(config.RoundTripper),
reverseproxy.WithLogger(config.Log),
reverseproxy.WithErrorHandler(handler.formatForwardResponseError),
)
return handler, trace.Wrap(err)
}
// formatForwardResponseError converts an error to a status code and writes the code to a response.
func (s *signerHandler) formatForwardResponseError(rw http.ResponseWriter, r *http.Request, err error) {
s.Log.DebugContext(r.Context(), "Failed to process request", "error", err)
common.SetTeleportAPIErrorHeader(rw, err)
// Convert trace error type to HTTP and write response.
code := trace.ErrorToCode(err)
http.Error(rw, http.StatusText(code), code)
}
// ServeHTTP handles incoming requests by signing them and then forwarding them to the proper AWS API.
func (s *signerHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
req.Body = utils.MaxBytesReader(w, req.Body, s.MaxHTTPRequestBodySize)
if err := s.serveHTTP(w, req); err != nil {
s.formatForwardResponseError(w, req, err)
return
}
}
// serveHTTP is a helper to simplify error handling in ServeHTTP.
func (s *signerHandler) serveHTTP(w http.ResponseWriter, req *http.Request) error {
sessCtx, err := common.GetSessionContext(req)
if err != nil {
return trace.Wrap(err)
}
View on GitHub (pinned to 1283425b60)
Solutions
- Check the proxy logs for the underlying sign/forward error
- Verify the AWS app integration credentials and allowed regions/tags
- Address the root cause per the mapped status code and retry
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at lib/srv/app/aws/handler.go:123 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of gravitational/teleport@1283425b60 (2026-09-02).
Data as JSON: /api/errors/2b4f5abc2dea364c.
Report an issue: GitHub.