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

Checkpoint archive name longer than cli argument validator allows #8322

Open
ThomasWaldmann opened this issue Aug 4, 2024 Discussed in #8319 · 4 comments
Open

Checkpoint archive name longer than cli argument validator allows #8322

ThomasWaldmann opened this issue Aug 4, 2024 Discussed in #8319 · 4 comments
Milestone

Comments

@ThomasWaldmann
Copy link
Member

Discussed in #8319

Originally posted by SpiritInAShell August 4, 2024
user too tired to evaluate this properly (and doesn't want to spam Issues (again) with user error)

Still, if this was a BUG, it should be addressed soon.

tl;dr:

with borg2 v2.0.0b9 it is possible to (unpurposefully) create archive names exceeding length of 200chars, by interrupting the process, where archive name will be extended by string .checkpoint which causes length to exceed 200chars. That archive cannot be accessed by borg list <too long archive name>.

I roughly tried this with borg import-tar aswell as borg create where I interrupted the process after a minute to force creating a .checkpoint

I did some short testing with newly created empty borg2 repos. It seems to be true for these, too.

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

Yes

Is this a BUG / ISSUE report or a QUESTION?

BUG (likely)

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

Your borg version (borg -V).

> borg2beta version # just a symbolic link
2.0.0b9 / 2.0.0b9

Operating system (distribution) and version.

> uname -a
Linux hp-server 5.16.0-0.bpo.4-amd64 #1 SMP PREEMPT Debian 5.16.12-1~bpo11+1 (2022-03-08) x86_64 GNU/Linux

How much data is handled by borg?

A: about 400GiB on a sftp share
B: empty new created repos on ext4 filesystem

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

borg2beta import-tar <...> "<archive name total length 197> -  < export.tar
# pressed ctrl+c or other cause of interruption
borg2beta list --bypass-lock --short --repo=/<path to a read-only snapshot>/<myRepo>.borg2/ <archivename length total 208 chars ending with .checkpoint.checkpoint>

Describe the problem you're observing.

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

Yes.

Include any warning/errors/backtraces from the system logs

@ThomasWaldmann
Copy link
Member Author

TODO:

  • check the background of that 200 chars limit
  • if there is no problem when slightly going over the limit, fix the validator so that it ignores the length of ".checkpoint*".

@ThomasWaldmann ThomasWaldmann added this to the 2.0.0rc1 milestone Aug 4, 2024
@infectormp
Copy link
Contributor

infectormp commented Aug 5, 2024

Linux have 2 variables:
#define NAME_MAX 255 /* # chars in a file name /
#define PATH_MAX 4096 /
# chars in a path name including nul */

BSD have same NAME_MAX limit as Linux, but PATH_MAX is limited to 1024 /* max bytes in pathname */

Microsoft Windows has a MAX_PATH limit of 260 characters, but starting from Windows 10, version 1607, MAX_PATH limitations have been removed from many common Win32 file and directory functions.

@ThomasWaldmann
Copy link
Member Author

@infectormp The archive name is not present in the filesystem, neither as path, nor as filename.

borg stores the archive names within the repository manifest and within the archive metadata (and both are stored into segment files).

So, the limitation in length is rather as a precautionary measure - to not have to deal with too long archive names in case there is a restriction some day.

@ThomasWaldmann
Copy link
Member Author

#8332 might "fix" this in master branch, because it does not do checkpointing any more (because there is no need to for the way it works with that PR's code).

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

No branches or pull requests

2 participants