I've been trying to connect to zilliz cloud instance of milvus but getting:
Error: Grpc(Status { code: Unknown, message: "transport error", source: Some(tonic::transport::Error(Transport, hyper::Error(Http2, Error { kind: GoAway(b"", FRAME_SIZE_ERROR, Library) }))) })
minimal reproduction is putting zilliz connection details into create_has_drop_collection() test, in tests/client.rs I set:
const URL: &str = "http://<zilliz-cloud-db-host-aws>:<zilliz-cloud-db-port>";
when I set it to HTTPS:
const URL: &str = "https://<zilliz-cloud-db-host-aws>:<zilliz-cloud-db-port>";
I got this error instead:
Error: Communication(tonic::transport::Error(Transport, hyper::Error(Connect, HttpsUriWithoutTlsSupport(()))))
I know it's generated, but I changed the connect function in the MilvusServiceClienttonic::transport::Channel impl in the src/proto/milvus.proto.milvus.rs>milvus_service_client>impl MilvusServiceClienttonic::transport::Channel to the following. Note the second commented out line is the original. I also had to enable the "tls" flag in the cargo.toml for the tonic crate
impl MilvusServiceClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
// let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
let conn = tonic::transport::Endpoint::new(dst)?;
let conn = if conn.uri().scheme().map(|s| s.as_str()) == Some("https") {
conn.tls_config(tonic::transport::ClientTlsConfig::new())?
} else {
conn
}.connect().await?;
Ok(Self::new(conn))
}
}
For my troubles I was rewarded with a different error:
Error: Communication(tonic::transport::Error(Transport, hyper::Error(Connect, Custom { kind: InvalidData, error: InvalidCertificateData("invalid peer certificate: UnknownIssuer") })))
I'm now stumped and not sure if connections to zilliz cloud are meant to be supported, please advise.
N.B. I did also test out RPCs with the command line to make sure zilliz cloud was configured properly to accept them. I ran the following while in the milvus-proto/proto folder and it worked splendidly:
grpcurl -import-path . -proto milvus.proto -d '{"collection_name": <collection_name>}' -H 'authorization: <base64_encoded_username:password>' <zilliz-cloud-db-host-aws>:<zilliz-cloud-db-port> milvus.proto.milvus.MilvusService/HasCollection
Actually that reminds me, I don't see anywhere to pass the database username and password in, I was able to get the grpcurl to work by looking through the pymilvus repo to find out how it did authentication. Is authentication a future addition to the rust sdk?