Open makorne opened 6 months ago
@makorne are you use tls? It not worked without tls with unknown cause.
I tried GRPC_TLS_PORT=2135 too
Error: Database(Grpc(Status { code: Unknown, message: "transport error", source: Some(tonic::transport::Error(Transport, hyper::Error(Io, Custom { kind: BrokenPipe, error: "stream closed because of a broken pipe" }))) }))
Looks like docker image tls part broken:
ydb -e grpc://localhost:2135 -d /local scheme ls
Status: TRANSPORT_UNAVAILABLE
Issues:
<main>: Error: GRpc error: (14): failed to connect to all addresses; last error: UNAVAILABLE: ipv4:127.0.0.1:2135: Socket closed
<main>: Error: Grpc error response on endpoint localhost:2135
<main>: Error: Endpoint list is empty for database /local, cluster endpoint localhost:2135.
I think this is some undocumented peculiarity of the database. I'm not able to test my lib with standalone ydb-database, but it works fine with yandex cloud service. If you can make standalone database instance, I will try to check cause of fail and fix it.
Why cant you setup it self hosted on your PC?
i'm on mac
i'm on m1, kvm/virtualbox cannot use because of private reason
Ok. But why dont you use a virtual cloud server for $0.5 for day? Or vps for $2 for month?
Ydb server not worked on lowcost wps, it need more ram/disk. I have no time to search optimal configuratoion.
Furthermore, there is no guarantee that it is implemented in ydb standalone. Is official ydb lib worked with ydb standalone? At the time I tested it didn't work.
Ok. But why dont you use a virtual cloud server for $0.5 for day? Or vps for $2 for month?
But if you want, YOU can do that.
Ok. But why dont you use a virtual cloud server for $0.5 for day? Or vps for $2 for month?
But if you want, YOU can do that.
Of course I've already done this. Fresh docker:
let conn_str = "ydbs://localhost:2135?database=local";
Error: Database(Grpc(Status { code: Unavailable, message: "error trying to connect: invalid peer certificate: Other(CaUsedAsEndEntity)", source: Some(tonic::transport::Error(Transport, hyper::Error(Connect, Custom { kind: InvalidData, error: InvalidCertificate(Other(CaUsedAsEndEntity)) })))
let conn_str = "ydbs://localhost:2136?database=local";
Error: Database(Grpc(Status { code: Unavailable, message: "error trying to connect: received corrupt message of type InvalidContentType", source: Some(tonic::transport::Error(Transport, hyper::Error(Connect, Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) }))) }))
I think cause in self-singed certificate on your db instance
But examples like ydb-rs-sdk/target/debug/examples/basic-select-upsert` work with the same docker...
sum: 4950
row id '1' with value 'val: 1'
row id '2' with value 'val: 2'
row id '3' with value 'val: 3'
row id '4' with value 'val: 4'
row id '5' with value 'val: 5'
row id '6' with value 'val: 6'
row id '7' with value 'val: 7'
row id '8' with value 'val: 8'
row id '9' with value 'val: 9'
row id '10' with value 'val: 10'
@makorne can you try to make cert with lets encrypt, and test local ydb with it?
But I need json anyway, so I came back to ydb official.
But I need json anyway, so I came back to ydb official.
maybe it's not that hard to implement such a feature. I'll try
Will be happy, my online friend!
I think cause in self-singed certificate on your db instance
Looks like it's old known tonic issue And can be resolved with adding an openssl as feature
@makorne can you help with test it?
What do you mean? Test connection to local ydb server in docker?
grpcs://localhost:2135?database=/local
Database(Grpc(Status { code: Unavailable, message: "error trying to connect: invalid peer certificate: Other(CaUsedAsEndEntity)", source: Some(tonic::transport::Error(Transport, hyper::Error(Connect, Custom { kind: InvalidData, error: InvalidCertificate(Other(CaUsedAsEndEntity)) }))) }))
grpc://localhost:2136?database=/local
<< This one work with ydb official
Database(Grpc(Status { code: Unknown, message: "Bad :scheme header", metadata: MetadataMap { headers: {"content-type": "application/grpc"} }, source: None }))
let db_name = "local".to_string();
let ep = ydb_unofficial::client::YdbEndpoint {ssl: false, host: "localhost".to_owned(), port: 2136, load_factor: 0.0};
let pool = ydb_unofficial::pool::YdbPoolBuilder::new(creds, db_name.try_into().unwrap(), ep).build().unwrap();
let mut conn = pool.get().await.unwrap();
let mut table = conn.table().await.unwrap(); << Here
`Result::unwrap()` on an `Err` value: Grpc(Status { code: Unknown, message: "Bad :scheme header", metadata: MetadataMap { headers: {"content-type": "application/grpc"} }, source: None })
Hi! Thank you for your great crate!
But how to use it with default local ydb server from ydb example? When I tried:
ydbs://localhost:2136?database=local
Error: Database(Grpc(Status { code: Unavailable, message: "error trying to connect: received corrupt message of type InvalidContentType", source: Some(tonic::transport::Error(Transport, hyper::Error(Connect, Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) }))) }))
grpc://localhost:2136?database=local
Error: Database(Grpc(Status { code: Unknown, message: "Bad :scheme header", metadata: MetadataMap { headers: {"content-type": "application/grpc"} }, source: None }))