apache/beam · error · RuntimeError

Blocking computation failed. State

Error message

Blocking computation failed. State: %s

What it means

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).

Solutions

  1. Read the full pipeline logs to find the root cause of the non-DONE state
  2. Retry the computation after fixing the pipeline logic or input data
  3. Verify runner configuration (project, region, credentials) when using Dataflow
  4. Check that the pipeline is not being cancelled by an external timeout or by ib.cancel

Example fix

// before
result = compute_async([pcoll], blocking=True)  # state=FAILED, no diagnostics
// after
try:
    compute_async([pcoll], blocking=True)
except RuntimeError as e:
    print(pipeline_result.state)  # inspect FAILED/CANCELLED state and runner logs
Defensive patterns

Strategy: try-catch

Validate before calling

# validate runner config before executing
options.view_as(GoogleCloudOptions).project and options.view_as(GoogleCloudOptions).region  # for Dataflow

Try / catch

try:
    compute_async([pcoll], blocking=True)
except RuntimeError as e:
    print('pipeline terminal state:', e)  # then inspect runner logs
    retry_after_fix()

Prevention

When it happens

Trigger: 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.

Common situations: Notebook cell executes a pipeline that crashes at runtime; Dataflow job fails due to permissions/quota; local DirectRunner worker raises an unhandled exception.

Related errors


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

Appendix: source

Thrown at sdks/python/apache_beam/runners/interactive/recording_manager.py:690

    self._watch(list(pcolls_to_compute))
    self.record_pipeline()

    if blocking:
      self._env.mark_pcollection_computing(pcolls_to_compute)
      try:
        if wait_for_inputs:
          if not self._wait_for_dependencies(pcolls_to_compute):
            raise RuntimeError(
                'Dependency computation failed or was cancelled.')
        pipeline_result = self._execute_pipeline_fragment(
            pcolls_to_compute, None, runner, options)
        if pipeline_result.state == PipelineState.DONE:
          self._env.mark_pcollection_computed(pcolls_to_compute)
        else:
          _LOGGER.error(
              'Blocking computation failed. State: %s', pipeline_result.state)
          raise RuntimeError(
              'Blocking computation failed. State: %s', pipeline_result.state)
      finally:
        self._env.unmark_pcollection_computing(pcolls_to_compute)
      return None

    else:  # Asynchronous
      future = Future()
      async_result = AsyncComputationResult(
          future, pcolls_to_compute, self.user_pipeline, self)
      with self._lock:
        self._async_computations[async_result._display_id] = async_result
      self._env.mark_pcollection_computing(pcolls_to_compute)

      def task():
        try:
          result = self._run_async_computation(
              pcolls_to_compute, async_result, wait_for_inputs, runner, options)
          future.set_result(result)

View on GitHub (pinned to 12126d8942)