{"record":{"id":"f6ca4a07adf21ea7","repo":"windmill-labs/windmill","slug":"upload-s3-file-request-to-url-failed-with-status","errorCode":null,"errorMessage":"upload_s3_file request to {url} failed with status {status}: {body}","messagePattern":"upload_s3_file request to (.+?) failed with status (.+?): (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/windmill-common/src/client.rs","lineNumber":298,"sourceCode":"                reqwest::header::ACCEPT,\n                reqwest::header::HeaderValue::from_static(\"application/json\"),\n            )\n            .header(\n                reqwest::header::AUTHORIZATION,\n                reqwest::header::HeaderValue::from_str(&format!(\"Bearer {}\", self.token))\n                    .map_err(|e| anyhow::anyhow!(e.to_string()))?,\n            )\n            .body(Body::wrap_stream(body))\n            .send()\n            .await\n            .context(format!(\"Failed to send upload_s3_file request to {url}\"))?;\n\n        match response.status().as_u16() {\n            200u16 => Ok(()),\n            _ => {\n                let status = response.status();\n                let body = response.text().await.unwrap_or_default();\n                Err(anyhow::anyhow!(\n                    \"upload_s3_file request to {url} failed with status {status}: {body}\"\n                ))\n            }\n        }\n    }\n\n    pub async fn download_s3_file(\n        &self,\n        workspace_id: &str,\n        file_key: &str,\n        storage: Option<String>,\n    ) -> anyhow::Result<bytes::Bytes> {\n        let mut query = vec![(\"file_key\", file_key.to_string())];\n        if let Some(storage) = storage {\n            query.push((\"storage\", storage));\n        }\n        let response = self\n            .force_client","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-common/src/client.rs#L280-L316","documentation":"upload_s3_file uploads content through the workspace's S3 file API and raises this error for any non-200 response, including the target URL, status code, and response body. Unlike the empty-message errors nearby, this one is fully contextualized.","triggerScenarios":"Upload of a file to the S3 storage endpoint returns 4xx/5xx: storage not configured for the workspace (400/404), file too large or quota exceeded (413), invalid s3 path or bad request (400), auth failure (401/403), or upstream S3/MinIO errors surfaced as 5xx.","commonSituations":"Workspace large-file storage misconfigured or pointing at an unreachable MinIO/S3, missing parquet feature so the route is absent, uploading during a storage outage, wrong resource path used for the S3 bucket.","solutions":["Read the status and body in the message: 404 usually means the route/storage is missing, 413 means size limits, 5xx means upstream storage trouble","Verify workspace large-file/S3 storage configuration in instance settings","Confirm the backend was built with the parquet feature for S3 endpoints","Check the S3/MinIO backend is reachable and credentials valid","Retry transient 5xx with backoff"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-flight: confirm storage configured (workspace large-file/S3 settings) before upload.\nif file_len > MAX_UPLOAD { anyhow::bail!(\"file too large for s3 upload: {file_len}\"); }","typeGuard":null,"tryCatchPattern":"match client.upload_s3_file(...).await {\n    Err(e) if e.to_string().contains(\"status 413\") => anyhow::bail!(\"file exceeds storage size limit\"),\n    Err(e) if e.to_string().contains(\"status 5\") => { tokio::time::sleep(Duration::from_secs(2)).await; client.upload_s3_file(...).await }\n    other => other,\n}","preventionTips":["Configure and health-check workspace large-file/S3 storage before enabling upload features","Build the backend with the parquet feature wherever S3 endpoints are used","Enforce client-side size limits to avoid 413s","Retry only 5xx; treat 4xx as config/permission fixes"],"tags":["http","s3","upload","storage"],"backgroundTag":"s3-upload-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"}