{"record":{"id":"23dba796ccdadf06","repo":"windmill-labs/windmill","slug":"could-not-generate-duckdb-s3-connection-settings-f","errorCode":null,"errorMessage":"Could not generate DuckDB S3 connection settings from the provided resource","messagePattern":"Could not generate DuckDB S3 connection settings from the provided resource","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"python-client/wmill/wmill/client.py","lineNumber":867,"sourceCode":"    def get_duckdb_connection_settings(\n        self,\n        s3_resource_path: str = \"\",\n    ) -> DuckDbConnectionSettings | None:\n        \"\"\"\n        Convenient helpers that takes an S3 resource as input and returns the settings necessary to\n        initiate an S3 connection from DuckDB\n        \"\"\"\n        s3_resource_path = parse_resource_syntax(s3_resource_path) or s3_resource_path\n        try:\n            raw_obj = self.post(\n                f\"/w/{self.workspace}/job_helpers/v2/duckdb_connection_settings\",\n                json={}\n                if s3_resource_path == \"\"\n                else {\"s3_resource_path\": s3_resource_path},\n            ).json()\n            return DuckDbConnectionSettings(raw_obj)\n        except JSONDecodeError as e:\n            raise Exception(\n                \"Could not generate DuckDB S3 connection settings from the provided resource\"\n            ) from e\n\n    def get_polars_connection_settings(\n        self,\n        s3_resource_path: str = \"\",\n    ) -> PolarsConnectionSettings:\n        \"\"\"\n        Convenient helpers that takes an S3 resource as input and returns the settings necessary to\n        initiate an S3 connection from Polars\n        \"\"\"\n        s3_resource_path = parse_resource_syntax(s3_resource_path) or s3_resource_path\n        try:\n            raw_obj = self.post(\n                f\"/w/{self.workspace}/job_helpers/v2/polars_connection_settings\",\n                json={}\n                if s3_resource_path == \"\"\n                else {\"s3_resource_path\": s3_resource_path},","sourceCodeStart":849,"sourceCodeEnd":885,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/python-client/wmill/wmill/client.py#L849-L885","documentation":"get_duckdb_connection_settings() calls the server endpoint that converts an S3 resource into DuckDB connection settings and parses the response as JSON. If the response body is not valid JSON (JSONDecodeError) — typically because the S3 resource is missing, malformed, or the endpoint errored with a non-JSON body — it raises this wrapped Exception.","triggerScenarios":"get_duckdb_connection_settings(s3_resource_path='...') where the resource path doesn't exist, the resource isn't of type s3, the workspace lacks an S3 resource configured, or the server returned an HTML/plain-text error page.","commonSituations":"Typo in the s3_resource_path; resource created in a different workspace; resource type changed from s3; running outside a worker so relative resource resolution or credentials are unavailable.","solutions":["Verify the s3_resource_path exists and is of type s3 in the target workspace (Resources page).","Check the server response/log for the underlying non-JSON error (401/404/500 body).","Pass '' (default) to use the workspace's default S3 resource if one is configured.","Confirm the Windmill instance has the S3 resource and credentials set up correctly."],"exampleFix":"// before\nsettings = client.get_duckdb_connection_settings(s3_resource_path='s3_resource/mybucket')\n// after\nresources = client.get('/w/{client.workspace}/resources/list').json()  # confirm path & type first\nsettings = client.get_duckdb_connection_settings(s3_resource_path='u/admin/s3_prod')","handlingStrategy":"validation","validationCode":"def s3_resource_exists(client, path):\n    if not path:\n        return True  # empty means default resource\n    resources = client.get(f'/w/{client.workspace}/resources/list').json()\n    return any(r['path'] == path and r['resource_type'] == 's3' for r in resources)","typeGuard":null,"tryCatchPattern":"try:\n    settings = client.get_duckdb_connection_settings(s3_resource_path=path)\nexcept Exception as e:\n    if 'DuckDB S3 connection settings' in str(e):\n        raise RuntimeError(f'S3 resource {path!r} invalid or missing; check workspace resources') from e\n    raise","preventionTips":["Verify resource path and type=s3 in the workspace before calling.","Keep S3 resource paths centralized in config to avoid typos.","Prefer the workspace default resource (s3_resource_path='') when only one S3 resource exists.","Confirm server/worker has the S3 integration configured."],"tags":["duckdb","s3","resources","python"],"backgroundTag":"invalid-resource-configuration","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"}