I’ve been experiencing recurring issues with my Nextcloud AIO backups. My setup involves using an external drive mounted at /mnt/backup
on Linux Mint. Everything works fine initially, but after about two weeks, the backups start failing.
I suspect the issue lies with the OS unmounting the external drive after some time, which causes the backup service to fail. However, even after remounting the drive and attempting to restart the backup service, it still doesn’t work. The backup log provides the following error(s):
> 2024-12-30T19:51:13.057521256Z Failed to create/acquire the lock /mnt/borgbackup/borg/lock.exclusive ([Errno 5] I/O error: '/mnt/borgbackup/borg/lock.exclusive.delo_eji.tmp').
> 2024-12-30T19:51:13.057581492Z Traceback (most recent call last):
> 2024-12-30T19:51:13.057586579Z File "/usr/lib/python3.12/site-packages/borg/archiver.py", line 5401, in main
> 2024-12-30T19:51:13.057590389Z exit_code = archiver.run(args)
> 2024-12-30T19:51:13.057593577Z ^^^^^^^^^^^^^^^^^^
> 2024-12-30T19:51:13.057596597Z File "/usr/lib/python3.12/site-packages/borg/archiver.py", line 5321, in run
> 2024-12-30T19:51:13.057599801Z return set_ec(func(args))
> 2024-12-30T19:51:13.057602907Z ^^^^^^^^^^
> 2024-12-30T19:51:13.057605928Z File "/usr/lib/python3.12/site-packages/borg/archiver.py", line 175, in wrapper
> 2024-12-30T19:51:13.057609083Z with repository:
> 2024-12-30T19:51:13.057611978Z ^^^^^^^^^^
> 2024-12-30T19:51:13.057614947Z File "/usr/lib/python3.12/site-packages/borg/repository.py", line 203, in __enter__
> 2024-12-30T19:51:13.057618182Z self.open(self.path, bool(self.exclusive), lock_wait=self.lock_wait, lock=self.do_lock)
> 2024-12-30T19:51:13.057621454Z File "/usr/lib/python3.12/site-packages/borg/repository.py", line 435, in open
> 2024-12-30T19:51:13.057624658Z self.lock = Lock(os.path.join(path, 'lock'), exclusive, timeout=lock_wait).acquire()
> 2024-12-30T19:51:13.057627861Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 2024-12-30T19:51:13.057631054Z File "/usr/lib/python3.12/site-packages/borg/locking.py", line 392, in acquire
> 2024-12-30T19:51:13.057634303Z with self._lock:
> 2024-12-30T19:51:13.057637305Z ^^^^^^^^^^
> 2024-12-30T19:51:13.057640328Z File "/usr/lib/python3.12/site-packages/borg/locking.py", line 115, in __enter__
> 2024-12-30T19:51:13.057643556Z return self.acquire()
> 2024-12-30T19:51:13.057646628Z ^^^^^^^^^^^^^^
> 2024-12-30T19:51:13.057649647Z File "/usr/lib/python3.12/site-packages/borg/locking.py", line 137, in acquire
> 2024-12-30T19:51:13.057652872Z raise LockFailed(self.path, str(err)) from None
> 2024-12-30T19:51:13.057656101Z borg.locking.LockFailed: Failed to create/acquire the lock /mnt/borgbackup/borg/lock.exclusive ([Errno 5] I/O error: '/mnt/borgbackup/borg/lock.exclusive.delo_eji.tmp').
> 2024-12-30T19:51:13.057659590Z
> 2024-12-30T19:51:13.057662606Z Platform: Linux d2e4507a0d64 5.15.0-130-generic #140-Ubuntu SMP Wed Dec 18 17:59:53 UTC 2024 x86_64
> 2024-12-30T19:51:13.057665902Z Linux: Unknown Linux
> 2024-12-30T19:51:13.057668924Z Borg: 1.2.8 Python: CPython 3.12.8 msgpack: 1.0.8 fuse: llfuse 1.5.0 [pyfuse3,llfuse]
> 2024-12-30T19:51:13.057672181Z PID: 34 CWD: /
> 2024-12-30T19:51:13.057675249Z sys.argv: ['/usr/bin/borg', 'info']
> 2024-12-30T19:51:13.057678386Z SSH_ORIGINAL_COMMAND: None
> 2024-12-30T19:51:13.057686540Z
> 2024-12-30T19:51:13.084431940Z Borg could not get info from the targeted directory.
> 2024-12-30T19:51:13.084459282Z This might happen if the targeted directory is located on an external drive and the drive not connected anymore. You should check this.
> 2024-12-30T19:51:13.084461341Z If you instead want to initialize a new backup repository, you may delete the 'borg.config' file that is stored in the mastercontainer volume manually, which will allow you to initialize a new borg repository in the chosen directory:
> 2024-12-30T19:51:13.084463729Z sudo docker exec nextcloud-aio-mastercontainer rm /mnt/docker-aio-config/data/borg.config
If anyone has encountered similar issues or has suggestions for troubleshooting, I’d greatly appreciate your input!