{"record":{"id":"74b5cac9fa4095cc","repo":"windmill-labs/windmill","slug":"could-not-delete-file-from-s3","errorCode":null,"errorMessage":"Could not delete file from S3","messagePattern":"Could not delete file from S3","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"python-client/wmill/wmill/client.py","lineNumber":1054,"sourceCode":"        \"\"\"\n        s3object = parse_s3_object(s3object)\n        query_params: Dict[str, Any] = {\"file_key\": s3object[\"s3\"]}\n        if s3_resource_path is not None and s3_resource_path != \"\":\n            query_params[\"s3_resource_path\"] = s3_resource_path\n        if \"storage\" in s3object and s3object[\"storage\"] is not None:\n            query_params[\"storage\"] = s3object[\"storage\"]\n        try:\n            resp = self.client.delete(\n                f\"/w/{self.workspace}/job_helpers/delete_s3_file\",\n                params=query_params,\n            )\n            resp.raise_for_status()\n        except httpx.HTTPStatusError as err:\n            error = f\"{err.request.url}: {err.response.status_code}, {err.response.text}\"\n            logger.error(error)\n            raise Exception(error)\n        except Exception as e:\n            raise Exception(\"Could not delete file from S3\") from e\n\n    def sign_s3_objects(\n        self, s3_objects: list[S3Object | str], expiry_secs: int | None = None\n    ) -> list[S3Object]:\n        \"\"\"Sign S3 objects for use by anonymous users in public apps.\n\n        Args:\n            s3_objects: List of S3 objects to sign\n            expiry_secs: How long the signature stays valid, in seconds\n                (defaults to 43200 = 12h, clamped to [60, 604800])\n\n        Returns:\n            List of signed S3 objects\n        \"\"\"\n        return self.post(\n            f\"/w/{self.workspace}/apps/sign_s3_objects\",\n            json=_sign_s3_objects_body(list(map(parse_s3_object, s3_objects)), expiry_secs),\n        ).json()","sourceCodeStart":1036,"sourceCodeEnd":1072,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/python-client/wmill/wmill/client.py#L1036-L1072","documentation":"Generic fallback in delete_s3_object: the deletion failed with an exception that is not an httpx.HTTPStatusError — typically a connection error, timeout, or other client-side/transport failure. Unlike the status-error path, no URL or status detail is included.","triggerScenarios":"Network outage or DNS failure reaching the backend, request timeout, SSL/TLS errors, or httpx client construction failures during delete_s3_object.","commonSituations":"Self-hosted backend temporarily down, VPN/proxy blocking the connection, transient network blips in scheduled jobs.","solutions":["Log and inspect the chained exception (e.__cause__) for the transport-level cause","Add retry with exponential backoff for transient errors","Verify backend URL and network reachability","Check TLS/proxy configuration on self-hosted instances"],"exampleFix":"// before\nwm.delete_s3_object(s3obj)\n// after\nimport time\nfor attempt in range(3):\n    try:\n        wm.delete_s3_object(s3obj)\n        break\n    except Exception as e:\n        if \"Could not delete\" in str(e) and attempt < 2:\n            time.sleep(2 ** attempt)\n        else:\n            raise","handlingStrategy":"retry","validationCode":"import httpx\ntry:\n    httpx.get(f\"{wm.get_client().base_url}/api/version\", timeout=5)\nexcept httpx.HTTPError:\n    raise RuntimeError(\"Windmill backend unreachable\")","typeGuard":null,"tryCatchPattern":"import time\nfor attempt in range(3):\n    try:\n        wm.delete_s3_object(s3obj)\n        break\n    except Exception as e:\n        if attempt == 2 or \"Could not delete\" not in str(e):\n            raise\n        time.sleep(2 ** attempt)","preventionTips":["Retry with exponential backoff for transport-level failures","Check backend health before bulk S3 operations","Set explicit timeouts rather than relying on client defaults","Verify proxy/VPN/TLS setup on self-hosted instances"],"tags":["network","s3","timeout","retry"],"backgroundTag":"network-request-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"}