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 initialize WeaviateDocumentStore due to connection issue #662

Closed
yip-kl opened this issue Apr 16, 2024 · 3 comments · Fixed by #624
Closed

Weaviate: Cannot initialize WeaviateDocumentStore due to connection issue #662

yip-kl opened this issue Apr 16, 2024 · 3 comments · Fixed by #624
Assignees
Labels
bug Something isn't working integration:weaviate P1

Comments

@yip-kl
Copy link

yip-kl commented Apr 16, 2024

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
@anakin87
Copy link
Member

anakin87 commented May 8, 2024

Unfortunately, I found the same bug while working on other stuff.

Doing something like this can fix the specific bug.

@marcorei
Copy link

I just ran into this issue as well. Any temporary workarounds?

@anakin87
Copy link
Member

There is an open PR with a possible fix: #624

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 P1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants