haystack-core-integrations
haystack-core-integrations copied to clipboard
Weaviate: Cannot initialize WeaviateDocumentStore due to connection issue
Describe the bug
This error is returned when I tried to follow the official documentation to connect to Weaviate managed cluster. Note: The documentation also has an problem, where url is not specified upon initialization of WeaviateDocumentStore
My code:
from haystack.utils.auth import Secret
from haystack_integrations.document_stores.weaviate import WeaviateDocumentStore, AuthApiKey
auth_client_secret = AuthApiKey(Secret.from_token("MY_WEAVIATE_API_KEY"))
document_store = WeaviateDocumentStore(
url='WEAVIATE_CLUSTER_URL',
auth_client_secret=auth_client_secret
)
Error:
_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
...
- gRPC is not enabled or incorrectly configured on the server with version v1.24.8 or the client
- 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`
To Reproduce Refer to the above
How this issue can be resolved Update the self._client as below
self._client = weaviate.connect_to_wcs(
cluster_url=url,
auth_credentials=auth_client_secret)
Then the WeaviateDocumentStore can be initialized as below
document_store = WeaviateDocumentStore(
url="WEAVIATE_CLUSTER_URL",
auth_client_secret=weaviate.auth.AuthApiKey('WEAVIATE_API_KEY')
)
Describe your environment (please complete the following information):
- OS: Windows
- Haystack version: 2.0.1
- Integration version: 2.0.0
Unfortunately, I found the same bug while working on other stuff.
Doing something like this can fix the specific bug.
I just ran into this issue as well. Any temporary workarounds?
There is an open PR with a possible fix: #624