-
Notifications
You must be signed in to change notification settings - Fork 287
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
ERROR libsql::replication: replicator sync | database disk image is malformed #1607
Comments
Somehow my replica db got corrupted, after resyncing replica db locally and pushing it back to the server it got fixed.. What could have caused the problem?? Multiple user writes or something else? |
Sometimes embedded replicas get corrupted when their db file is opened with regular sqlite3 driver. Maybe you did something like that? @LucioFranco Would you be able to help please? |
Considering this file was deployed in production, i didn't touch it. Though i had some active traffic to the website before noticing this error, though it was mostly reads, and at first i thought that it was some kind of attack, like sql injection( im not very proficient in those issues) But could multiple simultaneous writes and potential error corrupt it?? |
It is not possible to write directly to embedded replicas. The writes are being forwarded to a primary in the cloud and then fetched back with sync. So multiple writers should be fine I think |
Yeah, i know that. But if there was some race condition or some errors during writes, maybe this could potentially on sync corrupt replica dbs. Interesting thing was, that i have a full-stack app that has replica. And also a separate api that also has its own replica. And even though some actions were happening on the full-stack app, inside my api application DB was corrupted as well.. So basically there was something going on in turso parent db, and this error was synced to both replicas. But it worked totally fine with turso dashboard, and after deleting replicas and syncing again it got fixed. |
@LucioFranco I think you should investigate that as part of your embedded replicas work |
@Aft1n could you share the version of libsql that you were using? |
i was using the latest - 7.0 |
I think your theory sounds correct, I would say if you start to see this issue again you can ping me on discord and I can take a look at what is going on it. This is slightly hard to debug since the malformed error is quite cryptic. |
So this error happened again, heres an abrupt error from logs: 22:56:11 1|main | error: replication error: Injector error: SQLite error: database disk image is malformed 22:54:47 1|main | 2024-08-02T22:54:47.369381Z ERROR libsql::replication: replicator sync error: replication error: Injector error: SQLite error: database disk image is malformed And i have noticed that my Turso sync usage skyrocketed, because it was having an error and couldnt go through, possibly its currently 5gb/2gb |
having the same issue with a deployement on railway |
@Aft1n @vanillacode314 are either of you still experiencing this issue? If so could you try to give me a small example of how you're able to trigger it. Unfortunately, just the error message is not very helpful and doesn't really tell us why it was malformed and I am unable to reproduce this. |
I have an app deployed in production that has a replica db saved in the app folder, and today i checked the logs and saw this error:
ERROR libsql::replication: replicator sync error: replication error: Injector error: SQLite error: database disk image is malformed
Everything was working perfectly fine for couple of weeks, no changes to db schema were made, it just simply started to show this error in logs
The text was updated successfully, but these errors were encountered: