{"record":{"id":"c62b57c5050854c7","repo":"windmill-labs/windmill","slug":"e-slack-chat-update-response-body-read-error-prop","errorCode":null,"errorMessage":"e (Slack chat.update response body read error propagated via anyhow)","messagePattern":"e \\(Slack chat\\.update response body read error propagated via anyhow\\)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"backend/windmill-api/src/slack_approvals.rs","lineNumber":1239,"sourceCode":"    let response = client\n        .post(\"https://slack.com/api/chat.update\")\n        .bearer_auth(token) // Use the token for authentication\n        .header(\"Content-Type\", \"application/json\")\n        .json(&payload)\n        .send()\n        .await\n        .map_err(|e| Error::from(anyhow::Error::new(e)))?;\n\n    if response.status().is_success() {\n        tracing::debug!(\"Slack message updated successfully!\");\n    } else {\n        tracing::error!(\n            \"Failed to update Slack message. Status: {}, Response: {:?}\",\n            response.status(),\n            response\n                .text()\n                .await\n                .map_err(|e| Error::from(anyhow::Error::new(e)))?\n        );\n    }\n\n    Ok(())\n}\n","sourceCodeStart":1221,"sourceCodeEnd":1245,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-api/src/slack_approvals.rs#L1221-L1245","documentation":"When Windmill updates the original Slack approval message after a form submission, it reads the Slack HTTP response body to log it. If reading that body fails (connection dropped, TLS error, timeout mid-read), the anyhow-wrapped io error is propagated with `?` and surfaces as 'e (Slack chat.update response body read error propagated via anyhow)'. The Slack update itself may have succeeded; only reading the response text failed.","triggerScenarios":"Slack's chat.update API returned a response, but `response.text().await` fails while draining the body — network interruption, Slack closing the connection early, or proxy/TLS termination mid-response — inside update_original_slack_message when the update returned a non-success status and the code logs the body.","commonSituations":"Flaky corporate networks or egress proxies between Windmill and slack.com; Slack API 5xx responses with truncated bodies; container/network timeouts; transient DNS or connection resets in self-hosted clusters with unstable outbound connectivity.","solutions":["Retry the submission update or the Slack chat.update call; body-read failures are usually transient network issues.","Verify outbound HTTPS connectivity and proxy configuration from the worker to slack.com (no idle-connection killing middleboxes).","Check worker logs for the preceding status code — if Slack returned an error (e.g. 404 channel_not_found), fix the underlying Slack issue (channel ID, token scopes) so the success path is taken.","If persistent, pin/update reqwest/TLS versions and ensure the container has CA certificates installed."],"exampleFix":"// before\nlet body = response.text().await.map_err(|e| Error::from(anyhow::Error::new(e)))?;\n// after\nlet body = response.text().await.unwrap_or_else(|e| {\n    tracing::warn!(\"failed to read Slack response body: {e}\");\n    String::new()\n});","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// transient network issue — surface but don't fail the whole approval flow\nmatch response.text().await {\n    Ok(body) => tracing::error!(\"Slack update failed. Status: {}, Body: {body}\", response.status()),\n    Err(e) => tracing::error!(\"Slack update failed. Status: {}, body unreadable: {e}\", response.status()),\n}","preventionTips":["Ensure stable outbound HTTPS connectivity from workers to slack.com","Check proxy/egress middleboxes that kill keep-alive connections","Install up-to-date CA certificates in the worker image","Log the HTTP status independently of body reading so root cause is visible"],"tags":["slack","network","http-body-read","anyhow"],"backgroundTag":"http-response-body-read-failed","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}