Borg Backup integrity check fails

Hi everyone,

for some reason my backup integrity check fails but im not really understanding why because i haven’t touched the installation for a while. Backup and Restore seams to work so far.
This is the output from the log:

Checking the backup integrity...
Starting repository check
Old config file not securely erased on previous config update
Local Exception
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/borg/", line 5343, in main
    exit_code =
  File "/usr/lib/python3.11/site-packages/borg/", line 5263, in run
    return set_ec(func(args))
  File "/usr/lib/python3.11/site-packages/borg/", line 189, in wrapper
    return method(self, args, repository=repository, **kwargs)
  File "/usr/lib/python3.11/site-packages/borg/", line 349, in do_check
    if not repository.check(, save_space=args.save_space, max_duration=args.max_duration):
  File "/usr/lib/python3.11/site-packages/borg/", line 1032, in check
    self.save_config(self.path, self.config)
  File "/usr/lib/python3.11/site-packages/borg/", line 308, in save_config
    secure_erase(old_config_path, avoid_collateral_damage=True)
  File "/usr/lib/python3.11/site-packages/borg/helpers/", line 199, in secure_erase
    with open(path, 'r+b') as fd:
OSError: [Errno 22] Invalid argument: '/mnt/borgbackup/borg/config.old'

Platform: Linux 995cfbbed934 5.15.0-102-generic #112-Ubuntu SMP Tue Mar 5 16:50:32 UTC 2024 x86_64
Linux: Unknown Linux  
Borg: 1.2.7  Python: CPython 3.11.8 msgpack: 1.0.6 fuse: llfuse 1.5.0 [pyfuse3,llfuse]
PID: 28  CWD: /
sys.argv: ['/usr/bin/borg', 'check', '-v', '--verify-data', '/mnt/borgbackup/borg']

Some errors were found while checking the backup integrity!
Check the AIO interface for advices on how to proceed now!


It looks like you need to remove the config.old file

Hi szaimen,

is there a special way this needs to be done (execpt simply deleting it)?


I guess you need to delete it, yes.