{"record":{"id":"2dddb919c615778e","repo":"apache/beam","slug":"blocking-computation-failed-state-s","errorCode":null,"errorMessage":"Blocking computation failed. State: %s","messagePattern":"Blocking computation failed\\. State: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/runners/interactive/recording_manager.py","lineNumber":690,"sourceCode":"\n    self._watch(list(pcolls_to_compute))\n    self.record_pipeline()\n\n    if blocking:\n      self._env.mark_pcollection_computing(pcolls_to_compute)\n      try:\n        if wait_for_inputs:\n          if not self._wait_for_dependencies(pcolls_to_compute):\n            raise RuntimeError(\n                'Dependency computation failed or was cancelled.')\n        pipeline_result = self._execute_pipeline_fragment(\n            pcolls_to_compute, None, runner, options)\n        if pipeline_result.state == PipelineState.DONE:\n          self._env.mark_pcollection_computed(pcolls_to_compute)\n        else:\n          _LOGGER.error(\n              'Blocking computation failed. State: %s', pipeline_result.state)\n          raise RuntimeError(\n              'Blocking computation failed. State: %s', pipeline_result.state)\n      finally:\n        self._env.unmark_pcollection_computing(pcolls_to_compute)\n      return None\n\n    else:  # Asynchronous\n      future = Future()\n      async_result = AsyncComputationResult(\n          future, pcolls_to_compute, self.user_pipeline, self)\n      with self._lock:\n        self._async_computations[async_result._display_id] = async_result\n      self._env.mark_pcollection_computing(pcolls_to_compute)\n\n      def task():\n        try:\n          result = self._run_async_computation(\n              pcolls_to_compute, async_result, wait_for_inputs, runner, options)\n          future.set_result(result)","sourceCodeStart":672,"sourceCodeEnd":708,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/runners/interactive/recording_manager.py#L672-L708","documentation":"In blocking compute_async, after executing the pipeline fragment, if the PipelineResult state is not DONE the manager logs the state and raises RuntimeError('Blocking computation failed. State: %s', ...), reporting the runner's terminal state (e.g. FAILED, CANCELLED).","triggerScenarios":"A Beam pipeline executed by compute_async ends in a non-DONE state: runner errors (bad pipeline code, quota/permission failures on Dataflow, OOM), or the job is cancelled mid-run.","commonSituations":"Notebook cell executes a pipeline that crashes at runtime; Dataflow job fails due to permissions/quota; local DirectRunner worker raises an unhandled exception.","solutions":["Read the full pipeline logs to find the root cause of the non-DONE state","Retry the computation after fixing the pipeline logic or input data","Verify runner configuration (project, region, credentials) when using Dataflow","Check that the pipeline is not being cancelled by an external timeout or by ib.cancel"],"exampleFix":"// before\nresult = compute_async([pcoll], blocking=True)  # state=FAILED, no diagnostics\n// after\ntry:\n    compute_async([pcoll], blocking=True)\nexcept RuntimeError as e:\n    print(pipeline_result.state)  # inspect FAILED/CANCELLED state and runner logs","handlingStrategy":"try-catch","validationCode":"# validate runner config before executing\noptions.view_as(GoogleCloudOptions).project and options.view_as(GoogleCloudOptions).region  # for Dataflow","typeGuard":null,"tryCatchPattern":"try:\n    compute_async([pcoll], blocking=True)\nexcept RuntimeError as e:\n    print('pipeline terminal state:', e)  # then inspect runner logs\n    retry_after_fix()","preventionTips":["Test the pipeline with DirectRunner before running on Dataflow","Verify project/region/credentials and quotas for remote runners","Watch pipeline logs during blocking computes to catch failures early","Handle terminal states FAILED/CANCELLED explicitly in notebook code"],"tags":["pipeline","runner","interactive-beam"],"backgroundTag":"pipeline-execution-failed","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"}