{"record":{"id":"cd9d272f3b0decf1","repo":"bytedance/deer-flow","slug":"honcho-request-failed-post-path-exc","errorCode":null,"errorMessage":"Honcho request failed: POST {path}: {exc}","messagePattern":"Honcho request failed: POST (.+?): (.+?)","errorType":"http","errorClass":"HonchoRequestError","httpStatus":null,"severity":"error","filePath":"backend/packages/harness/deerflow/agents/memory/backends/honcho/client.py","lineNumber":43,"sourceCode":"        headers = {\"Content-Type\": \"application/json\"}\n        if config.api_key:\n            headers[\"Authorization\"] = f\"Bearer {config.api_key}\"\n        self._http = httpx.Client(\n            base_url=config.base_url,\n            headers=headers,\n            timeout=httpx.Timeout(config.timeout_seconds, connect=config.connect_timeout_seconds),\n            transport=transport,\n        )\n\n    def close(self) -> None:\n        self._http.close()\n\n    def _post(self, path: str, payload: Any) -> Any:\n        try:\n            response = self._http.post(path, json=payload)\n            response.raise_for_status()\n        except httpx.HTTPError as exc:\n            raise HonchoRequestError(f\"Honcho request failed: POST {path}: {exc}\") from exc\n        if response.content:\n            try:\n                return response.json()\n            except ValueError as exc:\n                raise HonchoRequestError(f\"Honcho returned non-JSON response: POST {path}: {exc}\") from exc\n        return None\n\n    def get_or_create_peer(self, workspace: str, peer_id: str) -> None:\n        self._post(f\"/v3/workspaces/{workspace}/peers\", {\"id\": peer_id})\n\n    def get_or_create_session(self, workspace: str, session_id: str) -> None:\n        self._post(f\"/v3/workspaces/{workspace}/sessions\", {\"id\": session_id})\n\n    def set_session_peers(self, workspace: str, session_id: str, peer_ids: list[str]) -> None:\n        self._post(f\"/v3/workspaces/{workspace}/sessions/{session_id}/peers\", {peer_id: {} for peer_id in peer_ids})\n\n    def add_messages(self, workspace: str, session_id: str, messages: list[dict[str, str]]) -> None:\n        self._post(f\"/v3/workspaces/{workspace}/sessions/{session_id}/messages\", {\"messages\": messages})","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/packages/harness/deerflow/agents/memory/backends/honcho/client.py#L25-L61","documentation":"Honcho memory backend HTTP client wraps every httpx.HTTPError from a POST (connect failure, timeout, DNS error, 4xx/5xx via raise_for_status) in HonchoRequestError with the path and underlying exception. It is the single failure type for all Honcho REST calls (peer/session creation, message ingestion, query).","triggerScenarios":"Honcho base URL wrong or unreachable (connection refused), timeouts on slow queries, expired/invalid API key returning 401/403, workspace id returning 404, or the Honcho service being down.","commonSituations":"Wrong HONCHO_BASE_URL in env, missing API key header, local Honcho container not started, transient network blips, or rate limiting (429).","solutions":["Verify the Honcho service URL and reachability (curl the base URL from the Gateway host)","Check the API key/auth headers are set and valid (401/403 in the chained exception)","Retry with backoff for transient 5xx/timeouts; the client does not retry internally","Raise config timeout_seconds / connect_timeout_seconds if timeouts recur"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"def honcho_reachable(base_url: str, timeout: float = 3.0) -> bool:\n    try:\n        httpx.get(base_url, timeout=timeout)\n        return True\n    except httpx.HTTPError:\n        return False","typeGuard":null,"tryCatchPattern":"from deerflow.agents.memory.backends.honcho.client import HonchoRequestError\n\nfor attempt in range(3):\n    try:\n        client.add_messages(workspace, session_id, messages)\n        break\n    except HonchoRequestError as e:\n        if attempt == 2 or \"401\" in str(e) or \"403\" in str(e):\n            raise\n        time.sleep(0.5 * (2 ** attempt))","preventionTips":["Verify HONCHO base URL and API key in env before starting the Gateway","Distinguish auth errors (do not retry) from 5xx/timeouts (retry with backoff)","Set explicit timeout_seconds so slow queries fail fast instead of hanging"],"tags":["memory","honcho","network","http","configuration"],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}