borgbackup / borg

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

setting storage_quota to 0 (unlimited) cli doesnt work #8499

Open someone-somenet-org opened 6 days ago

someone-somenet-org commented 6 days ago

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

Yes.

Is this a BUG / ISSUE report or a QUESTION?

Bug + Docs issue.

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

Your borg version (borg -V).

borg 1.2.8

Operating system (distribution) and version.

Platform: Linux t480.l 6.10.11+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.10.11-1~bpo12+1 (2024-10-03) x86_64

Describe the problem you're observing.

The docs say:

The repository quota size is reached, what can I do?
The simplest solution is to increase or disable the quota and resume the backup:

borg config /path/to/repo storage_quota 0

but running borg config . storage_quota 0 gives me:

someone@localhost ~/test % borg config . storage_quota 0 
Local Exception
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 5401, in main
    exit_code = archiver.run(args)
                ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 5321, in run
    return set_ec(func(args))
                  ^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 190, in wrapper
    return method(self, args, repository=repository, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 2032, in do_config
    validate(section, name, args.value)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 1944, in repo_validate
    raise ValueError('Invalid value: storage_quota < 10M')
ValueError: Invalid value: storage_quota < 10M

Platform: Linux t480.l 6.10.11+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.10.11-1~bpo12+1 (2024-10-03) x86_64
Linux: Unknown Linux  
Borg: 1.2.8  Python: CPython 3.11.2 msgpack: 1.0.3 fuse: pyfuse3 3.2.1 [pyfuse3,llfuse]
PID: 601581  CWD: /home/someone/test
sys.argv: ['/usr/bin/borg', 'config', '.', 'storage_quota', '0']
SSH_ORIGINAL_COMMAND: None

When i do borg config . storage_quota -d then borg config . -l shows

[repository]
version = 1
segments_per_dir = 1000
max_segment_size = 524288000
storage_quota = False
additional_free_space = 0
append_only = 0

Which is not the default of 0 and possibly has unknown implications later on.

ThomasWaldmann commented 6 days ago

Yeah, looks like there is a bug there.

That check for less than 10M was added late because people forgot the "M" and set their repos to unpractically low quota (assuming that borg defaults to some big unit if no unit is given).

Guess it was overlooked that 0 is a useful value for disabling the quota.

ThomasWaldmann commented 6 days ago

BTW, borg config is a bit problematic and maybe superfluous anyway:

someone-somenet-org commented 6 days ago

config_read_only=True for remote repos?

ThomasWaldmann commented 6 days ago

The "problem" is that when using a borg repo via ssh, the repository code is executed LOCALLY on the server.

Also, considering that borg2 will work very differently anyway, I don't think there will be any "new features" in borg config in 1.x.