Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weaviate: cannot connect to WCS when the URL contains "weaviate.cloud" #1057

Closed
anakin87 opened this issue Sep 6, 2024 · 0 comments · Fixed by #1058
Closed

Weaviate: cannot connect to WCS when the URL contains "weaviate.cloud" #1057

anakin87 opened this issue Sep 6, 2024 · 0 comments · Fixed by #1058
Labels
bug Something isn't working integration:weaviate

Comments

@anakin87
Copy link
Member

anakin87 commented Sep 6, 2024

Describe the bug
I cannot connect to WCS when the URL contains "weaviate.cloud"

This part of code may be involved

if self._url and self._url.startswith("http") and self._url.endswith(".weaviate.network"):

To Reproduce

from haystack.utils.auth import Secret
from haystack_integrations.document_stores.weaviate import WeaviateDocumentStore, AuthApiKey
from haystack import Document

auth_client_secret = AuthApiKey(Secret.from_token("..."))

document_store = WeaviateDocumentStore(url="https://a1lsp92prd2qychjo7bbw.c0.us-west3.gcp.weaviate.cloud",
    auth_client_secret=auth_client_secret)

docs = [Document(content="text1", meta={"name": "doc1"}), Document(content="text2", meta={"name": "doc2"})]

document_store.write_documents(docs)

print(document_store.filter_documents())

Error:

Traceback (most recent call last):
  File "/home/anakin87/apps/experiments/weavtry/.venv/lib/python3.10/site-packages/weaviate/connect/v4.py", line 700, in _ping_grpc
    res: health_pb2.HealthCheckResponse = await self._grpc_channel.unary_unary(
  File "/home/anakin87/apps/experiments/weavtry/.venv/lib/python3.10/site-packages/grpc/aio/_call.py", line 327, in __await__
    raise _create_rpc_error(
grpc.aio._call.AioRpcError: <AioRpcError of RPC that terminated with:
        status = StatusCode.DEADLINE_EXCEEDED
        details = "Deadline Exceeded"
        debug_error_string = "UNKNOWN:Error received from peer  {grpc_message:"Deadline Exceeded", grpc_status:4, created_time:"2024-09-06T12:22:50.133038374-07:00"}"
>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/anakin87/apps/experiments/weavtry/wcs.py", line 17, in <module>
    document_store.write_documents(docs)
  File "/home/anakin87/apps/experiments/weavtry/.venv/lib/python3.10/site-packages/haystack_integrations/document_stores/weaviate/document_store.py", line 485, in write_documents
    return self._batch_write(documents)
  File "/home/anakin87/apps/experiments/weavtry/.venv/lib/python3.10/site-packages/haystack_integrations/document_stores/weaviate/document_store.py", line 407, in _batch_write
    with self.client.batch.dynamic() as batch:
  File "/home/anakin87/apps/experiments/weavtry/.venv/lib/python3.10/site-packages/haystack_integrations/document_stores/weaviate/document_store.py", line 204, in client
    self._client.connect()
  File "/home/anakin87/apps/experiments/weavtry/.venv/lib/python3.10/site-packages/weaviate/syncify.py", line 23, in sync_method
    return _EventLoopSingleton.get_instance().run_until_complete(
  File "/home/anakin87/apps/experiments/weavtry/.venv/lib/python3.10/site-packages/weaviate/event_loop.py", line 40, in run_until_complete
    return fut.result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 458, in result
    return self.__get_result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/home/anakin87/apps/experiments/weavtry/.venv/lib/python3.10/site-packages/weaviate/client_base.py", line 152, in connect
    await self._connection.connect(self._skip_init_checks)
  File "/home/anakin87/apps/experiments/weavtry/.venv/lib/python3.10/site-packages/weaviate/connect/v4.py", line 181, in connect
    raise e
  File "/home/anakin87/apps/experiments/weavtry/.venv/lib/python3.10/site-packages/weaviate/connect/v4.py", line 178, in connect
    await asyncio.gather(self._ping_grpc(), self.__check_package_version())
  File "/home/anakin87/apps/experiments/weavtry/.venv/lib/python3.10/site-packages/weaviate/connect/v4.py", line 710, in _ping_grpc
    raise WeaviateGRPCUnavailableError(
weaviate.exceptions.WeaviateGRPCUnavailableError: 
Weaviate v1.26.1 makes use of a high-speed gRPC API as well as a REST API.
Unfortunately, the gRPC health check against Weaviate could not be completed.

This error could be due to one of several reasons:
- The gRPC traffic at the specified port is blocked by a firewall.
- gRPC is not enabled or incorrectly configured on the server or the client.
    - Please check that the server address and port (a1lsp92prd2qychjo7bbw.c0.us-west3.gcp.weaviate.cloud:50051) are correct.
- your connection is unstable or has a high latency. In this case you can:
    - increase init-timeout in `weaviate.connect_to_local(additional_config=wvc.init.AdditionalConfig(timeout=wvc.init.Timeout(init=X)))`
    - disable startup checks by connecting using `skip_init_checks=True`

Describe your environment (please complete the following information):

  • Haystack version: 2.5.0
  • Integration version: 2.2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working integration:weaviate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant