apache/beam · error · RuntimeError

DicomSearch failed with status: %s

Error message

DicomSearch failed with status: %s

What it means

Raised by _dicom_search_result_to_row in apache_beam/yaml/yaml_io.py when a DICOM store search result row reports success=False. The status field of the result (e.g. an HTTP/gRPC error code from the Healthcare DICOM API) is included in the message.

Source

Thrown at sdks/python/apache_beam/yaml/yaml_io.py:924

      empty_match_treatment=empty_match_treatment)

  return matched | beam.Map(
      lambda x: beam.Row(
          path=str(x.path), size_in_bytes=int(x.size_in_bytes),
          last_updated_in_seconds=float(x.last_updated_in_seconds)
          if x.last_updated_in_seconds is not None else None))


_DICOM_SEARCH_OUTPUT_SCHEMA = RowTypeConstraint.from_fields([
    ('result', str),
    ('status', str),
    ('input', str),
])


def _dicom_search_result_to_row(result):
  if not result.get('success'):
    raise RuntimeError(
        'DicomSearch failed with status: %s' % (result.get('status'), ))
  return beam.Row(
      result=json.dumps(result.get('result', [])),
      status=str(result.get('status')),
      input=json.dumps(result.get('input', {})))


def _dicom_search_to_output_row(result):
  return beam.Row(
      result=json.dumps(result.get('result', [])),
      status=str(result.get('status')),
      input=json.dumps(result.get('input', {})))


def _dicom_search_to_error_row(result):
  inp = result.get('input') or {}
  if isinstance(inp, Mapping):
    element = beam.Row(**dict(inp))

View on GitHub (pinned to 12126d8942)

Solutions

  1. Inspect the logged status value and fix the underlying DICOM request (URL, query parameters, auth).
  2. Verify the caller's service account has healthcare.dicomStores.searchForInstances permission.
  3. Route failures to the error output and retry transient statuses with backoff.
Defensive patterns

Strategy: try-catch

Try / catch

try:
    rows = dicom_search(pcoll, ...)
except RuntimeError as e:
    logging.error('DICOM search failed: %s', e)
    # route to error output / DLQ and retry with backoff for transient status

Prevention

When it happens

Trigger: The DicomSearch external transform emits a dict with success falsy (a failed search against the Google Healthcare DICOM store) and the error-output branch converts it to a row.

Common situations: Wrong DICOM store URL or dataset location; insufficient IAM permissions on the Healthcare API; malformed study/series query filters; transient API outages.

Related errors


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