We've been running borg for several months in our environment and the
most common failure we see is a "MemoryError". We use backupninja to
manage the backup jobs and it produces the following output.
> Info: Repository was already initialized
> Error: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/borg/remote.py", line 248, in serve res = f(**args) File "/usr/lib/python3/dist-packages/borg/repository.py", line 1118, in delete self.prepare_txn(self.get_transaction_id()) File "/usr/lib/python3/dist-packages/borg/repository.py", line 498, in prepare_txn self.index = self.open_index(transaction_id, auto_recover=False) File "/usr/lib/python3/dist-packages/borg/repository.py", line 466, in open_index return NSIndex.read(fd) File "src/borg/hashindex.pyx", line 113, in borg.hashindex.IndexBase.read (src/borg/hashindex.c:1916) File "src/borg/hashindex.pyx", line 100, in borg.hashindex.IndexBase.__cinit__ (src/borg/hashindex.c:1660) File "/usr/lib/python3/dist-packages/borg/crypto/file_integrity.py", line 32, in read return self.fd.read(n) File "/usr/lib/python3/dist-packages/borg/crypto/file_integrity.py", line 82, in read data = super().read(n) File "/usr/lib/python3/dist-packages/borg/crypto/file_integrity
> .py", line 32, in read return self.fd.read(n) MemoryError Borg server: Platform: Linux $HOSTNAME 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u3 (2019-06-16) x86_64 Borg server: Linux: debian 9.9 Borg server: Borg: 1.1.9 Python: CPython 3.5.3 Borg server: PID: 32750 CWD: $BACKUP_PATH Borg server: sys.argv: ['/usr/bin/borg', 'serve', '--umask=077'] Borg server: SSH_ORIGINAL_COMMAND: None Platform: Linux $HOSTNAME 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u3 (2019-06-16) x86_64 Linux: debian 9.9 Borg: 1.1.9 Python: CPython 3.5.3 PID: 7116 CWD: /root sys.argv: ['/usr/bin/borg', 'create', '--stats', '--compression', 'lz4', '--exclude', '/home/postgresql', 'ssh://$USERNAME@$HOSTNAME/$BACKUP_PATH::{now:%Y-%m-%dT%H:%M:%S}', '/etc', '/home', '/var/backups/postgres'] SSH_ORIGINAL_COMMAND: None
Google yields limited results for the above error, it's not clear what
the issue is. We're assuming it means that the process is running out of
memory but this does not match what we see in our monitoring. While borg
often pushes memory usage to it's limit we see this error on machines
that have not used up their buffer or began using available swap yet.
I would appreciate if anyone had a better understanding of what was
happening here. Generally we can rerun the job and it'll be fine but
we'll see streaks of failures with this error message and we'd like to
minimize or avoid it entirely.
Thanks!
--
Eric Luther
Ops
Smartleaf Inc.