{"record":{"id":"ffa642977aeef3dc","repo":"apache/beam","slug":"sdk-failed-to-start-final-status-is-s","errorCode":null,"errorMessage":"SDK failed to start. Final status is %s","messagePattern":"SDK failed to start\\. Final status is (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/runners/portability/fn_api_runner/worker_handlers.py","lineNumber":822,"sourceCode":"      ]).strip()\n      assert self._container_id is not None\n      while True:\n        status = subprocess.check_output([\n            'docker', 'inspect', '-f', '{{.State.Status}}', self._container_id\n        ]).strip()\n        _LOGGER.info(\n            'Waiting for docker to start up. Current status is %s' %\n            status.decode('utf-8'))\n        if status == b'running':\n          _LOGGER.info(\n              'Docker container is running. container_id = %s, '\n              'worker_id = %s',\n              self._container_id,\n              self.worker_id)\n          break\n        elif status in (b'dead', b'exited'):\n          subprocess.call(['docker', 'container', 'logs', self._container_id])\n          raise RuntimeError(\n              'SDK failed to start. Final status is %s' %\n              status.decode('utf-8'))\n      time.sleep(1)\n    self._done = False\n    t = threading.Thread(target=self.watch_container)\n    t.daemon = True\n    t.start()\n\n  def watch_container(self):\n    # type: () -> None\n    while not self._done:\n      assert self._container_id is not None\n      status = subprocess.check_output(\n          ['docker', 'inspect', '-f', '{{.State.Status}}',\n           self._container_id]).strip()\n      if status != b'running':\n        if not self._done:\n          logs = subprocess.check_output([","sourceCodeStart":804,"sourceCodeEnd":840,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/runners/portability/fn_api_runner/worker_handlers.py#L804-L840","documentation":"The Docker-based worker handler polls the container's status while waiting for the SDK harness to become ready. If the container reports 'dead' or 'exited' before the ready handshake completes, the runner dumps container logs and raises this RuntimeError, since the SDK harness never started.","triggerScenarios":"start_worker watching a docker container that terminates during startup: image crash, OOM kill, bad entrypoint, missing python/beam package, or the harness process exiting on a config error before registering with the runner.","commonSituations":"Corrupt or wrong-architecture container image; container killed by memory limits; harness crashes on import errors from user code baked into the image; docker daemon resource exhaustion.","solutions":["Inspect the docker container logs printed just before the error for the actual crash cause.","Rebuild/pull a correct, version-matched SDK harness image (docker pull the image for your Beam version).","Increase container memory/CPU limits (e.g. --docker_container_run_options '--memory=4g').","Verify the image's entrypoint launches the apache_beam worker main; check --sdk_harness_container_image_overrides settings."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"subprocess.call(['docker', 'inspect', '-f', '{{.State.Status}}', container_id])","typeGuard":null,"tryCatchPattern":"try:\n    handler.start_worker()\nexcept RuntimeError as e:\n    subprocess.call(['docker', 'container', 'logs', container_id])\n    raise","preventionTips":["Set adequate container memory/CPU limits","Test the harness image standalone before runs","Match image architecture to host"],"tags":["docker","container","startup","worker-lifecycle"],"backgroundTag":"worker-startup-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"}