BerriAI/litellm · error · ValueError

Current secret {current_secret_name} not found

Error message

Current secret {current_secret_name} not found

What it means

Precondition check during a secret rotate/update flow: the code first async-reads the current secret by name, and the manager returned None, meaning no secret exists under current_secret_name. Rotation is aborted because there is no 'old' value to rotate from.

Source

Thrown at litellm/secret_managers/base_secret_manager.py:148

            optional_params: Additional AWS parameters
            timeout: Request timeout

        Returns:
            dict: Response containing the new secret details

        Raises:
            ValueError: If the secret doesn't exist or if there's an HTTP error
        """
        try:
            # First verify the old secret exists
            old_secret: Final = await self.async_read_secret(
                secret_name=current_secret_name,
                optional_params=optional_params,
                timeout=timeout,
            )

            if old_secret is None:
                raise ValueError(f"Current secret {current_secret_name} not found")

            # Create new secret with new name and value
            create_response: Final = await self.async_write_secret(
                secret_name=new_secret_name,
                secret_value=new_secret_value,
                description=f"Rotated from {current_secret_name}",
                optional_params=optional_params,
                timeout=timeout,
            )

            # Verify new secret was created successfully
            new_secret: Final = await self.async_read_secret(
                secret_name=new_secret_name,
                optional_params=optional_params,
                timeout=timeout,
            )

            if new_secret is None:

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Verify the secret {current_secret_name} exists in the configured secret manager before rotating.
  2. Create the secret first, or correct the name/environment variable pointing to it.
Defensive patterns

Strategy: validation

When it happens

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

Common situations: See trigger scenarios.


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