borgbackup / borg

Deduplicating archiver with compression and authenticated encryption.
https://www.borgbackup.org/
Other
10.74k stars 734 forks source link

`borg benchmark crud` does not respect `--remote-path` #8099

Closed ollyollyollyltd closed 4 months ago

ollyollyollyltd commented 4 months ago

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 -V).

Local = 1.2.7 Remote 0.2.9 / 1.2.7

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

borg --remote-path borg1 benchmark crud user@user.rsync.net:test

Describe the problem you're observing.

I am trying run a benchmark on an rsync.net server. rsync.net runs an outdated version of borg by default (0.2.9). In order to use v1.x the client is required to send --remote-path borg1 with each command.

If the argument is not set then a version mismatch warning is displayed.

When borg --remote-path borg1 benchmark crud user@user.rsync.net:test the version mismatch is displayed, despite setting the argument. This suggests that this command is not respecting the --remote-path argument and running the default borg path on the server, rather than the requested borg1.

In addition, I am getting a borg.repository.DoesNotExist: /test error, but this may be to do with the mismatched versions, so I figured I would work that out first then move on to that.

Can you reproduce the problem? If so, describe how. If not, describe troubleshooting steps you took before opening the issue.

borg --remote-path borg1 user@user.rsync.net:test
borg --remote-path borg1 benchmark crud user@user.rsync.net:test`

Include any warning/errors/backtraces from the system logs


$ borg --remote-path=borg1 init -e none ***@***.rsync.net:test
$ borg --remote-path=borg1 benchmark crud "***@***.rsync.net:./test" ./bm
Remote: Borg 0.29.0: exception in RPC call:
Remote: Traceback (most recent call last):
Remote:   File "/usr/home/kibab/borgbackup-0.29.0/borg/remote.py", line 96, in serve
Remote: TypeError: open() takes from 2 to 5 positional arguments but 7 were given
Remote: Command 'uname -p 2> /dev/null' is not in the allowed list.
Remote: Platform: FreeBSD ch-s014.rsync.net 13.1-RELEASE-p3 FreeBSD 13.1-RELEASE-p3 rsync_13_1 amd64
Remote: Python: CPython 3.4.3
Remote: 
Please note:
If you see a TypeError complaining about the number of positional arguments
given to open(), you can ignore it if it comes from a borg version < 1.0.7.
This TypeError is a cosmetic side effect of the compatibility code borg
clients >= 1.0.7 have to support older borg servers.
This problem will go away as soon as the server has been upgraded to 1.0.7+.
Remote: Borg 0.29.0: exception in RPC call:
Remote: Traceback (most recent call last):
Remote:   File "/usr/home/kibab/borgbackup-0.29.0/borg/remote.py", line 96, in serve
Remote:   File "/usr/home/kibab/borgbackup-0.29.0/borg/remote.py", line 121, in open
Remote:   File "/usr/home/kibab/borgbackup-0.29.0/borg/repository.py", line 63, in __init__
Remote:   File "/usr/home/kibab/borgbackup-0.29.0/borg/repository.py", line 139, in open
Remote: borg.repository.DoesNotExist: /test
Remote: Platform: FreeBSD ch-s014.rsync.net 13.1-RELEASE-p3 FreeBSD 13.1-RELEASE-p3 rsync_13_1 amd64
Remote: Python: CPython 3.4.3
Remote: 
Repository ssh://***@***.rsync.net/./test does not exist.
ThomasWaldmann commented 4 months ago

@ollyollyollyltd can you test the code from PR #8116?

The bug is due to the "borg benchmark crud" command internally generating specific new commands (like borg create, borg extract, borg delete) and these did not "inherit" any options yet.

I now implemented inheritance for --rsh and --remote-path because I guess these are the essential ones to support.

ollyollyollyltd commented 4 months ago

That seems to have done it:

$ borg --remote-path borg1 init -e none 'user@user.rsync.net:test'
$ borg --remote-path borg1 benchmark crud 'user@user.rsync.net:test' .
C-R-BIG           2.14 MB/s (10 * 100.00 MB random files: 467.73s)
R-R-BIG           6.35 MB/s (10 * 100.00 MB random files: 157.60s)
U-R-BIG         618.09 MB/s (10 * 100.00 MB random files: 1.62s)
D-R-BIG         782.72 MB/s (10 * 100.00 MB random files: 1.28s)
C-Z-MEDIUM      328.27 MB/s (1000 * 1.00 MB all-zero files: 3.05s)
R-Z-MEDIUM        6.41 MB/s (1000 * 1.00 MB all-zero files: 155.91s)
U-Z-MEDIUM      779.39 MB/s (1000 * 1.00 MB all-zero files: 1.28s)
D-Z-MEDIUM      716.05 MB/s (1000 * 1.00 MB all-zero files: 1.40s)
C-R-MEDIUM        2.14 MB/s (1000 * 1.00 MB random files: 467.16s)
R-R-MEDIUM        6.80 MB/s (1000 * 1.00 MB random files: 146.97s)
U-R-MEDIUM      718.51 MB/s (1000 * 1.00 MB random files: 1.39s)
D-R-MEDIUM      659.30 MB/s (1000 * 1.00 MB random files: 1.52s)
C-Z-SMALL        25.32 MB/s (10000 * 10.00 kB all-zero files: 3.95s)
R-Z-SMALL         5.54 MB/s (10000 * 10.00 kB all-zero files: 18.06s)
U-Z-SMALL        42.65 MB/s (10000 * 10.00 kB all-zero files: 2.34s)
D-Z-SMALL        62.93 MB/s (10000 * 10.00 kB all-zero files: 1.59s)
C-R-SMALL         2.01 MB/s (10000 * 10.00 kB random files: 49.73s)
R-R-SMALL         5.98 MB/s (10000 * 10.00 kB random files: 16.73s)
U-R-SMALL        44.05 MB/s (10000 * 10.00 kB random files: 2.27s)
D-R-SMALL        46.32 MB/s (10000 * 10.00 kB random files: 2.16s)

It has also solved the borg.repository.DoesNotExist: /test error I was seeing before, so presumably that was an artefact of the mismatched versions.

Great work! Let me know if you want me to test anything else against rsync.net.