{"record":{"id":"0ddede8f774a269d","repo":"BerriAI/litellm","slug":"could-not-authenticate-to-cyberark-conjur-e","errorCode":null,"errorMessage":"Could not authenticate to CyberArk Conjur: {e}","messagePattern":"Could not authenticate to CyberArk Conjur: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"litellm/secret_managers/cyberark_secret_manager.py","lineNumber":108,"sourceCode":"            else:\n                # API key authentication\n                http_handler: Final = _get_httpx_client(params={\"ssl_verify\": self.ssl_verify})\n                resp = http_handler.client.post(auth_url, content=self.conjur_api_key)\n\n            resp.raise_for_status()\n\n            # The response is a JSON token that needs to be base64-encoded\n            token_json: Final = resp.text\n            token_b64: Final = base64.b64encode(token_json.encode()).decode()\n\n            verbose_logger.debug(\"Successfully authenticated with CyberArk Conjur.\")\n\n            # Cache the token for the refresh interval\n            self.cache.set_cache(key=\"cyberark_auth_token\", value=token_b64)\n\n            return token_b64\n        except Exception as e:\n            raise RuntimeError(f\"Could not authenticate to CyberArk Conjur: {e}\")\n\n    def _get_request_headers(self) -> dict:\n        \"\"\"\n        Get headers for CyberArk API requests including authentication.\n\n        Returns:\n            dict: Headers with authentication token\n        \"\"\"\n        token: Final = self._authenticate()\n        return {\"Authorization\": f'Token token=\"{token}\"'}\n\n    def _ensure_variable_exists(self, secret_name: str) -> None:\n        \"\"\"\n        Ensure a variable exists in CyberArk Conjur by creating a policy entry if needed.\n\n        Args:\n            secret_name: Name of the variable to ensure exists\n        \"\"\"","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/secret_managers/cyberark_secret_manager.py#L90-L126","documentation":"Authentication failure talking to CyberArk Conjur: the token request (API-key or cert-based) either returned a non-2xx status via raise_for_status or threw, and the underlying exception is wrapped into this error.","triggerScenarios":"Thrown at litellm/secret_managers/cyberark_secret_manager.py:108 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the CyberArk Conjur URL, account, and credentials (API key or client cert/key).","Review the underlying exception {e} for TLS or 401/403 details and fix accordingly."],"exampleFix":null,"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-14T05:17:10.506Z"}