{"record":{"id":"cf731cdbb47a56c4","repo":"bytedance/deer-flow","slug":"failed-to-get-lark-integration-status","errorCode":null,"errorMessage":"Failed to get Lark integration status.","messagePattern":"Failed to get Lark integration status\\.","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"backend/app/gateway/routers/integrations.py","lineNumber":266,"sourceCode":"    )\n\n\ndef _auth_complete_to_response(result: LarkAuthCompleteResult, *, include_host_paths: bool = True) -> LarkAuthCompleteResponse:\n    return LarkAuthCompleteResponse(\n        success=result.success,\n        message=result.message,\n        status=_status_to_response(result.status, include_host_paths=include_host_paths),\n    )\n\n\n@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.\")","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/app/gateway/routers/integrations.py#L248-L284","documentation":"Raised by GET /integrations/lark/status with status 500 when get_lark_integration_status(...) raises an unexpected exception (run in a thread via asyncio.to_thread with check_latest and check_runtime enabled). The real cause is logged with traceback ('Failed to get Lark integration status'); the 500 is a generic catch-all for probe failures such as filesystem errors or network checks to Lark/Feishu APIs.","triggerScenarios":"The status probe hitting the Lark open platform API while egress is blocked; missing/corrupt skill-pack files under .deer-flow/integrations; permission errors reading the integration directory; unexpected payload shapes from Lark endpoints breaking the checker.","commonSituations":"Air-gapped or proxied environments where check_latest (version check) can't reach the internet; partially-installed or manually-edited integration skill packs; OS user lacking read permissions on the integrations directory.","solutions":["Read the Gateway log line 'Failed to get Lark integration status: ...' — the chained exception identifies the failing check.","Verify the integrations directory (.deer-flow/integrations/skills/...) is present, complete, and readable by the Gateway user.","If outbound network is restricted, allow or accept degradation of the latest-version/runtime checks rather than relying on this endpoint."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { status = await getLarkStatus(); } catch (e) { if (e.status === 500) { console.warn('Lark status probe failed — see gateway logs'); status = { available: false, degraded: true }; } else throw e; }","preventionTips":["Keep the integrations directory complete and readable","Ensure egress to Lark APIs or accept degraded status checks","Correlate with the 'Failed to get Lark integration status' log line for the root cause"],"tags":["http-500","integrations","lark","feishu","status-check"],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}