{"record":{"id":"9ec177a065b3e1b3","repo":"langgenius/dify","slug":"app-unavailable-9ec177","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/message.py","lineNumber":82,"sourceCode":"    ExploreMessageInfiniteScrollPagination,\n    ResultResponse,\n    SuggestedQuestionsResponse,\n)\n\n\n@console_ns.route(\n    \"/installed-apps/<uuid:installed_app_id>/messages\",\n    endpoint=\"installed_app_messages\",\n)\nclass MessageListApi(InstalledAppResource):\n    @console_ns.doc(params=query_params_from_model(MessageListQuery))\n    @console_ns.response(200, \"Success\", console_ns.models[ExploreMessageInfiniteScrollPagination.__name__])\n    @with_current_user\n    def get(self, current_user: Account, installed_app: InstalledApp):\n        session = db.session()\n        app_model = installed_app.app_with_session(session=session)\n        if app_model is None:\n            raise AppUnavailableError()\n\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        args = MessageListQuery.model_validate(request.args.to_dict())\n\n        try:\n            pagination = MessageService.pagination_by_first_id(\n                app_model,\n                current_user,\n                args.conversation_id,\n                args.first_id or None,\n                args.limit,\n                session=session,\n            )\n            adapter = TypeAdapter(ExploreMessageListItem)\n            items = [\n                adapter.validate_python(MessageResponseSource(message, session=session), from_attributes=True)","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/explore/message.py#L64-L100","documentation":"HTTP 400 with error_code app_unavailable, raised by GET /console/explore/installed-apps/<id>/messages when installed_app.app_with_session(session) returns None. The InstalledApp exists but its related App cannot be loaded, so message pagination cannot proceed.","triggerScenarios":"GET messages for an installed app whose underlying App row is gone or unreadable. Triggered by the same conditions as error 743 (owner deleted/unpublished) but hit on the messages sub-resource.","commonSituations":"App owner deleted the app after another tenant installed it; relational mapping broken (app_id FK stale); the installed-app tile is still on the dashboard but the backing app is dead.","solutions":["Guard the UI: before opening messages, verify the app via GET /installed-apps/<id> and handle app_unavailable.","Have the owning tenant restore or republish the App.","Clean up installed_apps rows whose App is missing (admin sweep).","Show a 'no longer available' state and offer to remove the installed-app entry."],"exampleFix":"// before: open message list directly\nconst msgs = await get(`/installed-apps/${id}/messages`);\n\n// after: preflight the app and degrade gracefully\nconst app = await get(`/installed-apps/${id}`);\nif (!app) return showUnavailable();\nconst msgs = await get(`/installed-apps/${id}/messages`);","handlingStrategy":"validation","validationCode":"// Confirm the backing app is reachable before loading messages\nconst app = await get(`/console/explore/installed-apps/${id}`);\nif (!app) return; // backing App unavailable; do not call messages","typeGuard":"function appIsAvailable(app) {\n  return app !== null && app !== undefined;\n}","tryCatchPattern":"try {\n  return await get(`/console/explore/installed-apps/${id}/messages`);\n} catch (e) {\n  if (e.code === 'app_unavailable') {\n    showAppUnavailableState(id);\n    return null;\n  }\n  throw e;\n}","preventionTips":["Gate the messages view on a successful GET of the installed app.","Treat app_unavailable as terminal for that session and offer re-install.","Admins: remove installed_apps rows whose App is missing."],"tags":["rest-api","explore","app-unavailable","message","dify"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}