windmill-labs/windmill · error · Exception

Could not generate Polars S3 connection settings from the pr

Error message

Could not generate Polars S3 connection settings from the provided resource

What it means

get_polars_connection_settings() converts an S3 resource into Polars storage settings via a server endpoint; a non-JSON response (JSONDecodeError) is re-raised with this message. It means the server could not produce valid settings for the given S3 resource.

Source

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

    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},
            ).json()
            return PolarsConnectionSettings(raw_obj)
        except JSONDecodeError as e:
            raise Exception(
                "Could not generate Polars S3 connection settings from the provided resource"
            ) from e

    def get_boto3_connection_settings(
        self,
        s3_resource_path: str = "",
    ) -> Boto3ConnectionSettings:
        """
        Convenient helpers that takes an S3 resource as input and returns the settings necessary to
        initiate an S3 connection using boto3
        """
        s3_resource_path = parse_resource_syntax(s3_resource_path) or s3_resource_path
        try:
            s3_resource = self.post(
                f"/w/{self.workspace}/job_helpers/v2/s3_resource_info",
                json={}
                if s3_resource_path == ""
                else {"s3_resource_path": s3_resource_path},

View on GitHub (pinned to e474e8803c)

Solutions

  1. Confirm the resource path and its s3 type in the workspace Resources page.
  2. Inspect the server response/log for the underlying error body.
  3. Try the default resource by passing s3_resource_path=''.
  4. Fix the S3 resource's credentials/configuration in the workspace.

Example fix

// before
settings = client.get_polars_connection_settings(s3_resource_path='s3_res/typo_name')
// after
settings = client.get_polars_connection_settings(s3_resource_path='u/admin/s3_prod')  # verified path
Defensive patterns

Strategy: validation

Validate before calling

def s3_resource_exists(client, path):
    if not path:
        return True
    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_polars_connection_settings(s3_resource_path=path)
except Exception as e:
    if 'Polars 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_polars_connection_settings(s3_resource_path='...') with a nonexistent/mistyped resource path, a non-S3 resource, missing workspace S3 configuration, or a server error returning a non-JSON error body.

Common situations: Wrong workspace context; resource path typo; S3 resource credentials invalid so the settings endpoint fails; calling from a context where the resource isn't accessible.

Related errors


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