cannot use milvus-2.5.4, version check failed
Self Checks
- [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [x] I have searched for existing issues search for existing issues, including closed ones.
- [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [x] Please do not modify this template :) and fill in all the required fields.
Dify version
0.15.3
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
deploy milvus 2.5.4, dify in 0.15.3 version, trying to use it do full-text search
✔️ Expected Behavior
get full-text search result
❌ Actual Behavior
get empty result. Check the log of api container, output as below:
looks like it can't pass the version check, maybe there is a bug of version parser or version check, it can't read 'pkg/v2.5.4' sucessfully. And that finally lead to disable hybrid search when using milvsu for vector database.
@aoyifei Hello there! I'm here to help you with any bugs, questions, or contributions you have related to the project. Let's work together to solve this issue!
I found a similar open issue regarding the version check failure with Milvus 2.5.4 and Dify 0.15.3. The suggested solution is to set the environment variable MILVUS_ENABLE_HYBRID_SEARCH in your Dify configuration to enable full-text search capabilities [1].
Additionally, the _check_hybrid_search_support method in the MilvusVector class may not correctly parse the version string due to the way it handles version labels. You might need to adjust the version parsing logic to handle such version strings correctly, possibly by stripping out non-numeric prefixes or using a more flexible version parsing approach [2].
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
@dosu, I already set the environment variable MILVUS_ENABLE_HYBRID_SEARCH to True in .env file. I think this is a bug about version check.
The issue you're encountering might indeed be related to how the version string 'pkg/v2.5.4' is being parsed. The _check_hybrid_search_support method in the MilvusVector class uses version.parse() to handle version strings, but it may not correctly interpret non-numeric prefixes like 'pkg/'.
To address this, you could modify the version parsing logic to strip out non-numeric prefixes before parsing. This would ensure that the version comparison is based solely on the numeric part. Unfortunately, I don't have direct access to the code to make these changes, but you can try implementing a preprocessing step to clean the version string before it's parsed.
If you're comfortable with Python, you could adjust the _check_hybrid_search_support method to handle this. Here's a conceptual example of how you might preprocess the version string:
import re
from packaging import version
def _check_hybrid_search_support(self) -> bool:
if not self._client_config.enable_hybrid_search:
return False
try:
milvus_version = self._client.get_server_version()
# Strip non-numeric prefixes
clean_version = re.sub(r'^[^\d]+', '', milvus_version)
return version.parse(clean_version).base_version >= version.parse("2.5.0").base_version
except Exception as e:
logger.warning(f"Failed to check Milvus version: {str(e)}. Disabling hybrid search.")
return False
This example uses a regular expression to remove any non-numeric characters at the start of the version string. You can adapt this to your needs and test if it resolves the issue.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
Not sure if you have modified this part as well?
https://github.com/langgenius/dify/blob/269ba6add9da0068051d0d1e2fc95cfa020b9725/docker/docker-compose.yaml#L858-L883
@crazywoola the milvus I am using is deployed separated, not from docker-compose, is a standalone of 2.5.4 version. I directly modify this part to connect my milvus.
# Milvus configuration Only available when VECTOR_STORE is `milvus`.
# The milvus uri.
MILVUS_URI=http://host:port
MILVUS_TOKEN=
MILVUS_USER=root
MILVUS_PASSWORD=******
This is definitely a bug of dify 0.15.0-3.
I deployed a Milvus with the official helm chart and got the exact same error.
Not sure if you have modified this part as well?不确定你是否也修改了这部分?
dify/docker/docker-compose.yaml
Lines 858 to 883 in 269ba6a
milvus-standalone: container_name: milvus-standalone image: milvusdb/milvus:v2.5.0-beta profiles: - milvus command: [ 'milvus', 'run', 'standalone' ] environment: ETCD_ENDPOINTS: ${ETCD_ENDPOINTS:-etcd:2379} MINIO_ADDRESS: ${MINIO_ADDRESS:-minio:9000} common.security.authorizationEnabled: ${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
@crazywoola hi! i modified the milvus docker image version to upgrade to v2.5.5 because i noticed v2.5.0-beta have some highly dangerous security vulnerability.after this, i also has this problem when i use hybrid search and full text search
see https://github.com/langgenius/dify/issues/13595#issuecomment-2656776994