Skip to content

FileNotFoundError thrown on borg create: hints-file missing #6331

@maximilian-walter

Description

@maximilian-walter

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

Yes

Is this a BUG / ISSUE report or a QUESTION?

ISSUE / QUESTION

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

Your borg version (borg -V).

borg 1.1.16

Operating system (distribution) and version.

Debian 11.2 "Bullseye"

Hardware / network configuration, and filesystems used.

Asus PN41 Mini-PC with a Samsung 970 EVO Plus 2TB, local backup, no network involved
ext4 with LVM (encrypted)

How much data is handled by borg?

300GB

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

/usr/bin/borg create --compression zstd --exclude-caches --exclude '*/.Trash-*' '/var/borg/local::{hostname}-{now:%Y-%m-%d-%H%M%S}' '/var/nas' '/var/www'

Describe the problem you're observing.

I use borg to create hourly backups on my NAS-server. Some times borg create throws an Exception, because a hints-file (like hints.2763.tmp) was not found inside the repository. On the next run, I get some warnings that segments are not found, but listed in compaction data (see logs below). The following runs never return any errors.

The data on the NAS rarly changes and the backuped files and the repository are stored on the same fast NVMe (in case you are wondering: I use the backup to be able to undo changes, e.g. files overwritten by mistake). The borg create command runs only for seconds, but it is possible that files are changed while the backup runs.

Are these Exceptions critical? What can I do to avoid them?

The same server also uses borg to backup the data to an external cloud-storage. This backup only runs once a day and never returns any errors.

Thanks for your advice!

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

No, the Exception occurs only sporadic.

I run borg check --verify-data on the repository and it did not found any errors. I can also mount the repository and restore data from it.

Include any warning/errors/backtraces from the system logs

Run with error:

Local Exception
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 4690, in main
    exit_code = archiver.run(args)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 4622, in run
    return set_ec(func(args))
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 177, in wrapper
    return method(self, args, repository=repository, **kwargs)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 595, in do_create
    create_inner(archive, cache)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 560, in create_inner
    archive.save(comment=args.comment, timestamp=args.timestamp)
  File "/usr/lib/python3/dist-packages/borg/archive.py", line 530, in save
    self.repository.commit()
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 476, in commit
    self.write_index()
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 637, in write_index
    rename_tmp(hints_file)
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 587, in rename_tmp
    os.rename(file + '.tmp', file)
FileNotFoundError: [Errno 2] No such file or directory: '/var/borg/local/hints.2763.tmp' -> '/var/borg/local/hints.2763'

Platform: Linux server 5.10.0-11-amd64 #1 SMP Debian 5.10.92-1 (2022-01-18) x86_64
Linux: Unknown Linux  
Borg: 1.1.16  Python: CPython 3.9.2 msgpack: 0.5.6.+borg1
PID: 519872  CWD: /root
sys.argv: ['/usr/bin/borg', 'create', '--compression', 'zstd', '--exclude-caches', '--exclude', '*/.Trash-*', '/var/borg/local::{hostname}-{now:%Y-%m-%d-%H%M%S}', '/var/nas', '/var/www']
SSH_ORIGINAL_COMMAND: None

The following run:

segment 2758 not found, but listed in compaction data
segment 2760 not found, but listed in compaction data

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions