{"record":{"id":"c4609ff9beefebfa","repo":"warpdotdev/warp","slug":"schema-unavailable-or-invalid","errorCode":"schema_unavailable_or_invalid","errorMessage":"schema_unavailable_or_invalid","messagePattern":"schema_unavailable_or_invalid","errorType":"exception","errorClass":"InspectionError","httpStatus":null,"severity":"error","filePath":"resources/bundled/skills/tui-migrate-setup/scripts/inspect_shared_settings.py","lineNumber":67,"sourceCode":"\n    visit(schema, ())\n    return sorted(paths)\n\n\ndef nested_value(document: dict[str, Any], path: tuple[str, ...]) -> tuple[bool, Any]:\n    current: Any = document\n    for segment in path:\n        if not isinstance(current, dict) or segment not in current:\n            return False, None\n        current = current[segment]\n    return True, current\n\n\ndef _read_json_object(path: Path) -> dict[str, Any]:\n    try:\n        value = json.loads(path.read_text(encoding=\"utf-8\"))\n    except (OSError, UnicodeError, json.JSONDecodeError) as error:\n        raise InspectionError(\"schema_unavailable_or_invalid\") from error\n    if not isinstance(value, dict):\n        raise InspectionError(\"schema_unavailable_or_invalid\")\n    return value\n\n\ndef _find_probe_path(\n    value: Any, prefix: tuple[str, ...] = ()\n) -> tuple[str, ...] | None:\n    if isinstance(value, dict):\n        if value.get(\"__warp_probe__\") is True:\n            return prefix\n        for key, child in value.items():\n            result = _find_probe_path(child, (*prefix, key))\n            if result is not None:\n                return result\n    elif isinstance(value, list):\n        for child in value:\n            result = _find_probe_path(child, prefix)","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/resources/bundled/skills/tui-migrate-setup/scripts/inspect_shared_settings.py#L49-L85","documentation":"inspect_shared_settings.py loads the JSON schema passed via --schema using _read_json_object(); this raise site is the except branch, firing when the file cannot be read or parsed (OSError, UnicodeError, json.JSONDecodeError). InspectionError keeps the message to a bare sanitized code so no file contents leak into output.","triggerScenarios":"Passing --schema a path that is missing or unreadable; a schema with invalid JSON (trailing comma, comment, truncation); non-UTF-8 bytes; a TOML/JSONC file supplied where strict JSON is required.","commonSituations":"Typo'd or stale path after the schema moved; a schema emitted by another tool as JSONC with comments; permission-restricted file under a different user; empty file left by a failed earlier pipeline step.","solutions":["Verify the path and parse it yourself: python -c \"import json,pathlib; json.loads(pathlib.Path('SCHEMA').read_text())\"","Regenerate or re-download the settings schema if it was truncated or hand-edited","Check permissions/ownership when running under another user or a sandbox"],"exampleFix":"# before\npython inspect_shared_settings.py --schema settings.schema.toml --source ... # wrong artifact\n# error: schema_unavailable_or_invalid\n\n# after\npython inspect_shared_settings.py --schema settings.schema.json --source ... ","handlingStrategy":"validation","validationCode":"import json\nfrom pathlib import Path\n\nschema = json.loads(Path(args.schema).read_text(encoding='utf-8'))  # raises the same classes the script catches\nassert isinstance(schema, dict)","typeGuard":"def is_json_object(value) -> bool:\n    return isinstance(value, dict)","tryCatchPattern":"result = subprocess.run([sys.executable, 'inspect_shared_settings.py', ...], capture_output=True, text=True)\nif result.returncode != 0 and 'schema_unavailable_or_invalid' in result.stderr:\n    # re-validate or regenerate the schema file, then retry once\n    ...","preventionTips":["Validate the schema parses as strict JSON before invoking","Regenerate the schema from its source when it changes","Check file permissions when running under service accounts"],"tags":["json","schema","io","cli"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}