Hello, preciously I setup an Weaviate cluster (on AWS), e.g. accessible via https://sst-weaviate.ml-stage.motional.com
when migrating v3 to v4, which proper connection method I should choose?
Previously for v3, the following method works properly
def get_weaviate_client_v3() -> weaviate.Client:
cfg = OmegaConf.load(CONFIG_PATH)
auth_client_secret = hydra.utils.instantiate(cfg.weaviate_client_cfg.auth_client_secret)
return weaviate.Client(
url=cfg.weaviate_client_cfg.weaviate_server_url,
auth_client_secret=auth_client_secret,
timeout_config=(10, 300),
)
but for V4, where I choose connect_to_local()
def get_weaviate_client_v4():
cfg = OmegaConf.load(CONFIG_PATH)
auth_client_secret = weaviate.classes.init.Auth.api_key(cfg.weaviate_client_cfg.auth_client_secret.api_key)
return weaviate.connect_to_local(
host=cfg.weaviate_client_cfg.weaviate_server_url,
auth_credentials=auth_client_secret,
)
But this v4 connection abovr would throw the following error:
“/opt/homebrew/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/socket.py”, line 962, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno 8] nodename nor servname provided, or not known
…
File “/Users/tao.feng/projects/weaviate-pilot/src/Common.py”, line 55, in get_weaviate_client_v4
return weaviate.connect_to_local(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/tao.feng/projects/py311/lib/python3.11/site-packages/weaviate/connect/helpers.py”, line 157, in connect_to_local
return __connect(client)
^^^^^^^^^^^^^^^^^
File “/Users/tao.feng/projects/py311/lib/python3.11/site-packages/weaviate/connect/helpers.py”, line 345, in __connect
raise e
File “/Users/tao.feng/projects/py311/lib/python3.11/site-packages/weaviate/connect/helpers.py”, line 341, in __connect
client.connect()
File “/Users/tao.feng/projects/py311/lib/python3.11/site-packages/weaviate/client.py”, line 282, in connect
self._connection.connect(self.__skip_init_checks)
File “/Users/tao.feng/projects/py311/lib/python3.11/site-packages/weaviate/connect/v4.py”, line 655, in connect
super().connect(skip_init_checks)
File “/Users/tao.feng/projects/py311/lib/python3.11/site-packages/weaviate/connect/v4.py”, line 143, in connect
raise WeaviateStartUpError(f"Could not connect to Weaviate:{e}.") from e
weaviate.exceptions.WeaviateStartUpError: Could not connect to Weaviate:Connection to Weaviate failed. .
Reading weaviate’s migration document, it requires a port for gRPC is open to Weaviate, but since my weaviate cluster is deployed through helm chart, I assume this should already be handled directly, right?
image source:
image: ‘cr.weaviate.io/semitechnologies/weaviate:1.24.1’
Any suggestion on resolving this issue?
Server Setup Information
- Weaviate Server Version: 1.24.1/helm chart 16.8.4
- Deployment Method: helm chart / K8s
- Multi Node? Number of Running Nodes: 2
- Client Language and Version: Python 3.10 / weaviate-client 4.5.1