{"record":{"id":"0c8b2c5f32516cc5","repo":"Significant-Gravitas/AutoGPT","slug":"sharing-is-not-configured-on-this-deployment","errorCode":null,"errorMessage":"Sharing is not configured on this deployment","messagePattern":"Sharing is not configured on this deployment","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/chat/share.py","lineNumber":126,"sourceCode":"    user_id: Annotated[str, Security(auth.get_user_id)],\n    body: EnableShareRequest = Body(default_factory=EnableShareRequest),\n) -> ShareResponse:\n    \"\"\"Enable sharing for a chat session.\n\n    Flag-gated: refuses with 403 when ``chat-sharing`` is off so a stale\n    frontend cannot enable shares post-rollback.\n    \"\"\"\n    if not await is_feature_enabled(Flag.CHAT_SHARING, user_id):\n        raise HTTPException(status_code=403, detail=\"Chat sharing is not enabled\")\n\n    base_url = settings.config.frontend_base_url\n    if not base_url:\n        # Fail fast rather than handing the user a localhost URL that\n        # only works on the backend host.  This catches deployment\n        # misconfigurations at share-enable time instead of silently\n        # shipping broken share URLs to end users.\n        logger.error(\"frontend_base_url is not configured; refusing to enable share\")\n        raise HTTPException(\n            status_code=500, detail=\"Sharing is not configured on this deployment\"\n        )\n\n    try:\n        share_token = await share_db.enable_chat_session_share(\n            session_id=session_id,\n            user_id=user_id,\n            auto_share_executions=body.auto_share_executions,\n        )\n    except ValueError as exc:\n        raise HTTPException(status_code=404, detail=str(exc))\n\n    return ShareResponse(\n        share_url=f\"{base_url}/share/chat/{share_token}\",\n        share_token=share_token,\n    )\n\n","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/chat/share.py#L108-L144","documentation":"HTTP 500 from the share-enable endpoint (share.py:126). Share links are built from settings.config.frontend_base_url; when it is empty the server refuses to enable sharing rather than mint URLs pointing at localhost (which would only resolve on the backend host). The code logs 'frontend_base_url is not configured; refusing to enable share' and returns 500 — a deliberate deployment-misconfiguration tripwire fired at share-enable time.","triggerScenarios":"Enabling chat sharing on a deployment where FRONTEND_BASE_URL is unset/empty in backend settings — common in fresh local setups, misconfigured staging, or backend-only containers.","commonSituations":"New environment brought up without FRONTEND_BASE_URL in .env; docker-compose service missing the variable; renaming domains and forgetting the backend copy of the setting.","solutions":["Set FRONTEND_BASE_URL (e.g. https://app.example.com) in the backend environment/.env and restart the backend.","Verify with a follow-up request — once set, share tokens resolve to correct public URLs.","Deployment checklists: include frontend_base_url in environment validation so misconfigs surface at boot, not at share time.","Client-side: on 500 with this detail, surface 'sharing unavailable on this deployment' instead of a generic error."],"exampleFix":"# before\n# backend/.env missing the var -> share enable returns 500\n\n# after\nFRONTEND_BASE_URL=https://app.example.com","handlingStrategy":"validation","validationCode":"// before enabling shares, confirm the deployment exposes a public frontend URL\nconst cfg = await getDeploymentConfig();\nif (!cfg.frontend_base_url) {\n  showNotice('Sharing is unavailable on this deployment');\n} else {\n  await post(`/chat/sessions/${id}/share/enable`);\n}","typeGuard":"function sharingConfigured(frontendBaseUrl: string | undefined | null): boolean {\n  return typeof frontendBaseUrl === 'string' && frontendBaseUrl.length > 0;\n}","tryCatchPattern":"try { await post(`/chat/sessions/${id}/share/enable`); } catch (e) { if (e.status === 500 && /not configured/.test(e.detail)) { showSharingUnavailable(); return; } throw e; }","preventionTips":["Set FRONTEND_BASE_URL in every backend environment (dev, staging, prod) as part of the setup checklist","Validate frontend_base_url at backend boot so misconfigs surface before users do","Client-side: map this 500 to a friendly 'sharing unavailable' message, never auto-retry"],"tags":["http","config","deployment","sharing","fastapi"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}