{"record":{"id":"c9f66df3d7d3f4a8","repo":"langgenius/dify","slug":"internal-server-error-c9f66d","errorCode":null,"errorMessage":"Internal Server Error","messagePattern":"Internal Server Error","errorType":"http","errorClass":"InternalServerError","httpStatus":500,"severity":"error","filePath":"api/controllers/console/app/completion.py","lineNumber":202,"sourceCode":"            raise NotFound(\"Conversation Not Exists.\")\n        except services.errors.conversation.ConversationCompletedError:\n            raise ConversationCompletedError()\n        except services.errors.app_model_config.AppModelConfigBrokenError:\n            logger.exception(\"App model config broken.\")\n            raise AppUnavailableError()\n        except ProviderTokenNotInitError as ex:\n            raise ProviderNotInitializeError(ex.description)\n        except QuotaExceededError:\n            raise ProviderQuotaExceededError()\n        except ModelCurrentlyNotSupportError:\n            raise ProviderModelCurrentlyNotSupportError()\n        except InvokeError as e:\n            raise CompletionRequestError(e.description)\n        except ValueError as e:\n            raise e\n        except Exception as e:\n            logger.exception(\"internal server error.\")\n            raise InternalServerError()\n\n\n@console_ns.route(\"/apps/<uuid:app_id>/completion-messages/<string:task_id>/stop\")\nclass CompletionMessageStopApi(Resource):\n    @console_ns.doc(\"stop_completion_message\")\n    @console_ns.doc(description=\"Stop a running completion message generation\")\n    @console_ns.doc(params={\"app_id\": \"Application ID\", \"task_id\": \"Task ID to stop\"})\n    @console_ns.response(200, \"Task stopped successfully\", console_ns.models[SimpleResultResponse.__name__])\n    @setup_required\n    @login_required\n    @account_initialization_required\n    @with_current_user_id\n    @get_app_model(mode=AppMode.COMPLETION)\n    def post(self, current_user_id: str, app_model: App, task_id: str):\n\n        AppTaskService.stop_task(\n            task_id=task_id,\n            invoke_from=InvokeFrom.DEBUGGER,","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/app/completion.py#L184-L220","documentation":"Error \"Internal Server Error\" thrown in langgenius/dify.","triggerScenarios":"Thrown at api/controllers/console/app/completion.py:202 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}