{"record":{"id":"d40447aecac2e703","repo":"zed-industries/zed","slug":"project-project-number-not-found-in-repo-owner","errorCode":null,"errorMessage":"Project #{project_number} not found in {REPO_OWNER}","messagePattern":"Project #(.+?) not found in (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"script/github-guild-board.py","lineNumber":255,"sourceCode":"        query($owner: String!, $number: Int!) {\n          organization(login: $owner) {\n            projectV2(number: $number) {\n              id\n              fields(first: 50) {\n                nodes {\n                  ... on ProjectV2Field { id name dataType }\n                  ... on ProjectV2SingleSelectField { id name options { id name } }\n                }\n              }\n            }\n          }\n        }\n        \"\"\",\n        {\"owner\": REPO_OWNER, \"number\": project_number},\n    )\n    project = data[\"organization\"][\"projectV2\"]\n    if not project:\n        raise RuntimeError(f\"Project #{project_number} not found in {REPO_OWNER}\")\n    return project\n\n\ndef find_project_item(project_id, content_node_id):\n    # Includes each item's single-select values so callers can read Status\n    # without a second query.\n    data = github_graphql(\n        \"\"\"\n        query($contentId: ID!) {\n          node(id: $contentId) {\n            ... on Issue {\n              projectItems(first: 50) {\n                nodes {\n                  id\n                  project { id }\n                  fieldValues(first: 20) {\n                    nodes {\n                      ... on ProjectV2ItemFieldSingleSelectValue {","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/script/github-guild-board.py#L237-L273","documentation":"load_project queries organization(login: REPO_OWNER).projectV2(number: project_number); GitHub returns null — not a body error — when no such project exists under that org or when the token cannot see it, and the script converts that null into this RuntimeError. Not-found and no-permission are indistinguishable at this call site.","triggerScenarios":"PROJECT_NUMBER is wrong or belongs to a user-level project rather than an org project; GITHUB_TOKEN lacks read:project scope; the project is private to another org; REPO_OWNER env var is misspelled so the organization lookup resolves to null projectV2.","commonSituations":"Project deleted and recreated with a new number; CI token rotated without project scopes; workflow pointed at a fork or different org; project moved from org to user ownership.","solutions":["Confirm the number from the board URL: github.com/orgs/<org>/projects/<number>","Check the token grants read:project (classic scope) or fine-grained project read on that org","If the project is user-owned, query user(login:){ projectV2(...) } instead of organization(...)","Verify REPO_OWNER matches the org that actually owns the project"],"exampleFix":"// before\nproject = data[\"organization\"][\"projectV2\"]\nif not project:\n    raise RuntimeError(f\"Project #{project_number} not found in {REPO_OWNER}\")\n\n// after\nproject = data[\"organization\"][\"projectV2\"]\nif not project:\n    raise RuntimeError(\n        f\"Project #{project_number} not found in {REPO_OWNER}; \"\n        \"check PROJECT_NUMBER, REPO_OWNER, and that the token has read:project\"\n    )","handlingStrategy":"validation","validationCode":"def project_number_is_plausible(number: int) -> bool:\n    return isinstance(number, int) and number > 0","typeGuard":"def projectv2_visible(data: dict) -> bool:\n    org = data.get(\"organization\") or {}\n    return bool(org.get(\"projectV2\"))","tryCatchPattern":"try:\n    project = load_project(project_number)\nexcept RuntimeError as exc:\n    if \"not found\" in str(exc):\n        raise SystemExit(f\"Check PROJECT_NUMBER={project_number}, REPO_OWNER={REPO_OWNER}, and token project scope\")\n    raise","preventionTips":["Pin the project number via CI variables and alert when the board is recreated","Grant tokens read:project explicitly","Distinguish org-level from user-level projects before scripting","Fail fast on null projectV2 instead of proceeding with None"],"tags":["github-projects","graphql","config","api-auth"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}