{"record":{"id":"bab7e08d7ed7d135","repo":"BerriAI/litellm","slug":"oci-signer-cannot-be-none-when-calling-sign-with-o","errorCode":null,"errorMessage":"oci_signer cannot be None when calling sign_with_oci_signer","messagePattern":"oci_signer cannot be None when calling sign_with_oci_signer","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/oci/common_utils.py","lineNumber":227,"sourceCode":"    request_data: dict,\n    api_base: str,\n) -> tuple[dict, bytes]:\n    \"\"\"Sign a request using an OCI SDK Signer object passed in optional_params.\"\"\"\n    oci_signer: Final = optional_params.get(\"oci_signer\")\n    body: Final = json.dumps(request_data).encode(\"utf-8\")\n    method: Final = str(optional_params.get(\"method\", \"POST\")).upper()\n\n    if method not in {\"POST\", \"GET\", \"PUT\", \"DELETE\", \"PATCH\"}:\n        raise ValueError(f\"Unsupported HTTP method: {method}\")\n\n    prepared_headers: Final = {**headers}\n    prepared_headers.setdefault(\"content-type\", \"application/json\")\n    prepared_headers.setdefault(\"content-length\", str(len(body)))\n\n    request_wrapper: Final = OCIRequestWrapper(method=method, url=api_base, headers=prepared_headers, body=body)\n\n    if oci_signer is None:\n        raise ValueError(\"oci_signer cannot be None when calling sign_with_oci_signer\")\n\n    try:\n        oci_signer.do_request_sign(request_wrapper, enforce_content_headers=True)\n    except Exception as e:\n        raise OCIError(\n            status_code=500,\n            message=(\n                f\"Failed to sign request with provided oci_signer: {e}. \"\n                \"The signer must implement the OCI SDK Signer interface with a \"\n                \"do_request_sign(request, enforce_content_headers=True) method. \"\n                \"See: https://docs.oracle.com/en-us/iaas/tools/python/latest/api/signing.html\"\n            ),\n        ) from e\n\n    headers.update(request_wrapper.headers)\n    return headers, body\n\n","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/oci/common_utils.py#L209-L245","documentation":"Error \"oci_signer cannot be None when calling sign_with_oci_signer\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/oci/common_utils.py:227 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-None oci_signer (an OCI SDK Signer instance) when calling the signing helper."],"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-14T00:17:10.932Z"}