{"record":{"id":"0eb363ab87bba2f5","repo":"BerriAI/litellm","slug":"prompt-with-id-prompt-id-not-found","errorCode":null,"errorMessage":"Prompt with ID {prompt_id} not found","messagePattern":"Prompt with ID (.+?) not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/prompts/prompt_endpoints.py","lineNumber":985,"sourceCode":"    if prisma_client is None:\n        raise HTTPException(status_code=500, detail=CommonProxyErrors.db_not_connected_error.value)\n\n    try:\n        # Try to get prompt directly first\n        existing_prompt = IN_MEMORY_PROMPT_REGISTRY.get_prompt_by_id(prompt_id)\n\n        # If not found, try to find the latest version\n        if existing_prompt is None:\n            latest_prompt_id: Final = get_latest_version_prompt_id(\n                prompt_id=prompt_id,\n                all_prompt_ids=IN_MEMORY_PROMPT_REGISTRY.IN_MEMORY_PROMPTS,\n            )\n            existing_prompt = IN_MEMORY_PROMPT_REGISTRY.get_prompt_by_id(latest_prompt_id)\n            # Use the resolved prompt_id for deletion\n            prompt_id = latest_prompt_id\n\n        if existing_prompt is None:\n            raise HTTPException(status_code=404, detail=f\"Prompt with ID {prompt_id} not found\")\n\n        if existing_prompt.prompt_info.prompt_type == \"config\":\n            raise HTTPException(\n                status_code=400,\n                detail=\"Cannot delete config prompts.\",\n            )\n\n        # Get the base prompt ID (without version suffix) for database deletion\n        base_prompt_id: Final = get_base_prompt_id(prompt_id=prompt_id)\n\n        # Build delete filter; scope to environment if provided\n        delete_where: Final[dict[str, str]] = {\"prompt_id\": base_prompt_id}\n        if environment:\n            delete_where[\"environment\"] = environment\n\n        # Delete versions from the database (scoped to environment if provided)\n        await _prompt_table(prisma_client).delete_many(where=delete_where)\n","sourceCodeStart":967,"sourceCodeEnd":1003,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/prompts/prompt_endpoints.py#L967-L1003","documentation":"Delete guard: the prompt ID (after direct lookup and latest-version fallback in the in-memory registry and DB) resolves to no existing prompt, so there is nothing to delete; surfaced as 404.","triggerScenarios":"Thrown at litellm/proxy/prompts/prompt_endpoints.py:985 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the prompt_id via the prompts list endpoint; recreate the prompt if deleted."],"exampleFix":null,"handlingStrategy":"type-guard","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"}