zed-industries/zed · error · RuntimeError
Field '{field_name}' not found on project. Available: {avail
Error message
Field '{field_name}' not found on project. Available: {available} What it means
Before mutating a project item, the script looks up field_name among project["fields"]["nodes"] (the fields fetched in the earlier project query). When no field carries that exact, case-sensitive name it raises, listing the field names that do exist. This is config drift between the script's expected field name and the live GitHub ProjectV2 board.
Source
Thrown at script/github-community-pr-board.py:553
return None
def github_set_project_field(project, item_id, field_name, option_name):
"""Set a single-select field on a project item."""
field_id = None
option_id = None
for field in project["fields"]["nodes"]:
if field.get("name") == field_name:
field_id = field["id"]
for option in field.get("options", []):
if option["name"] == option_name:
option_id = option["id"]
break
break
if not field_id:
available = [f["name"] for f in project["fields"]["nodes"] if "name" in f]
raise RuntimeError(
f"Field '{field_name}' not found on project. Available: {available}"
)
if not option_id:
available = [
opt["name"]
for f in project["fields"]["nodes"]
if f.get("name") == field_name
for opt in f.get("options", [])
]
raise RuntimeError(
f"Option '{option_name}' not found in field '{field_name}'. "
f"Available: {available}"
)
github_graphql(
"""
mutation($projectId: ID!, $itemId: ID!, $fieldId: ID!, $optionId: String!) {
updateProjectV2ItemFieldValue(input: {View on GitHub (pinned to bc538def45)
Solutions
- Compare the expected name against the Available list in the error message (exact, case-sensitive) and update the script constant to the real name
- Alternatively rename the field back on the GitHub project so the script's expectation holds
- Verify the PROJECT_NUMBER env var points at the intended board
- Add a startup assertion that all required fields exist before performing any mutations
Example fix
// before
field_id = None
for field in project["fields"]["nodes"]:
if field.get("name") == field_name:
field_id = field["id"]
break
// after
board_fields = {f["name"] for f in project["fields"]["nodes"] if f.get("name")}
missing = {STATUS_FIELD, TRIAGE_FIELD} - board_fields
if missing:
raise RuntimeError(f"Board missing required fields {sorted(missing)}; has {sorted(board_fields)}") Defensive patterns
Strategy: validation
Validate before calling
def required_fields_exist(project: dict, required: list[str]) -> bool:
names = {f.get("name") for f in project["fields"]["nodes"]}
return set(required) <= names Type guard
def board_has_field(project: dict, field_name: str) -> bool:
return any(f.get("name") == field_name for f in project["fields"]["nodes"]) Try / catch
try:
set_field(project, item_id, STATUS_FIELD, option)
except RuntimeError as exc:
if "not found on project" in str(exc):
log(f"Board schema drifted: {exc}; skipping item {item_id}")
else:
raise Prevention
- Assert required fields at startup, before mutations
- Keep field-name constants in one place and reviewed during board changes
- Treat board renames as script changes: update both together
- Compare names case-sensitively by design and document it
When it happens
Trigger: The updateProjectV2ItemFieldValue flow runs with a field_name like "Status" that was renamed on the board (e.g. to "Triage Status"), or PROJECT_NUMBER points at a different project whose fields differ entirely, so the name lookup over fields.nodes fails.
Common situations: Maintainers rename board fields during a process change; the project is recreated from a template with different field names; script constants lag behind the board; case mismatch ("status" vs "Status").
Related errors
- Option '{option_name}' not found in field '{field_name}'. Av
- Field '{field_name}' not found on board
- Option '{option_name}' not found in field '{field_name}'
- GraphQL errors: {json.dumps(data['errors'])[:300]}
- GraphQL error: {result['errors']}
AI-assisted analysis of zed-industries/zed@bc538def45 (2026-08-16).
Data as JSON: /api/errors/597bf214a8657eff.
Report an issue: GitHub.