Prod Turso failing with `you are using a client with a deprecated version of sync`
I've been using Turso db, and one of the databases has started to give this error.
libsql::replication::remote_client] Failed handshake in 87 ms: Client(Status { code: Unimplemented, message: "you are using a client with a deprecated version of sync, that is not supported in this platform. Please upgrade your client", metadata: MetadataMap { headers: {"content-type": "application/grpc-web-text", "date": "xxx", "fly-request-id": "xxx", "content-length": "0", "server": "xxx", "via": "1.1 fly.io"} }, source: None })
I have upgraded the Rust libsql client to the latest (0.9.19), but I still get the same error.
let db = Builder::new_remote_replica(
ldb_path,
DATABASE_URL,
DATABASE_AUTH_TOKEN,
)
.sync_interval(Duration::from_secs(300))
.build()
.await?;
db.sync().await?;
It's not clear what is deprecated as I've been using the default Rust client settings, and I could not find any API deprecation. I could not also find the error message in the source code of libsql.
I have fixed the issue by passing .sync_protocol(SyncProtocol::V2) before the build.
let db = Builder::new_remote_replica(
ldb_path,
DATABASE_URL,
DATABASE_AUTH_TOKEN,
)
.sync_interval(Duration::from_secs(300))
.sync_protocol(SyncProtocol::V2)
.build()
.await?;
db.sync().await?;
I also faced another breaking change in the upgrade caused by the addition of block_in_place, which doesn't work under Actix. I had to separate the db initialization out of the actix main and create my custom main which initializes the db first in a multi-threaded Tokio runtime and then passes it to Actix.
https://github.com/tursodatabase/libsql/pull/2029
@aminya If you enable trace level logs, you will see some "Probing for sync protocol ..." messages. Can you share what those look like for you using SyncProtocol::Auto?
I was using the auto sync protocol as it's the default. I was on version 0.9.6 before that, which prompted me to upgrade. I can try to get the logs if it helps.