[Errno 20] Not a directory #1007
Labels
No labels
blocked
breaking
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
borgmatic-collective/borgmatic#1007
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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
As I already mentioned in #1006, I am currently testing the update from borgmatic 1.8.X to 1.9.X. During the restore of files I noticed the following warnings:
Restoring files still works without any recognizable problems.
Steps to reproduce
Just restore (extract) files from a backup:
Actual behavior
The files are restored without any recognizable problems, but the error messages mentioned above appear in the log.
Expected behavior
The extract function is not affected.
Other notes / implementation ideas
No response
borgmatic version
1.9.12
borgmatic installation method
Container
Borg version
1.4.0
Python version
3.13.2
Database version (if applicable)
n/a
Operating system and version
Ubuntu 22.04.5 LTS
The traceback itself is coming from Borg, and I'm not sure exactly what's causing it. If you can reproduce it without borgmatic, e.g. by manually running the
extractcommand that borgmatic itself is running, then you might be able to file a ticket with the Borg project. You can see theextractcommand that borgmatic is running in the borgmatic output when run with--verbosity 2.But I think I know what's causing the "Not a directory" messages, which I believe are also from Borg. The
/borgmaticdirectory within an archive is where borgmatic stores database backups. You normally shouldn't need to extract them as long asborgmatic restoreworks for restoring your databases. But even if you do extract/borgmaticpaths from an archive,/borgmaticshould get created on your filesystem as a normal directory like any other from the archive (in the current directory by default).The problem stems from the fact that you already have a file in the current directory named
borgmatic, and therefore Borg can't create a directory there! That's why it's complaining thatborgmaticis "Not a directory".You have a few different options for working around this:
borgmaticfile before extracting.--destinationor justcdfirst).borgmaticpath when extracting (see--path).Thank you for pointing me in the right direction. You are right that a file called
/borgmaticexists in the container, which would also explain the error messages. I did some digging and I have a hunch that the bash completion setup is not working properly and is leaving a file namedborgmaticin the root directory, see:github.com/borgmatic-collective/docker-borgmatic@17543f35ee/Dockerfile (L74)I will leave an issue in the appropriate github repos. Thanks for the great help!
EDIT: For reference https://github.com/modem7/docker-borgmatic/issues/173
Ah, nice sleuthing! I'll close this ticket for now and follow along with the one you just filed.