{"record":{"id":"d1a655fd018e1f3b","repo":"langgenius/dify","slug":"trial-app-feature-is-not-enabled","errorCode":null,"errorMessage":"Trial app feature is not enabled.","messagePattern":"Trial app feature is not enabled\\.","errorType":"http","errorClass":null,"httpStatus":403,"severity":"warning","filePath":"api/controllers/console/explore/wraps.py","lineNumber":111,"sourceCode":"            )\n            if account_trial_app_record:\n                if account_trial_app_record.count >= trial_app.trial_limit:\n                    raise TrialAppLimitExceeded()\n\n            return view(app, *args, **kwargs)\n\n        return decorated\n\n    if view:\n        return decorator(view)\n    return decorator\n\n\ndef trial_feature_enable[**P, R](view: Callable[P, R]):\n    @wraps(view)\n    def decorated(*args: P.args, **kwargs: P.kwargs):\n        if not RecommendedAppService.is_trial_app_enabled():\n            abort(403, \"Trial app feature is not enabled.\")\n        return view(*args, **kwargs)\n\n    return decorated\n\n\nclass InstalledAppResource(Resource):\n    # must be reversed if there are multiple decorators\n\n    method_decorators = [\n        user_allowed_to_access_app,\n        installed_app_required,\n        account_initialization_required,\n        login_required,\n    ]\n\n\nclass TrialAppResource(Resource):\n    # must be reversed if there are multiple decorators","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/explore/wraps.py#L93-L129","documentation":"HTTP 403 from the `trial_feature_enable` decorator (controllers/console/explore/wraps.py). It calls `RecommendedAppService.is_trial_app_enabled()`, which returns True only when `DEPLOYMENT_EDITION == CLOUD` AND `ENABLE_TRIAL_APP` is set. On any other deployment, every route wrapped with `@trial_feature_enable` aborts with `Trial app feature is not enabled.`","triggerScenarios":"Hitting any explore/trial-app route (e.g. installing or running a trial app) on a deployment where `DEPLOYMENT_EDITION != CLOUD` or where cloud is set but `ENABLE_TRIAL_APP` is false/missing.","commonSituations":"Self-hosted or enterprise deployment trying to use trial apps; cloud deployment with `ENABLE_TRIAL_APP` not toggled on; feature flag flipped off mid-session.","solutions":["If on cloud, set `ENABLE_TRIAL_APP=true` in the deployment config.","If self-hosted/enterprise, do not expose trial-app UI — the feature is cloud-only by design.","Gate the trial-app UI client-side on the `/system-features` flag so users never hit the 403.","Confirm `DEPLOYMENT_EDITION` is correctly set to `CLOUD` in the running config."],"exampleFix":"# before\nENABLE_TRIAL_APP=false\n# after (cloud only)\nENABLE_TRIAL_APP=true","handlingStrategy":"validation","validationCode":"from configs import dify_config\nfrom enums import DeploymentEdition\n\ndef trial_enabled() -> bool:\n    return (\n        dify_config.DEPLOYMENT_EDITION == DeploymentEdition.CLOUD\n        and bool(dify_config.ENABLE_TRIAL_APP)\n    )\n\nif not trial_enabled():\n    # do not call trial-app endpoints\n    ...","typeGuard":"def is_trial_app_available(features) -> bool:\n    return bool(getattr(features, \"enable_trial_app\", False))","tryCatchPattern":"try:\n    resp = client.post(\"/explore/trial-apps/...\", ...)\nexcept HTTPError as err:\n    if err.response.status_code == 403:\n        # trial app disabled — hide trial UI\n        ...\n    raise","preventionTips":["Hide trial-app UI on non-cloud deployments.","On cloud, set ENABLE_TRIAL_APP=true if the feature is intended.","Gate trial-app affordances on /system-features.","Confirm DEPLOYMENT_EDITION is correctly set to CLOUD."],"tags":["feature-flag","cloud-only","trial-app","http-403"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}