{"record":{"id":"341794fd115b5374","repo":"HKUDS/nanobot","slug":"host-is-0-0-0-0-all-interfaces-but-api-key-is-no","errorCode":null,"errorMessage":"host is 0.0.0.0 (all interfaces) but api_key is not set - set api.api_key to prevent unauthenticated access","messagePattern":"host is 0\\.0\\.0\\.0 \\(all interfaces\\) but api_key is not set - set api\\.api_key to prevent unauthenticated access","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"nanobot/config/schema.py","lineNumber":356,"sourceCode":"    interval_s: int = 30 * 60  # 30 minutes\n    keep_recent_messages: int = 8\n\n\nclass ApiConfig(Base):\n    \"\"\"OpenAI-compatible API server configuration.\"\"\"\n\n    host: str = \"127.0.0.1\"  # Safer default: local-only bind.\n    port: int = 8900\n    timeout: float = 120.0  # Per-request timeout in seconds.\n    api_key: str = Field(default=\"\", repr=False)\n\n    @model_validator(mode=\"after\")\n    def wildcard_host_requires_auth(self) -> \"ApiConfig\":\n        if self.host not in (\"0.0.0.0\", \"::\"):\n            return self\n        if self.api_key.strip():\n            return self\n        raise ValueError(\n            \"host is 0.0.0.0 (all interfaces) but api_key is not set \"\n            \"- set api.api_key to prevent unauthenticated access\"\n        )\n\n\nclass GatewayConfig(Base):\n    \"\"\"Gateway/server configuration.\"\"\"\n\n    host: str = \"127.0.0.1\"  # Safer default: local-only bind.\n    port: int = 18790\n    restart_mode: Literal[\"auto\", \"exec\", \"spawn\", \"exit\"] = \"auto\"\n    heartbeat: HeartbeatConfig = Field(default_factory=HeartbeatConfig)\n\n\nclass MCPServerConfig(Base):\n    \"\"\"MCP server connection configuration (stdio or HTTP).\"\"\"\n\n    type: Literal[\"stdio\", \"sse\", \"streamableHttp\"] | None = None  # auto-detected if omitted","sourceCodeStart":338,"sourceCodeEnd":374,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/config/schema.py#L338-L374","documentation":"Error \"host is 0.0.0.0 (all interfaces) but api_key is not set - set api.api_key to prevent unauthenticated access\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/config/schema.py:356 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"}