{"record":{"id":"ef271d814c2d7d43","repo":"BerriAI/litellm","slug":"private-key-file-is-empty-file-path","errorCode":null,"errorMessage":"Private key file is empty: {file_path}","messagePattern":"Private key file is empty: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/oci/common_utils.py","lineNumber":138,"sourceCode":"        password=None,\n    )\n    if not isinstance(key, rsa.RSAPrivateKey):\n        raise TypeError(\"The provided private key is not an RSA key, which is required for OCI signing.\")\n    return key\n\n\ndef load_private_key_from_file(file_path: str) -> Any:\n    \"\"\"Loads a private key from a file path.\"\"\"\n    try:\n        with open(file_path, \"r\", encoding=\"utf-8\") as f:\n            key_str: Final = f.read().strip()\n    except FileNotFoundError:\n        raise FileNotFoundError(f\"Private key file not found: {file_path}\")\n    except OSError as e:\n        raise OSError(f\"Failed to read private key file '{file_path}': {e}\") from e\n\n    if not key_str:\n        raise ValueError(f\"Private key file is empty: {file_path}\")\n\n    return load_private_key_from_str(key_str)\n\n\n# ---------------------------------------------------------------------------\n# Env-var credential resolution\n# ---------------------------------------------------------------------------\n\n_OCI_REGION_ENV: Final = \"OCI_REGION\"\n_OCI_USER_ENV: Final = \"OCI_USER\"\n_OCI_FINGERPRINT_ENV: Final = \"OCI_FINGERPRINT\"\n_OCI_TENANCY_ENV: Final = \"OCI_TENANCY\"\n_OCI_KEY_FILE_ENV: Final = \"OCI_KEY_FILE\"\n_OCI_KEY_ENV: Final = \"OCI_KEY\"\n_OCI_COMPARTMENT_ID_ENV: Final = \"OCI_COMPARTMENT_ID\"\n\n\ndef resolve_oci_credentials(optional_params: dict) -> dict:","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/oci/common_utils.py#L120-L156","documentation":"Error \"Private key file is empty: {file_path}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/oci/common_utils.py:138 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Populate the key file shown in the message with the PEM private key content, or pass oci_key directly."],"exampleFix":null,"handlingStrategy":null,"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-23T08:17:48.524Z"}