1

I am trying to use weaviates v4 python client to connect to my weaviate db instance which is containerized and hosted on azure in a Web App. When using the v3 client connection works perfectly, when I try to connect with v4 an error message "Connection to Weaviate failed" occurs.

My v3 client code:

client = weaviate.Client(os.getenv("WEAVIATE_AZURE_URL"), 
                         auth_client_secret=weaviate.AuthApiKey(os.getenv("WEAVIATE_AZURE_KEY")
                                                                )
)

v4 client code:

client = weaviate.connect_to_custom(
    http_host=os.getenv("WEAVIATE_AZURE_URL"),
    http_port=8080,
    http_secure=False,
    grpc_host="localhost",
    grpc_port=50051,
    grpc_secure=False,
    auth_credentials=AuthApiKey(os.getenv("WEAVIATE_AZURE_KEY")),   # `weaviate_key`: your Weaviate API key
)

My docker compose file

---
version: '3.4'
services:
  weaviate:
    command:
    - --host
    - 0.0.0.0
    - --port
    - '8080'
    - --scheme
    - http
    image: cr.weaviate.io/semitechnologies/weaviate:1.24.10
    ports:
    - 8080:8080
    - 50051:50051
    volumes:
    - weaviate_data:/var/lib/weaviate
    restart: on-failure:0
    environment:
      CLIP_INFERENCE_API: 'http://multi2vec-clip:8080'
      OPENAI_APIKEY: ''
      QUERY_DEFAULTS_LIMIT: 25
      AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'false'
      AUTHENTICATION_APIKEY_ENABLED: 'true'
      AUTHENTICATION_APIKEY_ALLOWED_KEYS: ''
      AUTHENTICATION_APIKEY_USERS: ''
      PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
      DEFAULT_VECTORIZER_MODULE: 'multi2vec-clip'
      ENABLE_MODULES: 'multi2vec-clip,generative-openai,generative-cohere'
      CLUSTER_HOSTNAME: 'node1'
  multi2vec-clip:
    image: cr.weaviate.io/semitechnologies/multi2vec-clip:sentence-transformers-clip-ViT-B-32-multilingual-v1
    environment:
      ENABLE_CUDA: '0'
volumes:
  weaviate_data:
...

Has anyone experienced the same problem or sees what I did wrong?

I could not find any related problems, and recent azure weaviate tutorials also only use the v3 client.

5
  • What's the full stack trace of the error? Commented May 3, 2024 at 19:42
  • 1
    I figured that using the v4 client required acces to the gRPC port 50051 which is blocked by Azure web apps. So at the moment my setup does will not work. Commented May 4, 2024 at 18:42
  • Please post your sol as an answer Commented May 24, 2024 at 4:21
  • @joes00 It's great to hear that you were able to resolve your issue. Could you please document your solution in an answer? It would provide clarity for those encountering similar technical challenges within the community. Commented May 26, 2024 at 7:00
  • joes00 never found a solution @NaveenSharma Commented Aug 25, 2024 at 10:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.