{"record":{"id":"2fdcadc01834f949","repo":"ruvnet/RuView","slug":"zone-zone-id-is-disabled","errorCode":null,"errorMessage":"Zone '{zone_id}' is disabled","messagePattern":"Zone '(.+?)' is disabled","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"archive/v1/src/api/dependencies.py","lineNumber":190,"sourceCode":"# Zone access dependencies\nasync def validate_zone_access(\n    zone_id: str,\n    current_user: Optional[Dict[str, Any]] = Depends(get_current_user)\n) -> str:\n    \"\"\"Validate user access to a specific zone.\"\"\"\n    domain_config = get_domain_config()\n    \n    # Check if zone exists\n    zone = domain_config.get_zone(zone_id)\n    if not zone:\n        raise HTTPException(\n            status_code=status.HTTP_404_NOT_FOUND,\n            detail=f\"Zone '{zone_id}' not found\"\n        )\n    \n    # Check if zone is enabled\n    if not zone.enabled:\n        raise HTTPException(\n            status_code=status.HTTP_403_FORBIDDEN,\n            detail=f\"Zone '{zone_id}' is disabled\"\n        )\n    \n    # If authentication is enabled, check user access\n    if current_user:\n        # Admin users have access to all zones\n        if current_user.get(\"is_admin\", False):\n            return zone_id\n        \n        # Check user's zone permissions\n        user_zones = current_user.get(\"zones\", [])\n        if user_zones and zone_id not in user_zones:\n            raise HTTPException(\n                status_code=status.HTTP_403_FORBIDDEN,\n                detail=f\"Access denied to zone '{zone_id}'\"\n            )\n    ","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/ruvnet/RuView/blob/4685618388a5e49fad5b3005806f3bdd6a7c25c3/archive/v1/src/api/dependencies.py#L172-L208","documentation":"validate_zone_access raises 403 \"Zone '<zone_id>' is disabled\" when the zone exists in domain configuration but has enabled=False. Existence was already confirmed; this is an administrative off-switch per zone.","triggerScenarios":"A zone deliberately disabled in config (enabled: false) receiving traffic; a zone toggled off during maintenance while clients keep polling it.","commonSituations":"Per-zone rollout flags; temporarily disabling a room/sensor zone; config edits accidentally flipping enabled.","solutions":["Set enabled=True for the zone in the domain configuration and reload","Point clients at an enabled zone in the meantime","Have clients treat 403-disabled distinctly from 404 so operators see the real state"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Skip disabled zones up front\nzones = client.get('/api/zones', headers=auth).json()\nenabled = [z['id'] for z in zones if z.get('enabled', True)]\nif zone_id not in enabled:\n    pick_another_zone(enabled)","typeGuard":null,"tryCatchPattern":"try:\n    r = client.get(f'/api/zones/{zone_id}/pose', headers=auth)\n    r.raise_for_status()\nexcept httpx.HTTPStatusError as e:\n    if e.response.status_code == 403 and 'disabled' in e.response.text:\n        mark_zone_disabled(zone_id)  # stop polling it; operator action needed\n    raise","preventionTips":["Filter client-side zone lists on the enabled flag","Distinguish 'disabled' 403 from 'access denied' 403 in monitoring","Remove disabled zones from polling loops to avoid log noise"],"tags":["zones","http-403","configuration","python"],"backgroundTag":null,"analyzedSha":"4685618388a5e49fad5b3005806f3bdd6a7c25c3","analyzedAt":"2026-08-16T06:09:40.886Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}