milvus-io / milvus

A cloud-native vector database, storage for next generation AI applications
https://milvus.io
Apache License 2.0
29.51k stars 2.83k forks source link

[Bug]: [tracing] Unexpected error for invalid client_request_id #18904

Closed binbinlv closed 1 year ago

binbinlv commented 2 years ago

Is there an existing issue for this?

Environment

- Milvus version: master latest
- Deployment mode(standalone or cluster): both
- SDK version(e.g. pymilvus v2.0.0rc2):2.2.0.dev23
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

Unexpected error for invalid client_request_id and Error message for invalid client_request_id could not show which parameter is invalid

Unexcepted error: [search], Expected str, not <class 'int'>, <Time: {'RPC start': '2022-08-30 15:58:48.759539', 'Exception': '2022-08-30 15:58:48.760400'}>

Expected Behavior

This error should be handled by milvus with error code and friendly error message, like param "client_request_id" expects str, but input is "int""

Steps To Reproduce

from pymilvus import CollectionSchema, FieldSchema
from pymilvus import Collection
from pymilvus import connections
from pymilvus import DataType
from pymilvus import Partition
from pymilvus import utility

connections.connect(host="localhost")

dim = 128
int64_field = FieldSchema(name="int64", dtype=DataType.INT64, is_primary=True)
float_field = FieldSchema(name="float", dtype=DataType.FLOAT)
bool_field = FieldSchema(name="bool", dtype=DataType.BOOL)
float_vector = FieldSchema(name="float_vector", dtype=DataType.FLOAT_VECTOR, dim=dim)
schema = CollectionSchema(fields=[int64_field, float_field, bool_field, float_vector])
collection = Collection("test_search_collection_binbin_1", schema=schema)
import numpy as np
import random
nb=1000
vectors = [[random.random() for _ in range(dim)] for _ in range(nb)]
res = collection.insert([[i for i in range(nb)], [np.float32(i) for i in range(nb)], [np.bool(i) for i in range(nb)], vectors])
collection.load()
default_search_params = {"metric_type": "L2", "params": {"nprobe": 10}}
nq = 2
limit = 10

res = collection.search(vectors[:nq], "float_vector", default_search_params, limit, expr="int64 >= 0", client_request_id=999888001, log_level="debug")

Milvus Log

NA

Anything else?

No response

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Rotten issues close after 30d of inactivity. Reopen the issue with /reopen.