{"record":{"id":"de313a47a13c8a52","repo":"zed-industries/zed","slug":"app-args-app-name-not-deployed-or-function","errorCode":null,"errorMessage":"app '{args.app_name}' not deployed (or function '{function_name}' missing) — run 'zed-eval deploy' first","messagePattern":"app '(.+?)' not deployed \\(or function '(.+?)' missing\\) — run 'zed-eval deploy' first","errorType":"exception","errorClass":"AppNotDeployedError","httpStatus":null,"severity":"error","filePath":"crates/eval_cli/zed_eval/common.py","lineNumber":142,"sourceCode":"\n\ndef deployed_function(args: argparse.Namespace, function_name: str):\n    \"\"\"Look up an already-deployed Modal function. Never deploys.\n\n    `modal.Function.from_name` resolves a published function without deploying,\n    which is exactly what we want: deploying would cancel in-flight runs. We\n    hydrate eagerly so a missing app/function fails here with an actionable\n    message instead of deep inside a later `.spawn()`/`.remote()` call.\n    \"\"\"\n    import modal\n    from modal.exception import NotFoundError\n\n    configure_modal_environment(args)\n    function = modal.Function.from_name(args.app_name, function_name)\n    try:\n        function.hydrate()\n    except NotFoundError as error:\n        raise AppNotDeployedError(\n            f\"app '{args.app_name}' not deployed (or function \"\n            f\"'{function_name}' missing) — run 'zed-eval deploy' first\"\n        ) from error\n    return function\n\n\ndef modal_call_id(call: Any) -> str:\n    for attribute in (\"object_id\", \"id\", \"function_call_id\"):\n        value = getattr(call, attribute, None)\n        if value:\n            return str(value)\n    return str(call)\n\n\ndef print_table(rows: list[dict[str, Any]], columns: list[tuple[str, str]]) -> None:\n    if not rows:\n        print(\"No rows\")\n        return","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/eval_cli/zed_eval/common.py#L124-L160","documentation":"Before a run, common.py hydrates modal.Function.from_name(app_name, function_name) and converts modal.exception.NotFoundError into AppNotDeployedError with the fix in the message. Hydration is eager on purpose: without it, the failure would surface mid-run inside .spawn()/.remote(); failing here avoids the other bad option (auto-deploying), because deploying would cancel in-flight runs.","triggerScenarios":"Running eval commands against app_name before `zed-eval deploy` was ever executed in that environment/namespace; a client whose Modal token/environment (set by configure_modal_environment(args)) differs from where the app was deployed; the function label changing so from_name no longer resolves.","commonSituations":"Fresh machines or CI jobs skipping the deploy step; MODAL_ENVIRONMENT or token pointing at another account/namespace; stale deployments torn down by retention.","solutions":["Deploy first: `zed-eval deploy`, then re-run the command","Confirm the client uses the same Modal token/environment/namespace the app was deployed under","Verify the function_name being hydrated matches what deploy registered"],"exampleFix":"# before\nzed-eval run ...   # AppNotDeployedError\n\n# after\nzed-eval deploy && zed-eval run ...","handlingStrategy":"try-catch","validationCode":"import modal\n\nasync def deployed_apps():\n    return {app.app_name async for app in modal.App.list()}\n\n# before a batch job:\n# if args.app_name not in await deployed_apps(): run `zed-eval deploy` first","typeGuard":"from modal.exception import NotFoundError\n\ndef is_deployed(function):\n    try:\n        function.hydrate()\n        return True\n    except NotFoundError:\n        return False","tryCatchPattern":"from zed_eval.common import AppNotDeployedError\n\ntry:\n    function = get_modal_function(args, \"rollout\")\nexcept AppNotDeployedError as e:\n    raise SystemExit(f\"{e} — deploy, then re-run\")","preventionTips":["Make `zed-eval deploy` a prerequisite CI step before any run command","Pin the Modal token/environment so client and deploy share a namespace","Treat AppNotDeployedError as a setup error — never auto-deploy mid-run, it cancels in-flight runs"],"tags":["modal","deployment","cloud","python"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}