Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded replica sync doesn't work #1900

Open
AvantaR opened this issue Jan 2, 2025 · 0 comments
Open

Embedded replica sync doesn't work #1900

AvantaR opened this issue Jan 2, 2025 · 0 comments

Comments

@AvantaR
Copy link

AvantaR commented Jan 2, 2025

I try to use embedded replica synchronization with bun, but I got error like below:

bun db.sync.ts
2025-01-02T07:39:51.248873Z ERROR tower_http::trace::on_failure: response failed classification=Code: 12 latency=321 ms
2025-01-02T07:39:51.248961Z ERROR libsql_replication::replicator: error connecting to primary. retrying. error: status: Unimplemented, message: "embedded replicas are not supported for this platform and tariff plan", details: [], metadata: MetadataMap { headers: {"content-length": "0", "content-type": "application/grpc-web-text", "date": "Thu, 02 Jan 2025 07:39:51 GMT"} }
2025-01-02T07:39:52.306555Z ERROR tower_http::trace::on_failure: response failed classification=Code: 12 latency=55 ms
2025-01-02T07:39:53.364330Z ERROR tower_http::trace::on_failure: response failed classification=Code: 12 latency=56 ms
138 |             }
139 |         }
140 |     }
141 |     async sync() {
142 |         this.#checkNotClosed();
143 |         const rep = await this.#getDb().sync();
                                              ^
error: Replication(PrimaryHandshakeTimeout)

System: MacOS
Plan: Free
bun: 1.1.27
@libsql/client: 0.14.0

The code I'm running:

import { createClient } from '@libsql/client';

const client = createClient({
  url: 'file:replica.db',
  syncUrl: process.env.DATABASE_URL!,
  authToken: process.env.DATABASE_AUTH_TOKEN,
});

await client.sync();

The URL and auth token are valid, because it successfully connects to the DB at the edge.

I appreciate any help. Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant