{"record":{"id":"77c92c08b6808473","repo":"BerriAI/litellm","slug":"error-reading-major-airlines-json-e","errorCode":null,"errorMessage":"Error reading major_airlines.json: {e}","messagePattern":"Error reading major_airlines\\.json: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/guardrails/guardrail_endpoints.py","lineNumber":1487,"sourceCode":"        os.path.dirname(__file__),\n        \"guardrail_hooks\",\n        \"litellm_content_filter\",\n        \"competitor_intent\",\n        \"major_airlines.json\",\n    )\n    if not os.path.exists(airlines_path):\n        raise HTTPException(\n            status_code=404,\n            detail=\"major_airlines.json not found\",\n        )\n    try:\n        with open(airlines_path, \"r\", encoding=\"utf-8\") as f:\n            import json\n\n            airlines: Final = json.load(f)\n        return {\"airlines\": airlines}\n    except Exception as e:\n        raise HTTPException(status_code=500, detail=f\"Error reading major_airlines.json: {e}\") from e\n\n\n@router.post(\n    \"/guardrails/validate_blocked_words_file\",\n    tags=[\"Guardrails\"],\n    dependencies=[Depends(user_api_key_auth)],\n)\nasync def validate_blocked_words_file(request: dict[str, str]):\n    \"\"\"\n    Validate a blocked_words YAML file content.\n\n    Args:\n        request: Dictionary with 'file_content' key containing the YAML string\n\n    Returns:\n        Dictionary with 'valid' boolean and either 'message'/'errors' depending on result\n\n    Example Request:","sourceCodeStart":1469,"sourceCodeEnd":1505,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/guardrails/guardrail_endpoints.py#L1469-L1505","documentation":"Raised by the major-airlines endpoint when major_airlines.json exists but json.load or the surrounding read raises (corrupt JSON, encoding problem, or mid-read IO error). The original exception text is embedded and the endpoint returns 500 — this is data-file corruption on the server, not a request problem.","triggerScenarios":"Thrown at litellm/proxy/guardrails/guardrail_endpoints.py:1487 when the library encounters an invalid state.","commonSituations":"major_airlines.json exists but could not be read or parsed.","solutions":["Check proxy logs for the read error and verify major_airlines.json is valid JSON."],"exampleFix":"python -m json.tool major_airlines.json","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}