{"record":{"id":"a2f7922ae199ce39","repo":"apache/beam","slug":"unknown-process-bundle-id-s","errorCode":null,"errorMessage":"Unknown process bundle id %s.","messagePattern":"Unknown process bundle id (.+?)\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/runners/worker/sdk_worker.py","lineNumber":552,"sourceCode":"    Return the requested ``BundleProcessor`` from the cache.\n\n    Will return ``None`` if the BundleProcessor is known but not yet ready. Will\n    raise an error if the ``instruction_id`` is not known or has been discarded.\n    \"\"\"\n    with self._lock:\n      if instruction_id in self.failed_instruction_ids:\n        e = self.failed_instruction_ids[instruction_id]\n        raise RuntimeError(\n            'Bundle processing associated with %s has failed. '\n            'Check prior failing response and attached exception for details.' %\n            instruction_id) from e\n      processor = self.active_bundle_processors.get(\n          instruction_id, (None, None))[-1]\n      if processor:\n        return processor\n      if instruction_id in self.known_not_running_instruction_ids:\n        return None\n      raise RuntimeError('Unknown process bundle id %s.' % instruction_id)\n\n  def discard(self, instruction_id, exception):\n    # type: (str, Exception) -> None\n\n    \"\"\"\n    Marks the instruction id as failed shutting down the ``BundleProcessor``.\n    \"\"\"\n    processor = None\n    with self._lock:\n      tb_str = \"\".join(traceback.format_exception(exception))\n      if len(tb_str) > 10240:\n        tb_str = (\n            tb_str[:5000] + \"\\n... [traceback truncated] ...\\n\" +\n            tb_str[-5000:])\n      clean_exception = RuntimeError(\n          f\"Original Exception: {type(exception).__name__}: {str(exception)[:2000]}\\n{tb_str}\"\n      )\n      self.failed_instruction_ids[instruction_id] = clean_exception","sourceCodeStart":534,"sourceCodeEnd":570,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/runners/worker/sdk_worker.py#L534-L570","documentation":" BundleProcessorCache.lookup returns None for known-but-not-running instructions, but if the instruction_id is in neither failed_instruction_ids, active_bundle_processors, nor known_not_running_instruction_ids, it raises RuntimeError 'Unknown process bundle id'. The cache has never seen this instruction, indicating a control-protocol or lifecycle violation.","triggerScenarios":" lookup() called with an instruction id that was never registered (no process_bundle started for it) or whose records were fully evicted after completion/finalization.","commonSituations":" Runner and SDK harness version skew causing mismatched instruction bookkeeping; duplicate or delayed control messages referencing long-finished bundles; a runner bug sending finalize/progress for wrong ids; harness restart losing cache state.","solutions":["Align runner and SDK harness Beam versions to keep control-protocol state machines in sync.","Check worker logs for a harness restart/crash that would have wiped the in-memory cache.","Verify the runner does not issue control requests (finalize, split, progress) for completed or never-started bundles.","Retry the work item on the runner side; if reproducible, capture the instruction id and file a Beam issue."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"# confirm the instruction was actually started before touching the cache\nassert instruction_id in started_instruction_ids, \\\n    f'{instruction_id} was never registered with this harness'","typeGuard":"def is_known_instruction(cache, instruction_id: str) -> bool:\n    with cache._lock:\n        return (instruction_id in cache.failed_instruction_ids\n                or instruction_id in cache.active_bundle_processors\n                or instruction_id in cache.known_not_running_instruction_ids)","tryCatchPattern":"try:\n    proc = cache.lookup(instruction_id)\nexcept RuntimeError as e:\n    if 'Unknown process bundle id' in str(e):\n        requeue_work(instruction_id)  # harness lost state; re-execute\n    raise","preventionTips":["Keep runner and harness versions matched.","Detect harness restarts on the runner side and resynchronize instruction state.","Avoid control requests for completed or never-started bundles."],"tags":["apache-beam","sdk-worker","control-channel"],"backgroundTag":"entity-not-found","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"}