apache/beam · error · RuntimeError

Artifact locations are currently supported for only…

Error message

Artifact locations are currently supported for only available for local paths and GCS paths. Got: %s

What it means

MLTransform artifact locations only support local filesystem paths and GCS paths (gs://). _is_remote_path inspects the path for '://' and raises RuntimeError when any other URL scheme (s3://, http://, etc.) is detected, because the artifact-saving code only handles local and GCS paths (tracked by Beam issue 29356).

Solutions

  1. Use a GCS path (gs://bucket/path) or a local directory path for artifact_location.
  2. Download/upload artifacts to your other remote store yourself before/after the pipeline runs.
  3. If you need another remote filesystem, extend the code per Beam issue 29356 or contribute support upstream.

Example fix

// before
MLTransform(artifact_location='s3://my-bucket/artifacts')
// after
MLTransform(artifact_location='gs://my-bucket/artifacts')
Defensive patterns

Strategy: validation

Validate before calling

def validate_artifact_location(path):
    scheme = path.split('://')[0] if '://' in path else None
    if scheme and scheme not in ('gs',):
        raise ValueError(f'Unsupported artifact scheme: {scheme}:// (only local or gs://)')

Type guard

def is_supported_artifact_path(path: str) -> bool:
    return '://' not in path or path.startswith('gs://')

Try / catch

try:
    run_mltransform(artifact_location=path)
except RuntimeError as e:
    if 'Artifact locations' in str(e):
        path = to_gcs_or_local(path)

Prevention

When it happens

Trigger: Passing artifact_location like 's3://bucket/prefix', 'hdfs://...', 'az://...' or any non-GCS '://' URL to MLTransform(artifact_location=...) or the attribute manager save path.

Common situations: Reusing an S3 path from another pipeline's checkpoint config; assuming all Beam-supported filesystems work for MLTransform artifacts; copy-pasting blob storage URLs from AWS/Azure setups.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/11583676b7527ea0. Report an issue: GitHub.

Appendix: source

Thrown at sdks/python/apache_beam/ml/transforms/base.py:537

    """
    raise NotImplementedError


class _JsonPickleTransformAttributeManager(_TransformAttributeManager):
  """
  Use Jsonpickle to save and load the attributes. Here the attributes refer
  to the list of PTransforms that are used to process the data.

  jsonpickle is used to serialize the PTransforms and save it to a json file and
  is compatible across python versions.
  """
  @staticmethod
  def _is_remote_path(path):
    is_gcs = path.find('gs://') != -1
    # TODO:https://github.com/apache/beam/issues/29356
    #  Add support for other remote paths.
    if not is_gcs and path.find('://') != -1:
      raise RuntimeError(
          "Artifact locations are currently supported for only available for "
          "local paths and GCS paths. Got: %s" % path)
    return is_gcs

  @staticmethod
  def save_attributes(
      ptransform_list,
      artifact_location,
      **kwargs,
  ):
    # if an artifact location is present, instead of overwriting the
    # existing file, raise an error since the same artifact location
    # can be used by multiple beam jobs and this could result in undesired
    # behavior.
    if FileSystems.exists(FileSystems.join(artifact_location,
                                           _ATTRIBUTE_FILE_NAME)):
      raise FileExistsError(
          "The artifact location %s already exists and contains %s. Please "

View on GitHub (pinned to 12126d8942)