benbjohnson/litestream

"monitor error: client write: stat <filename>: no such file or directory"

gwd opened this issue · 1 comments

gwd commented

I downloaded and installed litestream v0.3.9, enabled it w/ systemd, and set it up to stream a number of databases locally via the 'file' replicas, to play around with it before setting up a Cloudflare R2 bucket for it (Amazon S3 compatible).

Things seem to work overall, but about every 30 seconds or so, on only one of the databases, I'm getting an errors like the following (full path redacted):

Aug 16 21:44:46 ubuntu-2gb-hel1-1 litestream[1158]: /home/webapp/<path>/study.sqlite(file): monitor error: client write: stat /home/webapp/<path>/study.sqlite/generations/8ff83e32cd92856b/wal/0000000b_0001b2a8.wal.lz4.tmp: no such file or directory
Aug 16 21:44:56 ubuntu-2gb-hel1-1 litestream[1158]: /home/webapp/<path>/study.sqlite(file): monitor error: client write: stat /home/webapp/<path>/study.sqlite/generations/8ff83e32cd92856b/wal/0000000b_0002f488.wal.lz4.tmp: no such file or directory

In the cases above, indeed the /home/webapp/<path>/study.sqlite/generations/8ff83e32cd92856b/wal/0000000b_0002f488.wal.lz4.tmp file doesn't exist; but the /home/webapp/<path>/study.sqlite/generations/8ff83e32cd92856b/wal directory exists and is full of .wal.lz4 files.

So far this has only happened to one of the six sqlite databases being backed up.

Here's the relevant litestream.yaml:

   - path: /home/webapp/<dbpath>/study.sqlite
     replicas:
       - path: /home/webapp/<backup-path>/study.sqlite
         retention: 600h
         snapshot-interval: 24h

Any idea what's going on? Is this specific to the "file" replica, so that it would go away if I switched to an "s3" replica instead?

Thanks in advance for your help.

gwd commented

OK, for posterity: The problem was that I had two identical entries in my litestream.yaml. Sorry for the noise; leaving this here in case someone else makes the same mistake.