{"record":{"id":"59d3ad7a571c5191","repo":"apache/beam","slug":"dicomsearch-failed-with-status-s","errorCode":null,"errorMessage":"DicomSearch failed with status: %s","messagePattern":"DicomSearch failed with status: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/yaml/yaml_io.py","lineNumber":924,"sourceCode":"      empty_match_treatment=empty_match_treatment)\n\n  return matched | beam.Map(\n      lambda x: beam.Row(\n          path=str(x.path), size_in_bytes=int(x.size_in_bytes),\n          last_updated_in_seconds=float(x.last_updated_in_seconds)\n          if x.last_updated_in_seconds is not None else None))\n\n\n_DICOM_SEARCH_OUTPUT_SCHEMA = RowTypeConstraint.from_fields([\n    ('result', str),\n    ('status', str),\n    ('input', str),\n])\n\n\ndef _dicom_search_result_to_row(result):\n  if not result.get('success'):\n    raise RuntimeError(\n        'DicomSearch failed with status: %s' % (result.get('status'), ))\n  return beam.Row(\n      result=json.dumps(result.get('result', [])),\n      status=str(result.get('status')),\n      input=json.dumps(result.get('input', {})))\n\n\ndef _dicom_search_to_output_row(result):\n  return beam.Row(\n      result=json.dumps(result.get('result', [])),\n      status=str(result.get('status')),\n      input=json.dumps(result.get('input', {})))\n\n\ndef _dicom_search_to_error_row(result):\n  inp = result.get('input') or {}\n  if isinstance(inp, Mapping):\n    element = beam.Row(**dict(inp))","sourceCodeStart":906,"sourceCodeEnd":942,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/yaml/yaml_io.py#L906-L942","documentation":"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.","triggerScenarios":"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.","commonSituations":"Wrong DICOM store URL or dataset location; insufficient IAM permissions on the Healthcare API; malformed study/series query filters; transient API outages.","solutions":["Inspect the logged status value and fix the underlying DICOM request (URL, query parameters, auth).","Verify the caller's service account has healthcare.dicomStores.searchForInstances permission.","Route failures to the error output and retry transient statuses with backoff."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    rows = dicom_search(pcoll, ...)\nexcept RuntimeError as e:\n    logging.error('DICOM search failed: %s', e)\n    # route to error output / DLQ and retry with backoff for transient status","preventionTips":["Verify the DICOM store URL and project/dataset/location up front","Grant the pipeline service account healthcare.dicomStores.searchForInstances","Use the error-output branch to capture and inspect failed searches"],"tags":["apache-beam","yaml","gcp","healthcare","dicom"],"backgroundTag":"api-error-response","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}