BerriAI/litellm · error · RuntimeError

Could not authenticate to CyberArk Conjur: {e}

Error message

Could not authenticate to CyberArk Conjur: {e}

What it means

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.

Source

Thrown at litellm/secret_managers/cyberark_secret_manager.py:108

            else:
                # API key authentication
                http_handler: Final = _get_httpx_client(params={"ssl_verify": self.ssl_verify})
                resp = http_handler.client.post(auth_url, content=self.conjur_api_key)

            resp.raise_for_status()

            # The response is a JSON token that needs to be base64-encoded
            token_json: Final = resp.text
            token_b64: Final = base64.b64encode(token_json.encode()).decode()

            verbose_logger.debug("Successfully authenticated with CyberArk Conjur.")

            # Cache the token for the refresh interval
            self.cache.set_cache(key="cyberark_auth_token", value=token_b64)

            return token_b64
        except Exception as e:
            raise RuntimeError(f"Could not authenticate to CyberArk Conjur: {e}")

    def _get_request_headers(self) -> dict:
        """
        Get headers for CyberArk API requests including authentication.

        Returns:
            dict: Headers with authentication token
        """
        token: Final = self._authenticate()
        return {"Authorization": f'Token token="{token}"'}

    def _ensure_variable_exists(self, secret_name: str) -> None:
        """
        Ensure a variable exists in CyberArk Conjur by creating a policy entry if needed.

        Args:
            secret_name: Name of the variable to ensure exists
        """

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Check the CyberArk Conjur URL, account, and credentials (API key or client cert/key).
  2. Review the underlying exception {e} for TLS or 401/403 details and fix accordingly.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at litellm/secret_managers/cyberark_secret_manager.py:108 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/0ddede8f774a269d. Report an issue: GitHub.