{"record":{"id":"894bb4c2d2eca988","repo":"pathwaycom/pathway","slug":"milvus-lite-failed-to-start-a-local-server-for-u","errorCode":null,"errorMessage":"milvus-lite failed to start a local server for: {uri}","messagePattern":"milvus-lite failed to start a local server for: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/milvus/__init__.py","lineNumber":128,"sourceCode":"    When the URI is a local ``.db`` file, pymilvus starts a milvus-lite\n    server and rewrites the URI to a Unix-domain-socket path\n    (``unix:/path/to/sock``).  In 2.6.x the socket address is stored in\n    ``ConnectionConfig.address`` but is never forwarded to ``GrpcHandler``,\n    so ``GrpcHandler._address`` ends up as an empty string and the\n    connection hangs.  Passing ``address=`` as an explicit keyword argument\n    causes it to flow through ``handler_kwargs`` directly into\n    ``GrpcHandler.__init__``, where ``kwargs.get(\"address\")`` picks it up.\n\n    A freshly started local server may not be accepting connections yet, so the\n    client is created through :func:`_connect_with_retry`.\n    \"\"\"\n    if uri.endswith(\".db\"):\n        with optional_imports(\"milvus\"):\n            from milvus_lite.server_manager import server_manager_instance\n\n            uds_uri = server_manager_instance.start_and_get_uri(uri)\n            if uds_uri is None:\n                raise RuntimeError(\n                    f\"milvus-lite failed to start a local server for: {uri}\"\n                )\n            return _connect_with_retry(MilvusClient, uds_uri)\n\n    return _connect_with_retry(MilvusClient, uri)\n\n\n@check_arg_types\n@trace_user_frame\ndef write(\n    table: Table,\n    uri: str,\n    collection_name: str,\n    *,\n    primary_key: ColumnReference,\n    batch_size: int = 256,\n    name: str | None = None,\n    sort_by: Iterable[ColumnReference] | None = None,","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/milvus/__init__.py#L110-L146","documentation":"For URIs ending in .db, pw.io.milvus.write uses milvus-lite's server_manager to start an embedded local server and obtain a UDS URI. If start_and_get_uri returns None — meaning milvus-lite could not bring up the local server for that path — the connector raises RuntimeError naming the URI.","triggerScenarios":"Calling pw.io.milvus.write(table, uri='./milvus.db', ...) when milvus-lite fails to launch: unwritable directory, corrupt existing .db file, unsupported platform (milvus-lite has no builds for some OSes/architectures), or resource limits.","commonSituations":"First run in a container without write permission to the .db path; milvus-lite not supporting the platform (e.g. Windows natively, some ARM images); leftover corrupt database file from a crashed run.","solutions":["Check the directory of the .db path exists and is writable by the process","Delete or move the suspect existing .db file and retry — a corrupt file prevents server start","Verify milvus-lite supports your platform; otherwise point uri at a running Milvus server (http://localhost:19530) or use Docker","Reinstall the milvus package (pip install -U pymilvus) so the bundled milvus-lite binary matches your platform"],"exampleFix":"# before\npw.io.milvus.write(t, uri=\"./data/milvus.db\", collection_name=\"docs\", primary_key=t.id)\n\n# after (data dir missing)\nimport os; os.makedirs(\"data\", exist_ok=True)\npw.io.milvus.write(t, uri=\"./data/milvus.db\", collection_name=\"docs\", primary_key=t.id)","handlingStrategy":"retry","validationCode":"from pathlib import Path\n\ndef milvus_db_ready(uri: str) -> bool:\n    if not uri.endswith(\".db\"):\n        return True\n    p = Path(uri)\n    return p.parent.exists() and p.parent.is_dir() and os.access(p.parent, os.W_OK)","typeGuard":null,"tryCatchPattern":"for attempt in range(3):\n    try:\n        client = _make_client(MilvusClient, uri)\n        break\n    except RuntimeError as e:\n        if \"milvus-lite failed to start\" not in str(e) or attempt == 2:\n            raise\n        time.sleep(2 ** attempt)","preventionTips":["Ensure the .db parent directory exists and is writable before pipeline start","Delete corrupt .db files from crashed runs instead of reusing them","On unsupported platforms, run Milvus in Docker and use an http:// URI rather than milvus-lite"],"tags":["milvus","milvus-lite","runtime","embedded-server","environment"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}