{"record":{"id":"0e2a9141a683d69d","repo":"SigNoz/signoz","slug":"couldn-t-read-response-w","errorCode":null,"errorMessage":"couldn't read response: %w","messagePattern":"couldn't read response: %w","errorType":"http","errorClass":"basemodel.ApiError","httpStatus":500,"severity":"error","filePath":"ee/query-service/app/api/cloudIntegrations.go","lineNumber":346,"sourceCode":"\n\tfor k, v := range headers {\n\t\treq.Header.Set(k, v)\n\t}\n\n\tclient := &http.Client{\n\t\tTimeout: 10 * time.Second,\n\t}\n\n\tresponse, err := client.Do(req)\n\tif err != nil {\n\t\treturn nil, basemodel.InternalError(fmt.Errorf(\"couldn't make request: %w\", err))\n\t}\n\n\tdefer response.Body.Close()\n\n\trespBody, err := io.ReadAll(response.Body)\n\tif err != nil {\n\t\treturn nil, basemodel.InternalError(fmt.Errorf(\"couldn't read response: %w\", err))\n\t}\n\n\tvar resp ResponseType\n\n\terr = json.Unmarshal(respBody, &resp)\n\tif err != nil {\n\t\treturn nil, basemodel.InternalError(fmt.Errorf(\n\t\t\t\"couldn't unmarshal gateway response into %T\", resp,\n\t\t))\n\t}\n\n\treturn &resp, nil\n}\n","sourceCodeStart":328,"sourceCodeEnd":360,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/ee/query-service/app/api/cloudIntegrations.go#L328-L360","documentation":"io.ReadAll on the gateway response body failed after a successful HTTP round trip. Typically a connection reset mid-body or a context cancellation while streaming the response.","triggerScenarios":"The gateway closes the connection before sending the full body, the request context is cancelled during read, or a network device truncates the response.","commonSituations":"Flaky networks, load balancers with short idle timeouts, client disconnects, or very large responses interrupted mid-transfer.","solutions":["Check whether the request context was cancelled upstream","Retry — mid-body resets are usually transient","If persistent, inspect network path (LB idle timeouts, MTU) to the gateway"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"Retry mid-body read failures once; propagate context cancellation errors without retry.","preventionTips":["Avoid cancelling contexts mid-download unnecessarily","Watch LB idle timeouts on long responses"],"tags":["network","io","http-client","gateway"],"backgroundTag":"network-io-error","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}