[Errno 17] File exists
while running borgmatic check #711
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#711
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
After upgrading from borgmatic 1.7.10 to 1.7.13
borgmatic check
fails with following error:Steps to reproduce (if a bug)
Having run
borgmatic check
in version 1.7.10 for repository created the file/root/.borgmatic/checks/.../data
.With newer version 1.7.13
borgmatic check
wants to create a file/root/.borgmatic/checks/.../data/all
instead, but can't handle the situation, whendata
as file already exists, but needs to be now a directory.Actual behavior (if a bug)
borgmatic check
fails withExpected behavior (if a bug)
borgmatic check
should run successfullyOther notes / implementation ideas
Workaround/Solution: after upgrading to borgmatic 1.7.13 manually delete the
/root/.borgmatic/checks/.../data
file, and a new run will create subdirectorydata
with now used filedata/all
.Alternatively create empty file
data/all
before a new run.Environment
borgmatic version: 1.7.13
borgmatic installation method: openSUSE package
Borg version: borg 1.2.4
Python version: 3.10.11
Database version (if applicable): -
operating system and version: openSUSE Tumbleweed
Ugh, thanks for filing this. The new check code is supposed to gracefully upgrade the old check file layout in place, but it sounds like that's not working in your case. I'll see if I can repro this locally.
Can I get a look at your
borgmatic --verbosity 2
logs when this error occurs? In particular, I'm looking for a log like:Thanks!
(FWIW, I've not been able to reproduce the error locally.)
Thanks for your reply.
I will try to provide logs, but in the error logs (
borgmatic check -v 2
) from my attempts earlier no such lineUpgrading archives check time ...
appeared.At the moment it works again for me, as I was manually deleting that
data
file.Hopefully on next weekend I would try to reproduce it again with old version, before upgrading again.
Okay. If it comes to it, I can give you a modified source file instrumented with even more debug logging to determine what might be going on with these check upgrades on your system. Keep me updated!
Possibly related: #713.
@witten I am getting something similar in my borg extract tests from rsync.net:
I am running something like this on in a Docker container on Nomad (Hashicorp):
This was working fine until I moved from borgmatic 1.7.12 to 1.7.14.
Thanks for chiming in! If you have the ability to install a development version of borgmatic, I have a potential fix you can try. You would upgrade borgmatic with the version in that branch. Or, if it's easier, I can give you a single file to override one of your local borgmatic source files with.
But if you're not comfortable with that for whatever reason, you can just wait for the next release and this should hopefully be fixed.
@witten I figured out why
root/.borgmatic/checks/404985c24bc47e7856b17ea72cf6a9f9aa85dc9e96c3a02f14d95d153d5ff9c3/archives: open: [Errno 21] Is a directory: '/alloc/data/archives'
happened.I take borg backups of zfs snapshots that are mounted to something like
/mnt/borg/r02/data/
Then the database folder is inside that.
However, when stripping 4 components
root/.borgmatic/checks/404985c24bc47e7856b17ea72cf6a9f9aa85dc9e96c3a02f14d95d153d5ff9c3/archives
ended up in same place as borg's archives folder.
Interesting. I assume those ZFS snapshots read-only? That might explain why borgmatic couldn't upgrade their file layout (which changed from 1.7.12. to 1.7.14). The
~/.borgmatic/checks/
directory needs to be read-write.@witten Yep, snapshots mounted as read-only locally, then shipped to rsync.net with borgmatic.
Verification is done in a docker/nomad combo using borgmatic docker container. I got it running again without that error after removal of --strip-components
Got it, thanks.
I believe this ticket to be fixed now as part of the work on #713. The fix should be part of the next release.
Just released in borgmatic 1.7.15.