{"record":{"id":"483ddff0c5e8527c","repo":"BerriAI/litellm","slug":"current-secret-current-secret-name-not-found","errorCode":null,"errorMessage":"Current secret {current_secret_name} not found","messagePattern":"Current secret (.+?) not found","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/secret_managers/base_secret_manager.py","lineNumber":148,"sourceCode":"            optional_params: Additional AWS parameters\n            timeout: Request timeout\n\n        Returns:\n            dict: Response containing the new secret details\n\n        Raises:\n            ValueError: If the secret doesn't exist or if there's an HTTP error\n        \"\"\"\n        try:\n            # First verify the old secret exists\n            old_secret: Final = await self.async_read_secret(\n                secret_name=current_secret_name,\n                optional_params=optional_params,\n                timeout=timeout,\n            )\n\n            if old_secret is None:\n                raise ValueError(f\"Current secret {current_secret_name} not found\")\n\n            # Create new secret with new name and value\n            create_response: Final = await self.async_write_secret(\n                secret_name=new_secret_name,\n                secret_value=new_secret_value,\n                description=f\"Rotated from {current_secret_name}\",\n                optional_params=optional_params,\n                timeout=timeout,\n            )\n\n            # Verify new secret was created successfully\n            new_secret: Final = await self.async_read_secret(\n                secret_name=new_secret_name,\n                optional_params=optional_params,\n                timeout=timeout,\n            )\n\n            if new_secret is None:","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/secret_managers/base_secret_manager.py#L130-L166","documentation":"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.","triggerScenarios":"Thrown at litellm/secret_managers/base_secret_manager.py:148 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the secret {current_secret_name} exists in the configured secret manager before rotating.","Create the secret first, or correct the name/environment variable pointing to it."],"exampleFix":null,"handlingStrategy":"validation","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"}