milvus-io / milvus

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

[Bug]: RESTful API does not work after a standard & clean installation #37825

Open Nullarity opened 1 week ago

Nullarity commented 1 week ago

Is there an existing issue for this?

Environment

- Milvus version: 2.4.15
- Deployment mode(standalone or cluster): standalone
- OS(Ubuntu or CentOS): Ubuntu 21
- CPU/Memory: x64/64gb
- GPU: none

Current Behavior

Following the documentation:

export CLUSTER_ENDPOINT="http://localhost:19530"

curl --request GET \
    --url "${CLUSTER_ENDPOINT}/v2/vectordb/collections/list" \
    --header 'accept: application/json' \
    --header 'content-type: application/json'

I get this error: 404 page not found.

At the same time, the command curl "http://localhost:9091/healthz" is ok, and curl localhost:9091/metrics works too.

Expected Behavior

Adequate response.

Steps To Reproduce

No response

Milvus Log

[2024/11/19 21:29:40.149 Z] [GIN] [/collections/list] [traceID=] [code=404] [latency=11.317µs] [client=172.18.0.1] [method=GET] [error=]

Anything else?

No response

xiaofan-luan commented 1 week ago

could you telnet localhost:19530 and 19531, see if the port is enabled?

Nullarity commented 1 week ago

yes, I can, they are accessible and enabled

Nullarity commented 1 week ago

could you telnet localhost:19530 and 19531, see if the port is enabled?

Sorry, I didn't pay enough attention; 19531 is not accessible. Should it be?

this is my docker ps:

CONTAINER ID   IMAGE                                      COMMAND                  CREATED       STATUS                 PORTS                                              NAMES
40e0aa8bfabf   milvusdb/milvus:v2.4.15                    "/tini -- milvus run…"   2 hours ago   Up 2 hours (healthy)   0.0.0.0:9091->9091/tcp, 0.0.0.0:19530->19530/tcp   milvus-standalone
355c31cee9f8   minio/minio:RELEASE.2023-03-20T20-16-18Z   "/usr/bin/docker-ent…"   2 hours ago   Up 2 hours (healthy)   0.0.0.0:9000-9001->9000-9001/tcp                   milvus-minio
0e4ea5b06868   quay.io/coreos/etcd:v3.5.5                 "etcd -advertise-cli…"   2 hours ago   Up 2 hours (healthy)   2379-2380/tcp                                      milvus-etcd
xiaofan-luan commented 1 week ago

19530 is there. is there error message from milvus log?

xiaofan-luan commented 1 week ago

oh I guess you should use post

curl --request POST instead of GET

try curl --request POST \ --url "${CLUSTER_ENDPOINT}/v2/vectordb/collections/list" \ --header "Authorization: Bearer ${TOKEN}" \ --header "Content-Type: application/json" \ -d '{ "dbName": "_default" }'

Nullarity commented 1 week ago

Thank you very much, this one seems to work:

curl --request POST --url "http://localhost:19530/v2/vectordb/collections/list" --header "Content-Type: application/json" -d '{ "dbName": "default"}'

So, is there a bug in the documentation then? / https://milvus.io/api-reference/restful/v2.4.x/About.md /

yanliang567 commented 1 week ago

/assign @smellthemoon could you please double check the doc and update it if need /unassign

smellthemoon commented 1 week ago

yes, I found that https://milvus.io/api-reference/restful/v2.4.x/v2/Alias%20(v2)/List.md is correct, but https://milvus.io/api-reference/restful/v2.4.x/About.md is the wrong code, I will connect with doc group and update it.

Nullarity commented 1 week ago

Just one note here: I think the correct name of the database should be 'default' rather than '_default'. At least in my case, for the '_default' database, the request doesn't work.