Skip to content

Support .env Configuration for Weaviate gRPC Health Check Host #27833

Closed as not planned

Description

@liuyang3333

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Currently, Dify does not support configuring Weaviate's gRPC health check host via .env file. This becomes problematic when deploying Weaviate using the official Helm chart, as it exposes two separate services:

weaviate:8080 (HTTP)

weaviate-grpc:50051 (gRPC)

The current implementation in Dify uses the same host for both HTTP and gRPC connections, which doesn't work with this deployment pattern.

2. Additional context or comments

Allow configuration of gRPC host and port through environment variables, similar to how other Weaviate connection parameters are configured.

Current Code
In the Weaviate client initialization, the gRPC host and port are hardcoded to use the same host as HTTP:

python
def _init_client(self, config: WeaviateConfig) -> weaviate.WeaviateClient:
"""
Initializes and returns a connected Weaviate client.

Configures both HTTP and gRPC connections with proper authentication.
"""
p = urlparse(config.endpoint)
host = p.hostname or config.endpoint.replace("https://", "").replace("http://", "")
http_secure = p.scheme == "https"
http_port = p.port or (443 if http_secure else 80)

grpc_host = host  # Currently uses same host as HTTP
grpc_secure = http_secure
grpc_port = 443 if grpc_secure else 50051

Suggested Changes
Add environment variables to configure gRPC host and port separately:

WEAVIATE_GRPC_HOST - for gRPC host configuration

WEAVIATE_GRPC_PORT - for gRPC port configuration

The code should be modified to use these environment variables when available, falling back to the current behavior if they're not set.

3. Can you help us with this feature?

  • I am interested in contributing to this feature.

Activity

  1. added
    👻 feat:rag
    on Nov 4, 2025
  2. BorisPolonsky commented on Nov 5, 2025

    @BorisPolonsky
    Contributor

    A quick workaround for this issue is setting .Values.grpcService.enabled=false and both HTTP and gRPC routing will be merged as a single service:

    kubectl get svc -n $NAMESPACE | grep weaviate
    weaviate                     ClusterIP   10.43.167.250   <none>        80/TCP,50051/TCP   2d1h
    weaviate-headless            ClusterIP   None            <none>        80/TCP             2d1h
  3. BorisPolonsky commented on Nov 14, 2025

    @BorisPolonsky
    Contributor

    A quick workaround for this issue is setting .Values.grpcService.enabled=false and both HTTP and gRPC routing will be merged as a single service:

    kubectl get svc -n $NAMESPACE | grep weaviate
    weaviate ClusterIP 10.43.167.250 80/TCP,50051/TCP 2d1h
    weaviate-headless ClusterIP None 80/TCP 2d1h

    My mistake, setting .Values.grpcService.enabled=false alone doesn't workaround this issue. The workaround should be:

    kubectl patch svc -n $NAMESPACE weaviate --type='json' -p='[{"op": "add", "pat
    h": "/spec/ports/-", "value": {"name": "grpc", "protocol": "TCP", "port": 50051, "targetPort": 50051}}]'
    service/weaviate patched
  4. dosubot commented on Dec 15, 2025

    @dosubot

    Hi, @liuyang3333. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

    Issue Summary:

    • You requested support for configuring Weaviate's gRPC health check host and port separately via .env variables in Dify.
    • The current setup uses the same host for HTTP and gRPC, which conflicts with Weaviate's Helm chart exposing separate services.
    • A maintainer suggested a workaround by patching the Kubernetes service to merge HTTP and gRPC ports explicitly.
    • The workaround involves adding the gRPC port to the service configuration, as disabling .Values.grpcService.enabled alone is insufficient.
    • The issue remains unresolved with no further updates or alternative solutions provided.

    Next Steps:

    • Please let me know if this issue is still relevant with the latest version of Dify by commenting here.
    • If I don’t hear back within 15 days, I will automatically close this issue.

    Thank you for your understanding and contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    👻 feat:rag

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions