{"record":{"id":"a27d7e53ba43d413","repo":"bytedance/deer-flow","slug":"str-e","errorCode":null,"errorMessage":"{str(e)}","messagePattern":"\\{str\\(e\\)\\}","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"backend/app/gateway/routers/integrations.py","lineNumber":277,"sourceCode":"@router.get(\"/lark/status\", response_model=LarkIntegrationStatusResponse, summary=\"Get Lark/Feishu Integration Status\")\nasync def get_lark_status(request: Request, config: AppConfig = Depends(get_config)) -> LarkIntegrationStatusResponse:\n    try:\n        status = await asyncio.to_thread(get_lark_integration_status, get_effective_user_id(), config, check_latest=True, check_runtime=True)\n        return _status_to_response(status, include_host_paths=await _is_admin_user(request))\n    except Exception as e:\n        logger.error(\"Failed to get Lark integration status: %s\", e, exc_info=True)\n        raise HTTPException(status_code=500, detail=\"Failed to get Lark integration status.\")\n\n\n@router.post(\"/lark/install\", response_model=LarkInstallResponse, summary=\"Install Lark/Feishu Skill Pack\")\nasync def install_lark(request: Request, config: AppConfig = Depends(get_config)) -> LarkInstallResponse:\n    await require_admin_user(request, detail=_ADMIN_REQUIRED_DETAIL)\n    try:\n        result = await asyncio.to_thread(install_lark_integration, get_effective_user_id(), config)\n        await refresh_skills_system_prompt_cache_async()\n        return _install_to_response(result)\n    except FileNotFoundError as e:\n        raise HTTPException(status_code=404, detail=str(e))\n    except ValueError as e:\n        raise HTTPException(status_code=400, detail=str(e))\n    except HTTPException:\n        raise\n    except Exception as e:\n        logger.error(\"Failed to install Lark integration: %s\", e, exc_info=True)\n        raise HTTPException(status_code=500, detail=\"Failed to install Lark integration.\")\n\n\n@router.post(\"/lark/config/start\", response_model=LarkConfigStartResponse, summary=\"Start Lark/Feishu App Configuration\")\nasync def start_lark_app_config(body: LarkConfigStartRequest) -> LarkConfigStartResponse:\n    try:\n        result = await asyncio.to_thread(\n            start_lark_config,\n            get_effective_user_id(),\n            brand=body.brand,\n        )\n        return _config_start_to_response(result)","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/app/gateway/routers/integrations.py#L259-L295","documentation":"Raised by POST /integrations/lark/install (admin-only) with status 404 when install_lark_integration raises FileNotFoundError. The integration installer couldn't locate a required file — typically the skill-pack source files or install manifest — so the message detail surfaces the missing path verbatim via str(e).","triggerScenarios":"Installing the Lark skill pack when the packaged skill files are absent (incomplete deployment, stripped container image); the installer's expected directory (e.g. the managed integrations path) doesn't exist because first-run initialization never happened; files deleted or moved by an operator.","commonSituations":"Slim Docker images that excluded the integration assets; cloning the repo without submodules/artifacts; manual cleanup of .deer-flow/ breaking expected paths; version mismatch between app code and shipped skill pack.","solutions":["Read the 404 detail — it names the exact missing file path.","Restore the missing asset: rebuild/re-pull the deployment image, re-run setup (make install / make config), or reinstall the skill pack sources.","Verify the directory the installer reads from exists and matches the version of the Gateway code."],"exampleFix":"# before\n# image built with integrations dir excluded\nPOST /api/integrations/lark/install -> 404 FileNotFoundError: /opt/deer-flow/.../lark-pack\n\n# after\ndocker compose build --no-cache gateway && docker compose up -d\nPOST /api/integrations/lark/install -> 200","handlingStrategy":"try-catch","validationCode":"# preflight: the installer's source assets exist\n stat /opt/deer-flow/backend/extensions/sources || echo 'integration sources missing — rebuild image'","typeGuard":null,"tryCatchPattern":"try { await installLark(); } catch (e) { if (e.status === 404) throw new Error(`Missing asset: ${e.detail} — rebuild/reinstall deployment`); throw e; }","preventionTips":["Build images with the integration assets included","Read the 404 detail — it names the exact missing path","Run make install/setup after cloning or upgrading"],"tags":["http-404","integrations","lark","install","missing-file"],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}