{"record":{"id":"1215b783d9e5cbf6","repo":"zed-industries/zed","slug":"build-build-id-was-not-ready-before-the-wait-tim","errorCode":null,"errorMessage":"build {build_id} was not ready before the wait timeout","messagePattern":"build (.+?) was not ready before the wait timeout","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"error","filePath":"crates/eval_cli/zed_eval/modal_app.py","lineNumber":720,"sourceCode":"    try:\n        write_run_inputs(run_dir, run_request)\n        state(\"starting\", build_id=run_request.get(\"build_id\"))\n        log(f\"Starting run {namespace}/{experiment_name}/{run_id}\")\n\n        build_id = run_request.get(\"build_id\")\n        if build_id:\n            build_dir = pathlib.Path(\"/data/builds\") / build_id\n            ready_path = build_dir / \"READY\"\n            build_info_path = build_dir / \"build-info.json\"\n            source_patch_path = build_dir / \"source.patch\"\n            source_info_path = build_dir / \"source-info.json\"\n            state(\"waiting_for_build\", build_id=build_id)\n            deadline = time.time() + int(\n                run_request.get(\"build_wait_timeout_secs\") or 7200\n            )\n            while not ready_path.exists():\n                if time.time() >= deadline:\n                    raise TimeoutError(\n                        f\"build {build_id} was not ready before the wait timeout\"\n                    )\n                log(f\"Waiting for build {build_id} to become ready\")\n                time.sleep(30)\n                reload_volume()\n            shutil.copy(build_info_path, run_dir / \"build-info.json\")\n            if source_patch_path.exists():\n                shutil.copy(source_patch_path, run_dir / \"source.patch\")\n            if source_info_path.exists():\n                shutil.copy(source_info_path, run_dir / \"source-info.json\")\n            log(f\"Using build {build_id}\")\n\n        provision_benchmark_dataset(run_request, log)\n\n        jobs_parent = pathlib.Path(\"/tmp/agent-evals/harbor-jobs\")\n        jobs_parent.mkdir(parents=True, exist_ok=True)\n        command = harness_command.build_harness_command(run_request, str(jobs_parent))\n        redacted = config.redacted_command(command)","sourceCodeStart":702,"sourceCodeEnd":738,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/eval_cli/zed_eval/modal_app.py#L702-L738","documentation":"Raised as TimeoutError inside modal_app.run_controller() when /data/builds/{build_id}/READY has not appeared within build_wait_timeout_secs (default 7200) while polling every 30s. The controller waits because the launch may spawn the build and the controller concurrently; if the build fails, is never spawned, or compiles longer than the budget, the controller gives up rather than waiting forever. The run is marked failed and the Modal compute stops.","triggerScenarios":"The build_eval_cli call crashed (git fetch of the base sha failed, patch did not apply, cargo zigbuild error, OOM/Modal timeout at 7200s); a launch referencing a --build-id that was never spawned (no builder running to create READY); build_wait_timeout_secs set too low for a cold compile of a large patch.","commonSituations":"Retrying a run whose build legitimately failed earlier — the wait repeats and times out again unless the build is fixed; detached builds that died silently; big source changes pushing compile time past the default two hours.","solutions":["Inspect the build that was spawned at launch (the 'Spawned build: <call-id>' line) in the Modal console for the real compile error, fix the source/patch, and relaunch.","If the build was never spawned (e.g. referencing an existing id that does not exist on the volume), run zed-eval build first or relaunch normally so the build is created.","Raise the wait budget via --build-wait-timeout-secs (and the build function's own timeout) when cold compiles legitimately exceed two hours.","Verify the build exists and its state with the builds listing before spawning controllers that reference it."],"exampleFix":"# before\nzed-eval run rf   # build crashed at cargo zigbuild; controller waited 7200s\n# -> TimeoutError: build <id> was not ready before the wait timeout\n\n# after\n# 1) fix the compile error seen in the build call logs\n# 2) if compile is just slow:\nzed-eval run rf --build-wait-timeout-secs 14400","handlingStrategy":"validation","validationCode":"# Before spawning a controller that references an existing build, confirm it on the volume:\nbuilds = list_builds_function.remote(limit=100)   # modal_app.list_builds\nknown = {b.get(\"build_id\") for b in builds}\nif run_request.get(\"build_id\") not in known and not build_spawned_with_this_launch:\n    raise SystemExit(\"referenced build does not exist; run `zed-eval build` first\")","typeGuard":null,"tryCatchPattern":"try:\n    result = controller_function.remote(run_request)\nexcept TimeoutError as error:\n    # build never became READY: inspect the spawned build call's logs,\n    # fix the compile failure, then relaunch (retrying the wait alone won't help)","preventionTips":["Watch the spawned build call (id printed at launch) so a failed compile is caught early, not after the 2h wait.","Set --build-wait-timeout-secs comfortably above worst-case cold compile time.","Never reference a --build-id that was not built or spawned in the same launch."],"tags":["build","timeout","modal","controller"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}