{"record":{"id":"e90c72a6b6259c85","repo":"HKUDS/nanobot","slug":"napcat-action-action-failed-status-status-r-r","errorCode":null,"errorMessage":"napcat: action {action} failed status={status!r} retcode={retcode!r}","messagePattern":"napcat: action (.+?) failed status=(.+?) retcode=(.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"nanobot/channels/napcat/runtime.py","lineNumber":510,"sourceCode":"        action: str,\n        params: dict[str, Any],\n        timeout: float = _ACTION_TIMEOUT,\n    ) -> dict[str, Any]:\n        if self._ws is None:\n            raise RuntimeError(\"napcat: not connected\")\n        echo = uuid.uuid4().hex\n        loop = asyncio.get_running_loop()\n        fut: asyncio.Future[dict[str, Any]] = loop.create_future()\n        self._pending[echo] = fut\n        try:\n            await self._ws.send(\n                json.dumps({\"action\": action, \"params\": params, \"echo\": echo}, ensure_ascii=False)\n            )\n            resp = await asyncio.wait_for(fut, timeout=timeout)\n            status = resp.get(\"status\")\n            retcode = resp.get(\"retcode\")\n            if (status and status != \"ok\") or (retcode not in (None, 0)):\n                raise RuntimeError(\n                    f\"napcat: action {action} failed status={status!r} retcode={retcode!r}\"\n                )\n            return resp\n        finally:\n            self._pending.pop(echo, None)\n\n    # ------------------------------------------------------------------\n    # Image download\n    # ------------------------------------------------------------------\n\n    async def _download_image(self, info: dict[str, Any]) -> str | None:\n        url = info.get(\"url\")\n        if not isinstance(url, str):\n            return None\n        # logger.debug(\"napcat: downloading image from {}\", url)\n        if self._http is None:\n            return None\n        ok, err = validate_url_target(url)","sourceCodeStart":492,"sourceCodeEnd":528,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/channels/napcat/runtime.py#L492-L528","documentation":"Error \"napcat: action {action} failed status={status!r} retcode={retcode!r}\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/channels/napcat/runtime.py:510 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"}