windmill-labs/windmill · error · Exception

Could not generate DuckDB S3 connection settings from the pr

Error message

Could not generate DuckDB S3 connection settings from the provided resource

What it means

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.

Source

Thrown at python-client/wmill/wmill/client.py:867

    def get_duckdb_connection_settings(
        self,
        s3_resource_path: str = "",
    ) -> DuckDbConnectionSettings | None:
        """
        Convenient helpers that takes an S3 resource as input and returns the settings necessary to
        initiate an S3 connection from DuckDB
        """
        s3_resource_path = parse_resource_syntax(s3_resource_path) or s3_resource_path
        try:
            raw_obj = self.post(
                f"/w/{self.workspace}/job_helpers/v2/duckdb_connection_settings",
                json={}
                if s3_resource_path == ""
                else {"s3_resource_path": s3_resource_path},
            ).json()
            return DuckDbConnectionSettings(raw_obj)
        except JSONDecodeError as e:
            raise Exception(
                "Could not generate DuckDB S3 connection settings from the provided resource"
            ) from e

    def get_polars_connection_settings(
        self,
        s3_resource_path: str = "",
    ) -> PolarsConnectionSettings:
        """
        Convenient helpers that takes an S3 resource as input and returns the settings necessary to
        initiate an S3 connection from Polars
        """
        s3_resource_path = parse_resource_syntax(s3_resource_path) or s3_resource_path
        try:
            raw_obj = self.post(
                f"/w/{self.workspace}/job_helpers/v2/polars_connection_settings",
                json={}
                if s3_resource_path == ""
                else {"s3_resource_path": s3_resource_path},

View on GitHub (pinned to e474e8803c)

Solutions

  1. Verify the s3_resource_path exists and is of type s3 in the target workspace (Resources page).
  2. Check the server response/log for the underlying non-JSON error (401/404/500 body).
  3. Pass '' (default) to use the workspace's default S3 resource if one is configured.
  4. Confirm the Windmill instance has the S3 resource and credentials set up correctly.

Example fix

// before
settings = client.get_duckdb_connection_settings(s3_resource_path='s3_resource/mybucket')
// after
resources = client.get('/w/{client.workspace}/resources/list').json()  # confirm path & type first
settings = client.get_duckdb_connection_settings(s3_resource_path='u/admin/s3_prod')
Defensive patterns

Strategy: validation

Validate before calling

def s3_resource_exists(client, path):
    if not path:
        return True  # empty means default resource
    resources = client.get(f'/w/{client.workspace}/resources/list').json()
    return any(r['path'] == path and r['resource_type'] == 's3' for r in resources)

Try / catch

try:
    settings = client.get_duckdb_connection_settings(s3_resource_path=path)
except Exception as e:
    if 'DuckDB S3 connection settings' in str(e):
        raise RuntimeError(f'S3 resource {path!r} invalid or missing; check workspace resources') from e
    raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/23dba796ccdadf06. Report an issue: GitHub.