{"record":{"id":"d31489fd6e550913","repo":"langflow-ai/langflow","slug":"this-endpoint-is-not-available","errorCode":null,"errorMessage":"This endpoint is not available","messagePattern":"This endpoint is not available","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"src/backend/base/langflow/agentic/api/deps.py","lineNumber":25,"sourceCode":"\nfrom fastapi import HTTPException, status\nfrom lfx.services.deps import get_settings_service\n\n\ndef require_agentic_experience() -> None:\n    \"\"\"Backend gate for the agentic assistant's code-generating/executing endpoints.\n\n    SECURITY: the assistant generates and EXECUTES component code in-process\n    (langflow.agentic.helpers.validation.validate_component_runtime and the user-components\n    overlay). ``agentic_experience`` is on by default (the Assistant is Langflow's entry-point\n    experience); this gate 404s the codegen endpoints when an operator opts out with\n    LANGFLOW_AGENTIC_EXPERIENCE=false, matching the per-endpoint precedent in\n    api/v1/endpoints.py. Execution entry points are additionally guarded by\n    ``allow_custom_components``. The read-only ``/agentic/check-config`` probe is intentionally\n    NOT gated so non-agentic deployments can still query provider configuration.\n    \"\"\"\n    if not get_settings_service().settings.agentic_experience:\n        raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=\"This endpoint is not available\")\n","sourceCodeStart":7,"sourceCodeEnd":26,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/agentic/api/deps.py#L7-L26","documentation":"The agentic assistant's code-generating/executing endpoints are gated by a dependency that checks settings.agentic_experience. When an operator opts out with LANGFLOW_AGENTIC_EXPERIENCE=false, the gate raises HTTP 404 ('This endpoint is not available') instead of 403 so clients cannot distinguish 'disabled' from 'does not exist'. Only the codegen endpoints are gated; the read-only /agentic/check-config probe stays open by design.","triggerScenarios":"Calling any POST /api/v1/agentic/... codegen or execution endpoint while LANGFLOW_AGENTIC_EXPERIENCE=false; a frontend or script that assumes the Assistant API is always present.","commonSituations":"Hardened deployments disabling the in-process code-executing assistant; a stale client hitting a deployment that turned the feature off; execution endpoints additionally require allow_custom_components=true.","solutions":["Re-enable the feature if intended: set LANGFLOW_AGENTIC_EXPERIENCE=true and restart.","If it must stay off, remove/feature-flag the client code that calls agentic codegen endpoints.","Probe capability first via GET /agentic/check-config (never gated) before invoking codegen endpoints.","For execution endpoints also confirm allow_custom_components is enabled."],"exampleFix":"# before: deployment runs with LANGFLOW_AGENTIC_EXPERIENCE=false\nPOST /api/v1/agentic/generate  # 404 This endpoint is not available\n# after\nLANGFLOW_AGENTIC_EXPERIENCE=true langflow run\nPOST /api/v1/agentic/generate  # 200","handlingStrategy":"validation","validationCode":"import requests\nr = requests.get(\"http://host/api/v1/agentic/check-config\", headers=headers)  # never gated\nr.raise_for_status()\nagentic_on = r.json().get(\"agentic_experience\", False)\nif not agentic_on:\n    skip_codegen_calls()","typeGuard":null,"tryCatchPattern":"resp = client.post(\"/api/v1/agentic/generate\", json=payload)\nif resp.status_code == 404 and resp.json().get(\"detail\") == \"This endpoint is not available\":\n    disable_assistant_ui()  # feature flag off, not a routing bug\nelse:\n    resp.raise_for_status()","preventionTips":["Gate client-side assistant UI on the /agentic/check-config probe.","Keep deployment env (LANGFLOW_AGENTIC_EXPERIENCE) documented alongside client feature flags.","Remember execution endpoints also need allow_custom_components=true."],"tags":["agentic","http-404","feature-flag","security","configuration"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}