{"record":{"id":"67dbfe8d2081fc60","repo":"langgenius/dify","slug":"conversation-not-exists-67dbfe","errorCode":null,"errorMessage":"Conversation Not Exists.","messagePattern":"Conversation Not Exists\\.","errorType":"http","errorClass":"NotFound","httpStatus":404,"severity":"warning","filePath":"api/controllers/console/explore/conversation.py","lineNumber":123,"sourceCode":"    \"/installed-apps/<uuid:installed_app_id>/conversations/<uuid:c_id>\",\n    endpoint=\"installed_app_conversation\",\n)\nclass ConversationApi(InstalledAppResource):\n    @console_ns.response(204, \"Conversation deleted successfully\")\n    @with_current_user\n    def delete(self, current_user: Account, installed_app: InstalledApp, c_id: UUID):\n        app_model = installed_app.app_with_session(session=db.session())\n        if app_model is None:\n            raise AppUnavailableError()\n        app_mode = AppMode.value_of(app_model.mode)\n        if app_mode not in {AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT}:\n            raise NotChatAppError()\n\n        conversation_id = str(c_id)\n        try:\n            ConversationService.delete(app_model, conversation_id, current_user, session=db.session())\n        except ConversationNotExistsError:\n            raise NotFound(\"Conversation Not Exists.\")\n\n        return \"\", 204\n\n\n@console_ns.route(\n    \"/installed-apps/<uuid:installed_app_id>/conversations/<uuid:c_id>/name\",\n    endpoint=\"installed_app_conversation_rename\",\n)\nclass ConversationRenameApi(InstalledAppResource):\n    @console_ns.expect(console_ns.models[ConversationRenamePayload.__name__])\n    @console_ns.response(200, \"Conversation renamed successfully\", console_ns.models[SimpleConversation.__name__])\n    @with_current_user\n    @model_validate(ConversationRenamePayload)\n    def post(self, req_data: ConversationRenamePayload, current_user: Account, installed_app: InstalledApp, c_id: UUID):\n        app_model = installed_app.app_with_session(session=db.session())\n        if app_model is None:\n            raise AppUnavailableError()\n        app_mode = AppMode.value_of(app_model.mode)","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/explore/conversation.py#L105-L141","documentation":"NotFound (HTTP 404, werkzeug) with message 'Conversation Not Exists.' is raised in ConversationApi.delete when ConversationService.delete throws ConversationNotExistsError. The conversation UUID in the path does not match any conversation for this app and user — it was already deleted, never existed, or belongs to a different user/app.","triggerScenarios":"DELETE /console/explore/installed-apps/<id>/conversations/<c_id> where c_id is a valid UUID but no conversation record exists for that app_model + current_user combination. Commonly a double-delete or a stale conversation reference.","commonSituations":"The conversation was already deleted in another tab/session; the UUID was fabricated or mistyped (but still valid UUID format); the conversation belongs to a different user; a retention policy already cleaned it up.","solutions":["Treat a 404 on delete as success (idempotent delete) — the conversation is already gone.","If the user expects the conversation to exist, check the conversation list to confirm it was not already deleted.","Ensure the c_id comes from the current user's own conversation list, not a shared or copied URL."],"exampleFix":"// before: treat 404 as an error\nawait deleteConversation(id);  // throws on 404\n// after: idempotent delete\ntry { await deleteConversation(id); }\ncatch (e) { if (e.status === 404) return; /* already deleted */ throw e; }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await deleteConversation(installedAppId, conversationId);\n} catch (e) {\n  if (e.status === 404 && e.message?.includes('Conversation Not Exists')) {\n    // already deleted — treat as success (idempotent)\n    return;\n  }\n  throw e;\n}","preventionTips":["Treat a 404 on conversation delete as success — the conversation is already gone.","Prevent double-delete UI by removing the conversation from the list immediately on the first request.","Ensure the conversation UUID comes from the current user's own list."],"tags":["conversation","not-found","idempotent-delete","installed-app"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}