Skip to content
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

borg2: NotADirectoryError: [Errno 20] Not a directory: '/PATH/TO/BORG/REPO/config/readme #8652

Open
tpo opened this issue Jan 22, 2025 · 2 comments
Labels

Comments

@tpo
Copy link

tpo commented Jan 22, 2025

$ borg2 --version
borg2 2.0.0b14

$ ls -l /usr/local/bin/borg2 
lrwxrwxrwx 1 root root 19 Jan 22 20:35 /usr/local/bin/borg2 -> borg-linux-glibc231
$ ssh foo@foo.example.org "ls /mnt/backup/borg2/"
$

It's empty, there's nothing in that directory...

$ ssh foo@foo.example.org "ls -l /mnt/backup/borg/foo/config
-rw-rw---- 1 foo foo 700 Nov 18  2020 /mnt/backup/borg/foo/config

That path exists and is a file. However:

$ borg2 --remote-path /usr/local/bin/borg2 --repo ssh://foo@foo.example.org:22//mnt/backup/borg2/foo repo-create --other-repo ssh://foo@foo.example.org:22/mnt/backup/borg/foo -e repokey-aes-ocb



Traceback (most recent call last):

  File "borg/remote.py", line 266, in inner_serve

  File "borg/remote.py", line 417, in open

  File "borg/repository.py", line 164, in __enter__

  File "borg/repository.py", line 234, in open

  File "borgstore/store.py", line 199, in load

  File "borgstore/store.py", line 188, in find

  File "borgstore/backends/posixfs.py", line 108, in info

  File "pathlib.py", line 840, in stat

NotADirectoryError: [Errno 20] Not a directory: '/mnt/backup/borg/foo/config/readme'


Error:

RemoteRepository.RPCError: {'i': 2, 'exception_class': 'NotADirectoryError', 'exception_args': (20, 'Not a directory'), 'exception_full': ('Traceback (most recent call last):\n', '  File "borg/remote.py", line 266, in inner_serve\n', '  File "borg/remote.py", line 417, in open\n', '  File "borg/repository.py", line 164, in __enter__\n', '  File "borg/repository.py", line 234, in open\n', '  File "borgstore/store.py", line 199, in load\n', '  File "borgstore/store.py", line 188, in find\n', '  File "borgstore/backends/posixfs.py", line 108, in info\n', '  File "pathlib.py", line 840, in stat\n', "NotADirectoryError: [Errno 20] Not a directory: '/mnt/backup/borg/foo/config/readme'\n"), 'exception_short': ("NotADirectoryError: [Errno 20] Not a directory: '/mnt/backup/borg/foo/config/readme'\n",), 'exception_trace': True, 'sysinfo': "Platform: Linux borg 6.1.0-30-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.124-1 (2025-01-12) x86_64\nLinux: Unknown Linux  \nBorg: 2.0.0b14  Python: CPython 3.12.4 msgpack: 1.1.0 fuse: llfuse 1.5.1 [pyfuse3,llfuse]\nPID: 1594  CWD: /home/foo\nsys.argv: ['/usr/local/bin/borg2', 'serve']\nSSH_ORIGINAL_COMMAND: None\n"}

If reporting bugs, please include the following:

Borg server: Traceback (most recent call last):
Borg server: 
Borg server:   File "borg/remote.py", line 266, in inner_serve
Borg server: 
Borg server:   File "borg/remote.py", line 417, in open
Borg server: 
Borg server:   File "borg/repository.py", line 164, in __enter__
Borg server: 
Borg server:   File "borg/repository.py", line 234, in open
Borg server: 
Borg server:   File "borgstore/store.py", line 199, in load
Borg server: 
Borg server:   File "borgstore/store.py", line 188, in find
Borg server: 
Borg server:   File "borgstore/backends/posixfs.py", line 108, in info
Borg server: 
Borg server:   File "pathlib.py", line 840, in stat
Borg server: 
Borg server: NotADirectoryError: [Errno 20] Not a directory: '/mnt/backup/borg/foo/config/readme'
Borg server: Platform: Linux foo 6.1.0-30-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.124-1 (2025-01-12) x86_64
Borg server: Linux: Unknown Linux  
Borg server: Borg: 2.0.0b14  Python: CPython 3.12.4 msgpack: 1.1.0 fuse: llfuse 1.5.1 [pyfuse3,llfuse]
Borg server: PID: 1594  CWD: /home/foo
Borg server: sys.argv: ['/usr/local/bin/borg2', 'serve']
Borg server: SSH_ORIGINAL_COMMAND: None

No idea why borg2 is trying to access a nonexistent path /mnt/backup/borg/foo/config/readme as a directory?

(This bug is related to #8651 , since my workaround is to migrate to borg2...)

The new borg2 repo seems to get created however. No idea in which state it is though:

$ ssh foo@foo.example.org
  $ cd /mnt/backup/borg2 && ls
  foo
  $ du -sh /mnt/backup/borg2/foo/
  PLENTY OF GIGABYTES...
@ThomasWaldmann
Copy link
Member

Guess --from-borg1 is missing (--other-repo is not only used for borg1 -> borg2, but could also be used for borg2 -> borg and the latter is the default).

Also there are different amounts of slashes for /mnt.

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Jan 22, 2025

BTW, you shouldn't use borg2 for production (there is no beta-to-beta repo upgrade code).

Testing is of course welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants