{"record":{"id":"c4de19f7ae9d31c1","repo":"HKUDS/nanobot","slug":"unable-to-start-feishu-lark-connection-exc","errorCode":null,"errorMessage":"Unable to start Feishu/Lark connection: {exc}","messagePattern":"Unable to start Feishu/Lark connection: (.+?)","errorType":"http","errorClass":"ChannelConnectError","httpStatus":502,"severity":"error","filePath":"nanobot/channels/feishu/connect.py","lineNumber":82,"sourceCode":"        if action == \"cancel\":\n            return await asyncio.to_thread(self.cancel, session_id)\n        raise ChannelConnectError(f\"unsupported Feishu connect action: {action}\", status=404)\n\n    def start(\n        self,\n        *,\n        domain: str = \"feishu\",\n        instance_id: str = DEFAULT_INSTANCE_ID,\n        mode: str = \"replace\",\n    ) -> dict[str, Any]:\n        domain = _normalize_domain(domain)\n        instance_id = _resolve_instance_id(instance_id, mode)\n        self._cleanup()\n        try:\n            feishu._init_registration(domain)\n            begin = feishu._begin_registration(domain)\n        except (RuntimeError, OSError, json.JSONDecodeError, httpx.HTTPError) as exc:\n            raise ChannelConnectError(\n                f\"Unable to start Feishu/Lark connection: {exc}\",\n                status=502,\n            ) from exc\n\n        session_id = secrets.token_urlsafe(18)\n        now_wall = time.time()\n        now = time.monotonic()\n        expire_in = int(begin[\"expire_in\"])\n        interval = max(2, int(begin[\"interval\"]))\n        session = FeishuConnectSession(\n            id=session_id,\n            instance_id=instance_id,\n            instance_name=_default_instance_name(instance_id),\n            device_code=str(begin[\"device_code\"]),\n            qr_url=str(begin[\"qr_url\"]),\n            domain=domain,\n            interval=interval,\n            expire_in=expire_in,","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/channels/feishu/connect.py#L64-L100","documentation":"Error \"Unable to start Feishu/Lark connection: {exc}\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/channels/feishu/connect.py:82 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}