{"record":{"id":"03be7a4aef1c2f20","repo":"apache/beam","slug":"missing-output-in-error-handling-of-identify-object-t","errorCode":null,"errorMessage":"Missing output in error_handling of {identify_object(t)}","messagePattern":"Missing output in error_handling of (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/yaml/yaml_transform.py","lineNumber":1270,"sourceCode":"\ndef ensure_transforms_have_types(spec):\n  if 'type' not in spec:\n    raise ValueError(f'Missing type specification in {identify_object(spec)}')\n  return spec\n\n\ndef ensure_errors_consumed(spec):\n  if spec['type'] == 'composite':\n    scope = LightweightScope(spec['transforms'])\n    to_handle = {}\n    consumed = set(\n        scope.get_transform_id_and_output_name(output)\n        for output in spec['output'].values())\n    for t in spec['transforms']:\n      config = t.get('config', t)\n      if 'error_handling' in config:\n        if 'output' not in config['error_handling']:\n          raise ValueError(\n              f'Missing output in error_handling of {identify_object(t)}')\n        to_handle[t['__uuid__'], config['error_handling']['output']] = t\n      for _, input in empty_if_explicitly_empty(t['input']).items():\n        if input not in spec['input']:\n          consumed.add(scope.get_transform_id_and_output_name(input))\n    for error_pcoll, t in to_handle.items():\n      if error_pcoll not in consumed:\n        config = t.get('config', t)\n        transform_name = t.get('name', t.get('type'))\n        error_output_name = config['error_handling']['output']\n        raise ValueError(\n            f'Unconsumed error output for {identify_object(t)}. '\n            f'The output named {transform_name}.{error_output_name} '\n            'must be used as an input to some other transform. '\n            'See https://beam.apache.org/documentation/sdks/yaml-errors')\n  return spec\n\n","sourceCodeStart":1252,"sourceCodeEnd":1288,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/yaml/yaml_transform.py#L1252-L1288","documentation":"Transforms with error_handling must declare which output name receives the error records (config.error_handling.output). ensure_errors_consumed validates this during preprocessing; an error_handling block without an 'output' key leaves the error records unroutable, so the pipeline is rejected.","triggerScenarios":"ensure_errors_consumed iterating spec['transforms'] and finding a transform t where config contains 'error_handling' but config['error_handling'] has no 'output' key — e.g. error_handling: {} or only error_handling: {input: ...}.","commonSituations":"Omitting the output name when enabling error capture; copying an error_handling snippet from docs that assumed a default; building specs programmatically and not setting the key.","solutions":["Add output: <name> inside error_handling, naming the error output of that transform.","Consume that named output as the input of another transform (e.g. WriteToJson or a log sink) to also satisfy the unconsumed-error check.","Remove error_handling entirely if error capture is not intended."],"exampleFix":"# before\nconfig:\n  error_handling: {}\n# after\nconfig:\n  error_handling:\n    output: errors","handlingStrategy":"validation","validationCode":"for t in spec.get('transforms', []):\n    cfg = t.get('config', t)\n    if 'error_handling' in cfg and 'output' not in cfg['error_handling']:\n        raise ValueError(f\"{t.get('name')} error_handling needs an 'output'\")","typeGuard":"def has_error_output(t):\n    eh = t.get('config', t).get('error_handling')\n    return eh is None or isinstance(eh.get('output'), str)","tryCatchPattern":"try:\n    spec = ensure_errors_consumed(spec)\nexcept ValueError as e:\n    if 'Missing output in error_handling' in str(e):\n        raise SystemExit(f'Fix your YAML: {e}')\n    raise","preventionTips":["Always pair error_handling with an output name","Scaffold error handling from official examples","Validate specs with the Beam YAML schema before expansion"],"tags":["python","apache-beam","yaml","error-handling","validation"],"backgroundTag":"missing-required-config-field","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}