[Bug] Can not set authorization as disable for MIlvus #18355

Closed
opened 2026-02-21 19:46:40 -05:00 by yindo · 0 comments
Owner

Originally created by @jiaxiaolei on GitHub (Sep 27, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • 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.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.9.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When I try to disable the authorization, but foud it does not work.

# NOTE: https://github.com/langgenius/dify/blob/1.9.0/docker/docker-compose.yaml

 milvus-standalone:
    container_name: milvus-standalone
    image: milvusdb/milvus:v2.5.15
    profiles:
      - milvus
    command: ["milvus", "run", "standalone"]
    environment:
      ETCD_ENDPOINTS: ${ETCD_ENDPOINTS:-etcd:2379}
      MINIO_ADDRESS: ${MINIO_ADDRESS:-minio:9000}
      common.security.authorizationEnabled: fasle # ${MILVUS_AUTHORIZATION_ENABLED:-true}
    volumes:
      - ./volumes/milvus/milvus:/var/lib/milvus
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"]
      interval: 30s
      start_period: 90s
      timeout: 20s
      retries: 3
    depends_on:
      - etcd
      - minio
    ports:
      - 19530:19530
      - 9091:9091
    networks:
      - milvus

get the log of docker-worker

 docker logs -f docker-worker-1
 

 2025-09-26 09:20:19.865 INFO [MainThread] [connection.py:22] - Connected to redis://:**@redis:6379/1
2025-09-26 09:20:19.867 INFO [MainThread] [mingle.py:40] - mingle: searching for neighbors
2025-09-26 09:20:20.877 INFO [MainThread] [mingle.py:49] - mingle: all alone
2025-09-26 09:20:20.891 INFO [Dummy-1] [pidbox.py:111] - pidbox: Connected to redis://:**@redis:6379/1.
2025-09-26 09:20:20.892 INFO [MainThread] [worker.py:176] - celery@8c20dabd6330 ready.
2025-09-26 09:21:59.577 INFO [MainThread] [strategy.py:161] - Task tasks.clean_dataset_task.clean_dataset_task[7aeaafe3-85c3-4e00-b35e-89a8ad646421] received
2025-09-26 09:21:59.578 INFO [Dummy-2] [clean_dataset_task.py:48] - Start clean dataset when dataset deleted: b389c532-23af-400f-be97-9233d7ad559e
2025-09-26 09:22:00.074 ERROR [Dummy-2] [clean_dataset_task.py:80] - Failed to clean vector database for dataset b389c532-23af-400f-be97-9233d7ad559e
Traceback (most recent call last):
  File "/app/api/tasks/clean_dataset_task.py", line 77, in clean_dataset_task
    index_processor.clean(dataset, None, with_keywords=True, delete_child_chunks=True)
  File "/app/api/core/rag/index_processor/processor/paragraph_index_processor.py", line 94, in clean
    vector = Vector(dataset)
             ^^^^^^^^^^^^^^^
  File "/app/api/core/rag/datasource/vdb/vector_factory.py", line 41, in __init__
    self._vector_processor = self._init_vector()
                             ^^^^^^^^^^^^^^^^^^^
  File "/app/api/core/rag/datasource/vdb/vector_factory.py", line 61, in _init_vector
    return vector_factory_cls().init_vector(self._dataset, self._attributes, self._embeddings)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/core/rag/datasource/vdb/milvus/milvus_vector.py", line 407, in init_vector
    config=MilvusConfig(
           ^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/pydantic/main.py", line 253, in __init__
    validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for MilvusConfig
  Value error, config MILVUS_USER is required [type=value_error, input_value={'uri': 'http://host.dock..., 'analyzer_params': ''}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.11/v/value_error


the source code of milvus

# NOTE: https://github.com/langgenius/dify/blob/1.9.0/api/core/rag/datasource/vdb/milvus/milvus_vector.py

class MilvusConfig(BaseModel):
    """
    Configuration class for Milvus connection.
    """

    uri: str  # Milvus server URI
    token: str | None = None  # Optional token for authentication
    user: str | None = None  # Username for authentication
    password: str | None = None  # Password for authentication
    batch_size: int = 100  # Batch size for operations
    database: str = "default"  # Database name
    enable_hybrid_search: bool = False  # Flag to enable hybrid search
    analyzer_params: str | None = None  # Analyzer params

    @model_validator(mode="before")
    @classmethod
    def validate_config(cls, values: dict):
        """
        Validate the configuration values.
        Raises ValueError if required fields are missing.
        """
        if not values.get("uri"):
            raise ValueError("config MILVUS_URI is required")
        if not values.get("token"):
            if not values.get("user"):
                raise ValueError("config MILVUS_USER is required")
            if not values.get("password"):
                raise ValueError("config MILVUS_PASSWORD is required")
        return values

In the source code about MilvusConfig, I found it do not receive the 'authorization Enabled or Disable'.
When I try to Disable the authorization for MIlvus Server, find it does not work.

I think it maybe a bug in 1.9.0/api/core/rag/datasource/vdb/milvus/milvus_vector.py.
Wish someone can check it .

✔️ Expected Behavior

Wish someone can check it .

Actual Behavior

get the log of docker-worker

 docker logs -f docker-worker-1
 

 2025-09-26 09:20:19.865 INFO [MainThread] [connection.py:22] - Connected to redis://:**@redis:6379/1
2025-09-26 09:20:19.867 INFO [MainThread] [mingle.py:40] - mingle: searching for neighbors
2025-09-26 09:20:20.877 INFO [MainThread] [mingle.py:49] - mingle: all alone
2025-09-26 09:20:20.891 INFO [Dummy-1] [pidbox.py:111] - pidbox: Connected to redis://:**@redis:6379/1.
2025-09-26 09:20:20.892 INFO [MainThread] [worker.py:176] - celery@8c20dabd6330 ready.
2025-09-26 09:21:59.577 INFO [MainThread] [strategy.py:161] - Task tasks.clean_dataset_task.clean_dataset_task[7aeaafe3-85c3-4e00-b35e-89a8ad646421] received
2025-09-26 09:21:59.578 INFO [Dummy-2] [clean_dataset_task.py:48] - Start clean dataset when dataset deleted: b389c532-23af-400f-be97-9233d7ad559e
2025-09-26 09:22:00.074 ERROR [Dummy-2] [clean_dataset_task.py:80] - Failed to clean vector database for dataset b389c532-23af-400f-be97-9233d7ad559e
Traceback (most recent call last):
  File "/app/api/tasks/clean_dataset_task.py", line 77, in clean_dataset_task
    index_processor.clean(dataset, None, with_keywords=True, delete_child_chunks=True)
  File "/app/api/core/rag/index_processor/processor/paragraph_index_processor.py", line 94, in clean
    vector = Vector(dataset)
             ^^^^^^^^^^^^^^^
  File "/app/api/core/rag/datasource/vdb/vector_factory.py", line 41, in __init__
    self._vector_processor = self._init_vector()
                             ^^^^^^^^^^^^^^^^^^^
  File "/app/api/core/rag/datasource/vdb/vector_factory.py", line 61, in _init_vector
    return vector_factory_cls().init_vector(self._dataset, self._attributes, self._embeddings)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/core/rag/datasource/vdb/milvus/milvus_vector.py", line 407, in init_vector
    config=MilvusConfig(
           ^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/pydantic/main.py", line 253, in __init__
    validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for MilvusConfig
  Value error, config MILVUS_USER is required [type=value_error, input_value={'uri': 'http://host.dock..., 'analyzer_params': ''}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.11/v/value_error


Originally created by @jiaxiaolei on GitHub (Sep 27, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.9.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce When I try to disable the authorization, but foud it does not work. ``` # NOTE: https://github.com/langgenius/dify/blob/1.9.0/docker/docker-compose.yaml milvus-standalone: container_name: milvus-standalone image: milvusdb/milvus:v2.5.15 profiles: - milvus command: ["milvus", "run", "standalone"] environment: ETCD_ENDPOINTS: ${ETCD_ENDPOINTS:-etcd:2379} MINIO_ADDRESS: ${MINIO_ADDRESS:-minio:9000} common.security.authorizationEnabled: fasle # ${MILVUS_AUTHORIZATION_ENABLED:-true} volumes: - ./volumes/milvus/milvus:/var/lib/milvus healthcheck: test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"] interval: 30s start_period: 90s timeout: 20s retries: 3 depends_on: - etcd - minio ports: - 19530:19530 - 9091:9091 networks: - milvus ``` ## get the log of docker-worker ``` docker logs -f docker-worker-1 2025-09-26 09:20:19.865 INFO [MainThread] [connection.py:22] - Connected to redis://:**@redis:6379/1 2025-09-26 09:20:19.867 INFO [MainThread] [mingle.py:40] - mingle: searching for neighbors 2025-09-26 09:20:20.877 INFO [MainThread] [mingle.py:49] - mingle: all alone 2025-09-26 09:20:20.891 INFO [Dummy-1] [pidbox.py:111] - pidbox: Connected to redis://:**@redis:6379/1. 2025-09-26 09:20:20.892 INFO [MainThread] [worker.py:176] - celery@8c20dabd6330 ready. 2025-09-26 09:21:59.577 INFO [MainThread] [strategy.py:161] - Task tasks.clean_dataset_task.clean_dataset_task[7aeaafe3-85c3-4e00-b35e-89a8ad646421] received 2025-09-26 09:21:59.578 INFO [Dummy-2] [clean_dataset_task.py:48] - Start clean dataset when dataset deleted: b389c532-23af-400f-be97-9233d7ad559e 2025-09-26 09:22:00.074 ERROR [Dummy-2] [clean_dataset_task.py:80] - Failed to clean vector database for dataset b389c532-23af-400f-be97-9233d7ad559e Traceback (most recent call last): File "/app/api/tasks/clean_dataset_task.py", line 77, in clean_dataset_task index_processor.clean(dataset, None, with_keywords=True, delete_child_chunks=True) File "/app/api/core/rag/index_processor/processor/paragraph_index_processor.py", line 94, in clean vector = Vector(dataset) ^^^^^^^^^^^^^^^ File "/app/api/core/rag/datasource/vdb/vector_factory.py", line 41, in __init__ self._vector_processor = self._init_vector() ^^^^^^^^^^^^^^^^^^^ File "/app/api/core/rag/datasource/vdb/vector_factory.py", line 61, in _init_vector return vector_factory_cls().init_vector(self._dataset, self._attributes, self._embeddings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/core/rag/datasource/vdb/milvus/milvus_vector.py", line 407, in init_vector config=MilvusConfig( ^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/pydantic/main.py", line 253, in __init__ validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pydantic_core._pydantic_core.ValidationError: 1 validation error for MilvusConfig Value error, config MILVUS_USER is required [type=value_error, input_value={'uri': 'http://host.dock..., 'analyzer_params': ''}, input_type=dict] For further information visit https://errors.pydantic.dev/2.11/v/value_error ``` ## the source code of milvus ``` # NOTE: https://github.com/langgenius/dify/blob/1.9.0/api/core/rag/datasource/vdb/milvus/milvus_vector.py class MilvusConfig(BaseModel): """ Configuration class for Milvus connection. """ uri: str # Milvus server URI token: str | None = None # Optional token for authentication user: str | None = None # Username for authentication password: str | None = None # Password for authentication batch_size: int = 100 # Batch size for operations database: str = "default" # Database name enable_hybrid_search: bool = False # Flag to enable hybrid search analyzer_params: str | None = None # Analyzer params @model_validator(mode="before") @classmethod def validate_config(cls, values: dict): """ Validate the configuration values. Raises ValueError if required fields are missing. """ if not values.get("uri"): raise ValueError("config MILVUS_URI is required") if not values.get("token"): if not values.get("user"): raise ValueError("config MILVUS_USER is required") if not values.get("password"): raise ValueError("config MILVUS_PASSWORD is required") return values ``` In the source code about MilvusConfig, I found it do not receive the 'authorization Enabled or Disable'. When I try to Disable the authorization for MIlvus Server, find it does not work. I think it maybe a bug in `1.9.0/api/core/rag/datasource/vdb/milvus/milvus_vector.py`. Wish someone can check it . ### ✔️ Expected Behavior Wish someone can check it . ### ❌ Actual Behavior ## get the log of docker-worker ``` docker logs -f docker-worker-1 2025-09-26 09:20:19.865 INFO [MainThread] [connection.py:22] - Connected to redis://:**@redis:6379/1 2025-09-26 09:20:19.867 INFO [MainThread] [mingle.py:40] - mingle: searching for neighbors 2025-09-26 09:20:20.877 INFO [MainThread] [mingle.py:49] - mingle: all alone 2025-09-26 09:20:20.891 INFO [Dummy-1] [pidbox.py:111] - pidbox: Connected to redis://:**@redis:6379/1. 2025-09-26 09:20:20.892 INFO [MainThread] [worker.py:176] - celery@8c20dabd6330 ready. 2025-09-26 09:21:59.577 INFO [MainThread] [strategy.py:161] - Task tasks.clean_dataset_task.clean_dataset_task[7aeaafe3-85c3-4e00-b35e-89a8ad646421] received 2025-09-26 09:21:59.578 INFO [Dummy-2] [clean_dataset_task.py:48] - Start clean dataset when dataset deleted: b389c532-23af-400f-be97-9233d7ad559e 2025-09-26 09:22:00.074 ERROR [Dummy-2] [clean_dataset_task.py:80] - Failed to clean vector database for dataset b389c532-23af-400f-be97-9233d7ad559e Traceback (most recent call last): File "/app/api/tasks/clean_dataset_task.py", line 77, in clean_dataset_task index_processor.clean(dataset, None, with_keywords=True, delete_child_chunks=True) File "/app/api/core/rag/index_processor/processor/paragraph_index_processor.py", line 94, in clean vector = Vector(dataset) ^^^^^^^^^^^^^^^ File "/app/api/core/rag/datasource/vdb/vector_factory.py", line 41, in __init__ self._vector_processor = self._init_vector() ^^^^^^^^^^^^^^^^^^^ File "/app/api/core/rag/datasource/vdb/vector_factory.py", line 61, in _init_vector return vector_factory_cls().init_vector(self._dataset, self._attributes, self._embeddings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/core/rag/datasource/vdb/milvus/milvus_vector.py", line 407, in init_vector config=MilvusConfig( ^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/pydantic/main.py", line 253, in __init__ validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pydantic_core._pydantic_core.ValidationError: 1 validation error for MilvusConfig Value error, config MILVUS_USER is required [type=value_error, input_value={'uri': 'http://host.dock..., 'analyzer_params': ''}, input_type=dict] For further information visit https://errors.pydantic.dev/2.11/v/value_error ```
yindo added the 🐞 bug label 2026-02-21 19:46:40 -05:00
yindo closed this issue 2026-02-21 19:46:41 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#18355