{"record":{"id":"8480848b4fd9ca44","repo":"HKUDS/nanobot","slug":"could-not-start-the-local-gateway-result-message","errorCode":null,"errorMessage":"could not start the local gateway ({result.message}); logs: {result.status.log_path}","messagePattern":"could not start the local gateway \\((.+?)\\); logs: (.+?)","errorType":"exception","errorClass":"TuiUnavailableError","httpStatus":null,"severity":"error","filePath":"nanobot/cli/tui_launcher.py","lineNumber":439,"sourceCode":"        if status.running:\n            if status.port not in {None, config.gateway.port}:\n                raise TuiUnavailableError(\n                    \"the matching gateway instance is running on a different port; \"\n                    \"restart it or use `nanobot agent --classic`\"\n                )\n            if endpoint_reachable or not wait_until_ready:\n                return _GatewayHandle(base_url=base_url, lease=lease)\n        elif endpoint_reachable:\n            raise TuiUnavailableError(\n                \"the configured gateway port belongs to a different nanobot instance; \"\n                \"stop that instance or use `nanobot agent --classic`\"\n            )\n\n        result = lease.ensure_on_demand_gateway(\n            instance.start_options(port=config.gateway.port)\n        )\n        if not result.ok and result.message != \"gateway_already_running\":\n            raise TuiUnavailableError(\n                f\"could not start the local gateway ({result.message}); \"\n                f\"logs: {result.status.log_path}\"\n            )\n\n        if not wait_until_ready:\n            return _GatewayHandle(base_url=base_url, lease=lease)\n\n        deadline = time.monotonic() + 20\n        while time.monotonic() < deadline:\n            if _webui_endpoint_reachable(base_url):\n                current = runtime.status()\n                if current.running and current.port in {None, config.gateway.port}:\n                    return _GatewayHandle(base_url=base_url, lease=lease)\n                break\n            if not runtime.status().running and not _gateway_health_ready(\n                config.gateway.host,\n                config.gateway.port,\n            ):","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/cli/tui_launcher.py#L421-L457","documentation":"Error \"could not start the local gateway ({result.message}); logs: {result.status.log_path}\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/cli/tui_launcher.py:439 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"}