{"record":{"id":"91bd910beed55fab","repo":"crewAIInc/crewAI","slug":"tool-crewai-definition-must-point-to-an-existing","errorCode":null,"errorMessage":"[tool.crewai] definition must point to an existing file; got {definition!r}.","messagePattern":"\\[tool\\.crewai\\] definition must point to an existing file; got (.+?)\\.","errorType":"exception","errorClass":"ProjectDefinitionError","httpStatus":null,"severity":"error","filePath":"lib/crewai-core/src/crewai_core/project.py","lineNumber":138,"sourceCode":"            f\"Invalid project root for [tool.crewai] definition: {exc}\"\n        ) from exc\n\n    candidate = root / definition_path\n    try:\n        resolved_candidate = candidate.resolve(strict=False)\n    except OSError as exc:\n        raise ProjectDefinitionError(\n            f\"Invalid [tool.crewai] definition path {definition!r}: {exc}\"\n        ) from exc\n\n    if not resolved_candidate.is_relative_to(root):\n        raise ProjectDefinitionError(\n            \"[tool.crewai] definition must resolve inside the project root; \"\n            f\"got {definition!r}.\"\n        )\n\n    if not resolved_candidate.exists():\n        raise ProjectDefinitionError(\n            \"[tool.crewai] definition must point to an existing file; \"\n            f\"got {definition!r}.\"\n        )\n\n    if not resolved_candidate.is_file():\n        raise ProjectDefinitionError(\n            \"[tool.crewai] definition must point to a regular file; \"\n            f\"got {definition!r}.\"\n        )\n\n    return resolved_candidate\n\n\ndef _get_nested_value(data: dict[str, Any], keys: list[str]) -> Any:\n    return reduce(dict.__getitem__, keys, data)\n\n\ndef _get_project_attribute(","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-core/src/crewai_core/project.py#L120-L156","documentation":"Raised at the final existence check in resolve_project_definition_path: the definition path resolved cleanly and stayed inside the project root, but resolved_candidate.exists() is False. The file simply is not there — not created yet, deleted, renamed, or misnamed (including case-sensitivity mistakes on case-sensitive filesystems).","triggerScenarios":"definition = \"src/crew/main.py\" when the file was never created, was renamed to crew.py, or the casing differs (Main.py vs main.py on Linux). Also after moving files without updating pyproject.toml.","commonSituations":"Fresh clones of templates where the entry file must be generated first; refactors that renamed the module; case-mismatch paths that worked on macOS/Windows but fail on Linux CI.","solutions":["Confirm the exact file exists: ls the resolved path shown in the error relative to the project root.","Fix typos, casing, or the file extension in the definition value.","If the entry file is generated (e.g. by a scaffold command), run that generator before resolving the definition."],"exampleFix":"# before\n[tool.crewai]\ndefinition = \"src/crew/main.py\"  # file is actually crew_setup.py\n\n# after\n[tool.crewai]\ndefinition = \"src/crew/crew_setup.py\"","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef definition_file_exists(definition: str, root: Path) -> bool:\n    return (root / definition).is_file()","typeGuard":null,"tryCatchPattern":"except ProjectDefinitionError as e:\n    if \"existing file\" in str(e):\n        print(\"Create or fix the path of the crew entry file.\")","preventionTips":["Run the scaffold/generator before resolving the definition.","On case-sensitive CI (Linux), double-check filename casing matches the TOML exactly."],"tags":["configuration","filesystem","path-validation"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}