LiteFS Cloud backups failing

level=INFO msg="backup stream failed, retrying: backup stream error (\"data\"): write backup tx snapshot: Post \"https://litefs.fly.io/db/tx?db=data\": open database file: open /data/litefs/dbs/data/database: no such file or directory"

Started yesterday. My app seems working fine. Is it something changed with my app or LiteFS cloud?

Hi @Janne

LiteFS is trying to sync a database named data to LiteFS cloud, but can’t find the DB file. Do you have this DB on the machine?

What LiteFS version are you using?

Can you list the contents of /data/litefs/dbs and /data/litefs/dbs/data directories?

litefs:0.5.5

/data/litefs/dbs# ls
cache.db  data  sqlite-backup.db  sqlite.db  sqllite-backup.db

/data/litefs/dbs/data# ls
ltx  shm

This appears to be a database that has been soft-deleted before it was sent to LiteFS Cloud. LiteFS Cloud doesn’t have any records of it, so LiteFS tries to send full snapshot of the database to it. But since it’s been soft-deleted locally, it fails to do this.

I believe this will need to be fixed on LiteFS side. Until then, you can just move the DB directory out of LiteFS directory and restart your app:

# mv /data/litefs/dbs/data /data/data.bak
...
$ fly apps restart <your app>

Is this supposed to fix the backups or just remove the error?

After those steps, the errors disappeared, but no new backups seem to be created.

Could you elaborate?
Are you writing to cache.db or sqlite.db but the data is not getting sent to LiteFS Cloud?

Or do you mean that sqlite-backup.db/sqllite-backup.db databases are not getting sent to LiteFS Cloud?

Now it seems working. The user interface apparently does not show new recoverable backups if no changes have occurred? When changes are written, then all the old timestamps are populated every 5 minutes?

The user interface apparently does not show new recoverable backups if no changes have occurred?

Yes. It shows recoverable backups up until the last write.

@Janne Thanks for reporting the issue. I pushed up a fix that’ll go into the next release (v0.5.7):

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.