borg icon indicating copy to clipboard operation
borg copied to clipboard

As of 1.2.0, the ssh relative path hack "/./" works for most actions but not "borg init"

Open andrewgdotcom opened this issue 1 year ago • 3 comments

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

1.2.0

Operating system (distribution) and version.

Ubuntu Jammy

Hardware / network configuration, and filesystems used.

ssh to rsync.net

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

borg init -e keyfile ssh://[email protected]/./borg/REDACTED

Describe the problem you're observing.

I can correctly initialise a remote repository using absolute paths, but not relative paths. If using a relative path, I get the error:

Remote: FileNotFoundError: [Errno 2] No such file or directory: '/borg/REDACTED'

andrewgdotcom avatar May 01 '24 16:05 andrewgdotcom

That looks like the cwd is / at the moment of path resolution:

/ + ./borg/REDACTED == /borg/REDACTED

Usually, the cwd after a ssh login is the home directory of the user, not /.

ThomasWaldmann avatar May 01 '24 21:05 ThomasWaldmann

You say it works for some commands - for which commands does it work?

IIRC the code executed in borg for relative paths is always the same.

ThomasWaldmann avatar May 01 '24 21:05 ThomasWaldmann

If the borg directory does not exist yet, you need to use --make-parent-dirs.

borg creates the repo directory when initializing a new repo, but by default it won't create parent directories of it.

ThomasWaldmann avatar May 01 '24 21:05 ThomasWaldmann

Hi, sorry for the delay. I'm afraid this was due to a misunderstanding of the error message -- our provider requires us to set BORG_REMOTE_PATH to use the latest borg executable on the server side, and this was omitted from some of our invocations. It is not immediately obvious that the full URL path is also parsed by the remote borg, and it was the older remote borg that threw the error.

This issue can be closed. Apologies for the confusion.

andrewgdotcom avatar May 03 '24 15:05 andrewgdotcom