{"record":{"id":"226cc95a16ee463e","repo":"gravitational/teleport","slug":"http-statustext-code-226cc9","errorCode":null,"errorMessage":"http.StatusText(code)","messagePattern":"http\\.StatusText\\(code\\)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/srv/app/azure/handler.go","lineNumber":164,"sourceCode":"\t}\n\trecorder := httplib.NewResponseStatusRecorder(w)\n\ts.fwd.ServeHTTP(recorder, fwdRequest)\n\tstatus := uint32(recorder.Status())\n\n\tif err := sessionCtx.Audit.OnRequest(req.Context(), sessionCtx, fwdRequest, status, nil); err != nil {\n\t\t// log but don't return the error, because we already handed off request/response handling to the oxy forwarder.\n\t\ts.Log.WarnContext(req.Context(), \"Failed to emit audit event.\", \"error\", err)\n\t}\n\treturn nil\n}\n\nfunc (s *handler) formatForwardResponseError(rw http.ResponseWriter, r *http.Request, err error) {\n\ts.Log.DebugContext(r.Context(), \"Failed to process request.\", \"error\", err)\n\tcommon.SetTeleportAPIErrorHeader(rw, err)\n\n\t// Convert trace error type to HTTP and write response.\n\tcode := trace.ErrorToCode(err)\n\thttp.Error(rw, http.StatusText(code), code)\n}\n\n// prepareForwardRequest prepares a request for forwarding, updating headers and target host. Several checks are made along the way.\n//\n// Do not read the request body but pass the reader as is, so that it streams.\n// In Azure there is a threshold (aka max_single_put_size) which changes how the\n// upload is performed. If the blob size is smaller than the threshold, the blob\n// is uploaded in a single request. If however it's bigger than the threshold,\n// it's uploaded in chunks.\n//\n// More details on the subject:\n// https://learn.microsoft.com/en-us/azure/storage/blobs/scalability-targets\nfunc (s *handler) prepareForwardRequest(r *http.Request, sessionCtx *common.SessionContext) (*http.Request, error) {\n\tforwardedHost, err := utils.GetSingleHeader(r.Header, \"X-Forwarded-Host\")\n\tif err != nil {\n\t\treturn nil, trace.AccessDenied(\"%s\", err)\n\t} else if !azure.IsAzureEndpoint(forwardedHost) {\n\t\treturn nil, trace.AccessDenied(\"%q is not an Azure endpoint\", forwardedHost)","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/gravitational/teleport/blob/1283425b60ec5f60d509ba4c791183d452923ff7/lib/srv/app/azure/handler.go#L146-L182","documentation":"The Azure app handler's formatForwardResponseError writes the standard status text for the trace-mapped HTTP code as the response body when forwarding a request to the Azure API fails; the literal is the reason phrase for the mapped code.","triggerScenarios":"Thrown at lib/srv/app/azure/handler.go:164 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the proxy logs for the underlying forward error","Verify the Azure app integration credentials and subscriptions","Address the root cause per the mapped status code and retry"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1283425b60ec5f60d509ba4c791183d452923ff7","analyzedAt":"2026-09-02T04:06:41.601Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}