{"record":{"id":"ae2cd4d58d218217","repo":"langgenius/dify","slug":"app-unavailable-ae2cd4","errorCode":"app_unavailable","errorMessage":"App unavailable, please check your app configurations.","messagePattern":"App unavailable, please check your app configurations\\.","errorType":"error_code","errorClass":"AppUnavailableError","httpStatus":400,"severity":"error","filePath":"api/controllers/console/explore/conversation.py","lineNumber":59,"sourceCode":"    console_ns,\n    ConversationInfiniteScrollPagination,\n    ResultResponse,\n    SimpleConversation,\n)\n\n\n@console_ns.route(\n    \"/installed-apps/<uuid:installed_app_id>/conversations\",\n    endpoint=\"installed_app_conversations\",\n)\nclass ConversationListApi(InstalledAppResource):\n    @console_ns.doc(params=query_params_from_model(ConversationListQuery))\n    @console_ns.response(200, \"Success\", console_ns.models[ConversationInfiniteScrollPagination.__name__])\n    @with_current_user\n    def get(self, current_user: Account, installed_app: InstalledApp):\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        raw_args: dict[str, Any] = {\n            \"last_id\": request.args.get(\"last_id\"),\n            \"limit\": request.args.get(\"limit\", default=20, type=int),\n            \"pinned\": request.args.get(\"pinned\"),\n        }\n        if raw_args[\"last_id\"] is None:\n            raw_args[\"last_id\"] = None\n        pinned_value = raw_args[\"pinned\"]\n        if isinstance(pinned_value, str):\n            raw_args[\"pinned\"] = pinned_value == \"true\"\n        args = ConversationListQuery.model_validate(raw_args)\n\n        try:\n            with sessionmaker(db.engine).begin() as session:","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/explore/conversation.py#L41-L77","documentation":"AppUnavailableError (HTTP 400, code 'app_unavailable') is raised in ConversationListApi.get at /installed-apps/<id>/conversations when installed_app.app_with_session(session) returns None. The InstalledApp row exists but the underlying App record it references is gone — deleted by the owner, purged, or corrupted.","triggerScenarios":"GET /console/explore/installed-apps/<installed_app_id>/conversations where the original App was deleted by its owning tenant after installation, leaving an orphaned InstalledApp.","commonSituations":"App owner deleted the app from their workspace; tenant purge removed the App row; database inconsistency; the app is being decommissioned and the App was removed first.","solutions":["Uninstall the orphaned installed app via DELETE /console/explore/installed-apps/<installed_app_id>.","Verify with the app owner whether the app still exists; reinstall from Explore if available.","If this affects many users, check for a batch deletion or migration that removed App rows without cleaning up InstalledApp references."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"async function appExists(installedAppId) {\n  const res = await fetch(`/console/explore/installed-apps/${installedAppId}`);\n  return res.ok;\n}","typeGuard":null,"tryCatchPattern":"try {\n  const conversations = await listConversations(installedAppId);\n} catch (e) {\n  if (e.code === 'app_unavailable') {\n    // backing App gone — hide the conversation list, offer uninstall\n    showAppUnavailableUI(installedAppId);\n  }\n}","preventionTips":["Verify the installed app's backing App exists before listing conversations.","Handle app_unavailable by prompting the user to uninstall the orphaned installed app.","Clean up stale installed apps whose source App was deleted."],"tags":["installed-app","app-unavailable","orphaned-record","conversation-list"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}