{"record":{"id":"78d9a90a389647dc","repo":"BerriAI/litellm","slug":"oci-key-must-be-a-string-containing-the-pem-privat","errorCode":null,"errorMessage":"oci_key must be a string containing the PEM private key content. Got type: {type(oci_key).__name__}","messagePattern":"oci_key must be a string containing the PEM private key content\\. Got type: (.+?)","errorType":"exception","errorClass":"OCIError","httpStatus":400,"severity":"error","filePath":"litellm/llms/oci/common_utils.py","lineNumber":307,"sourceCode":"    }\n\n    signed_header_names: Final = [\n        \"date\",\n        \"(request-target)\",\n        \"host\",\n        \"content-length\",\n        \"content-type\",\n        \"x-content-sha256\",\n    ]\n    signing_string: Final = build_signature_string(method, path, headers_to_sign, signed_header_names)\n\n    _require_cryptography()\n\n    # Resolve the private key — prefer inline PEM content over file path\n    oci_key_content: str | None = None\n    if oci_key:\n        if not isinstance(oci_key, str):\n            raise OCIError(\n                status_code=400,\n                message=(\n                    f\"oci_key must be a string containing the PEM private key content. \"\n                    f\"Got type: {type(oci_key).__name__}\"\n                ),\n            )\n        oci_key_content = oci_key.replace(\"\\\\n\", \"\\n\").replace(\"\\r\\n\", \"\\n\")\n\n    private_key: Final = (\n        load_private_key_from_str(oci_key_content)\n        if oci_key_content\n        else load_private_key_from_file(oci_key_file)\n        if oci_key_file\n        else None\n    )\n\n    if private_key is None:\n        raise OCIError(","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/oci/common_utils.py#L289-L325","documentation":"Error \"oci_key must be a string containing the PEM private key content. Got type: {type(oci_key).__name__}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/oci/common_utils.py:307 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass oci_key as a string containing the PEM private key content, not the type shown in the message."],"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"}