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

2.0.0b10 - ValueError when using --repo relative path #8372

Open
bket opened this issue Sep 10, 2024 · 5 comments
Open

2.0.0b10 - ValueError when using --repo relative path #8372

bket opened this issue Sep 10, 2024 · 5 comments
Milestone

Comments

@bket
Copy link
Contributor

bket commented Sep 10, 2024

Have you checked borgbackup docs, FAQ, and open GitHub issues?

Yes

Is this a BUG / ISSUE report or a QUESTION?

Bug

System information. For client/server mode post info for both machines.

Your borg version (borg version)

2.0.0b10 / 2.0.0b10

Operating system (distribution) and version.

OpenBSD amd64 current

Full borg commandline that lead to the problem (leave away excludes and passwords)

borg repo-create -e repokey-aes-ocb --repo test

Describe the problem you're observing.

borg repo-create --repo does not like relative paths as shown below. Absolute path is OK. This behavior differs from borg-2.0.0b9 as borg rcreate --repo does accepts relative paths. This issue occurs with all borg-2.0.0b10 commands that accept --repo.

kerberos$ pwd
/tmp
kerberos$  borg repo-create -e repokey-aes-ocb --repo test
Local Exception

Error:

ValueError: Invalid Backend Storage URL: file://test

If reporting bugs, please include the following:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/borg/archiver/__init__.py", line 622, in main
    exit_code = archiver.run(args)
                ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/borg/archiver/__init__.py", line 516, in run
    rc = func(args)
         ^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/borg/archiver/_common.py", line 138, in wrapper
    repository = get_repository(
                 ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/borg/archiver/_common.py", line 50, in get_repository
    repository = Repository(
                 ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/borg/repository.py", line 107, in __init__
    self.store = Store(url, levels={"config/": [0], "data/": [2]})
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/borgstore/store.py", line 42, in __init__
    raise ValueError(f"Invalid Backend Storage URL: {url}")
ValueError: Invalid Backend Storage URL: file://test

Platform: OpenBSD kerberos.lan 7.6 GENERIC.MP#101 amd64
Borg: 2.0.0b10  Python: CPython 3.11.9 msgpack: 1.0.8 fuse: None [pyfuse3,llfuse]
PID: 37208  CWD: /tmp
sys.argv: ['/usr/local/bin/borg', 'repo-create', '-e', 'repokey-aes-ocb', '--repo', 'test']
SSH_ORIGINAL_COMMAND: None


kerberos$  borg repo-create -e repokey-aes-ocb --repo /tmp/test
Enter new passphrase:
@bket bket changed the title borg-2.0.0b10 - ValueError when creating new repo using relative path 2.0.0b10 - ValueError when using relative path Sep 10, 2024
@bket bket changed the title 2.0.0b10 - ValueError when using relative path 2.0.0b10 - ValueError when using --repo relative path Sep 10, 2024
@ThomasWaldmann ThomasWaldmann added this to the 2.0.0b11 milestone Sep 10, 2024
@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Sep 10, 2024

It's because the borgstore code expects an URL and is unhappy with file://relativepath, because it only expects file:///absolutepath.

Not sure how to fix that, I think we also need to be consistent with general url syntax protocol://server/path which always has an absolute path.

https://en.wikipedia.org/wiki/File_URI_scheme

For ssh:, borg introduced that ssh://user@host/./relativepath hack, shall we also do it like that in borgstore with file:?

@ThomasWaldmann
Copy link
Member

Hmm, guess I could add a temporary hack to borgstore file backend to also accept file://relpath for now.

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Sep 10, 2024

Added a hack to work around this issue in borgstore 0.0.2:

https://github.com/borgbackup/borgstore/blob/master/CHANGES.rst

@bket
Copy link
Contributor Author

bket commented Sep 10, 2024

Hack works for me. Thank you, and sorry for not noticing that it is an issue related to borgstore.

@ThomasWaldmann
Copy link
Member

@bket no problem :)

Leaving this open, guess we still have to think about the file URL.

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

No branches or pull requests

2 participants