Skip to content

Gracefully Handle missing mounted drive #2341

@quintuple-lained

Description

@quintuple-lained

Description

When the backup repo is located on an external drive that is not mounted at scheduled backup time vorta ungracefully fails and produces this ugly error

Image

Reproduction

  • I tried to reproduce the issue.
  • I was able to reproduce the issue.

OS

(k)ubuntu 25.10, DankMaterialShell v1.2.2/Niri 25.11 (this also happened on KDE and as such is most likely DE independent)

Version of Vorta

0.10.3(-1)

What did you install Vorta with?

Distribution package

Version of Borg

1.4.1

Logs

2026-01-15 08:40:24,528 - vorta.scheduler - INFO - Setting timer for profile 1
2026-01-15 08:40:24,529 - vorta.scheduler - DEBUG - Catching up by running job for Default (1)
2026-01-15 08:40:24,529 - vorta.scheduler - INFO - Starting background backup for Default
2026-01-15 08:40:24,529 - vorta.notifications - DEBUG - success notifications suppressed
2026-01-15 08:40:24,530 - vorta.keyring.abc - DEBUG - No module named 'objc'
2026-01-15 08:40:24,530 - asyncio - DEBUG - Using selector: EpollSelector
2026-01-15 08:40:24,531 - vorta.keyring.abc - DEBUG - Using VortaSecretStorageKeyring
2026-01-15 08:40:24,531 - vorta.borg.borg_job - DEBUG - Using VortaSecretStorageKeyring keyring to store passwords.
2026-01-15 08:40:24,532 - asyncio - DEBUG - Using selector: EpollSelector
2026-01-15 08:40:24,533 - vorta.keyring.secretstorage - DEBUG - Found 1 passwords matching repo URL.
2026-01-15 08:40:24,533 - vorta.keyring.secretstorage - DEBUG - Retrieved password for repo /mnt/backup
2026-01-15 08:40:24,546 - vorta.scheduler - INFO - Preparation for backup successful.
2026-01-15 08:40:24,546 - vorta.borg.jobs_manager - DEBUG - Add job for site 1
2026-01-15 08:40:24,547 - vorta.borg.jobs_manager - DEBUG - Start job on site: 1
2026-01-15 08:40:24,619 - vorta.borg.borg_job - INFO - Running command /usr/bin/borg create --list --progress --info --log-json --json --filter=AM -C lz4 --exclude-if-present .nobackup --exclude-from /tmp/tmpd0nosr_9 /mnt/backup::zoepad-2026-01-15-084024 /home/zoe
2026-01-15 08:40:24,799 - vorta.borg.borg_job - ERROR - Failed to create/acquire the lock /mnt/backup/lock.exclusive ([Errno 13] Permission denied: '/mnt/backup/lock.exclusive.piwzyjk0.tmp').
2026-01-15 08:40:24,800 - vorta.borg.borg_job - ERROR - Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 5465, in main
    exit_code = archiver.run(args)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 5383, in run
    rc = func(args)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 185, in wrapper
    with repository:
         ^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 217, in __enter__
    self.open(self.path, bool(self.exclusive), lock_wait=self.lock_wait, lock=self.do_lock)
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 465, in open
    self.lock = Lock(os.path.join(path, 'lock'), exclusive, timeout=lock_wait).acquire()
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/borg/locking.py", line 395, in acquire
    self._wait_for_readers_finishing(remove, sleep)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/borg/locking.py", line 408, in _wait_for_readers_finishing
    self._lock.acquire()
    ~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/borg/locking.py", line 143, in acquire
    raise LockFailed(self.path, str(err)) from None
borg.locking.LockFailed: Failed to create/acquire the lock /mnt/backup/lock.exclusive ([Errno 13] Permission denied: '/mnt/backup/lock.exclusive.piwzyjk0.tmp').

Platform: Linux zoepad 6.17.0-8-generic #8-Ubuntu SMP PREEMPT_DYNAMIC Fri Nov 14 21:44:46 UTC 2025 x86_64
Linux: Unknown Linux  
Borg: 1.4.1  Python: CPython 3.13.7 msgpack: 1.0.3 fuse: pyfuse3 3.4.0 [pyfuse3,llfuse]
PID: 46953  CWD: /home/zoe
sys.argv: ['/usr/bin/borg', 'create', '--list', '--progress', '--info', '--log-json', '--json', '--filter=AM', '-C', 'lz4', '--exclude-if-present', '.nobackup', '--exclude-from', '/tmp/tmpd0nosr_9', '/mnt/backup::zoepad-2026-01-15-084024', '/home/zoe']
SSH_ORIGINAL_COMMAND: None

2026-01-15 08:40:24,930 - vorta.borg.jobs_manager - DEBUG - Finish job for site: 1
2026-01-15 08:40:24,930 - vorta.borg.jobs_manager - DEBUG - No more jobs for site: 1
2026-01-15 08:40:24,931 - vorta.scheduler - INFO - Setting timer for profile 1
2026-01-15 08:40:24,931 - vorta.scheduler - DEBUG - Catching up by running job for Default (1)
2026-01-15 08:40:24,932 - vorta.scheduler - INFO - Starting background backup for Default
2026-01-15 08:40:24,933 - vorta.notifications - DEBUG - success notifications suppressed
2026-01-15 08:40:24,934 - vorta.keyring.abc - DEBUG - No module named 'objc'
2026-01-15 08:40:24,935 - asyncio - DEBUG - Using selector: EpollSelector
2026-01-15 08:40:24,935 - vorta.keyring.abc - DEBUG - Using VortaSecretStorageKeyring
2026-01-15 08:40:24,935 - vorta.borg.borg_job - DEBUG - Using VortaSecretStorageKeyring keyring to store passwords.
2026-01-15 08:40:24,936 - asyncio - DEBUG - Using selector: EpollSelector
2026-01-15 08:40:24,949 - vorta.keyring.secretstorage - DEBUG - Found 1 passwords matching repo URL.
2026-01-15 08:40:24,949 - vorta.keyring.secretstorage - DEBUG - Retrieved password for repo /mnt/backup
2026-01-15 08:40:24,965 - vorta.scheduler - INFO - Preparation for backup successful.
2026-01-15 08:40:24,965 - vorta.borg.jobs_manager - DEBUG - Add job for site 1
2026-01-15 08:40:24,965 - vorta.borg.jobs_manager - DEBUG - Start job on site: 1
2026-01-15 08:40:24,972 - vorta.borg.borg_job - INFO - Running command /usr/bin/borg create --list --progress --info --log-json --json --filter=AM -C lz4 --exclude-if-present .nobackup --exclude-from /tmp/tmpklryj1m_ /mnt/backup::zoepad-2026-01-15-084024 /home/zoe
2026-01-15 08:40:25,077 - vorta.notifications - DEBUG - notification not suppressed
2026-01-15 08:40:25,089 - vorta.scheduler - ERROR - Error during backup creation.
2026-01-15 08:40:25,090 - vorta.scheduler - DEBUG - Paused 1 until 2026-01-15 08:50:25
2026-01-15 08:40:25,091 - vorta.scheduler - DEBUG - Nothing scheduled for profile 1 because of timeout until 2026-01-15 08:50:25.
2026-01-15 08:40:25,181 - vorta.borg.borg_job - ERROR - Failed to create/acquire the lock /mnt/backup/lock.exclusive ([Errno 13] Permission denied: '/mnt/backup/lock.exclusive.8rv22_z_.tmp').
2026-01-15 08:40:25,183 - vorta.borg.borg_job - ERROR - Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 5465, in main
    exit_code = archiver.run(args)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 5383, in run
    rc = func(args)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 185, in wrapper
    with repository:
         ^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 217, in __enter__
    self.open(self.path, bool(self.exclusive), lock_wait=self.lock_wait, lock=self.do_lock)
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 465, in open
    self.lock = Lock(os.path.join(path, 'lock'), exclusive, timeout=lock_wait).acquire()
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/borg/locking.py", line 395, in acquire
    self._wait_for_readers_finishing(remove, sleep)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/borg/locking.py", line 408, in _wait_for_readers_finishing
    self._lock.acquire()
    ~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/borg/locking.py", line 143, in acquire
    raise LockFailed(self.path, str(err)) from None
borg.locking.LockFailed: Failed to create/acquire the lock /mnt/backup/lock.exclusive ([Errno 13] Permission denied: '/mnt/backup/lock.exclusive.8rv22_z_.tmp').

Platform: Linux zoepad 6.17.0-8-generic #8-Ubuntu SMP PREEMPT_DYNAMIC Fri Nov 14 21:44:46 UTC 2025 x86_64
Linux: Unknown Linux  
Borg: 1.4.1  Python: CPython 3.13.7 msgpack: 1.0.3 fuse: pyfuse3 3.4.0 [pyfuse3,llfuse]
PID: 47001  CWD: /home/zoe
sys.argv: ['/usr/bin/borg', 'create', '--list', '--progress', '--info', '--log-json', '--json', '--filter=AM', '-C', 'lz4', '--exclude-if-present', '.nobackup', '--exclude-from', '/tmp/tmpklryj1m_', '/mnt/backup::zoepad-2026-01-15-084024', '/home/zoe']
SSH_ORIGINAL_COMMAND: None

2026-01-15 08:40:25,312 - vorta.scheduler - DEBUG - Nothing scheduled for profile 1 because of timeout until 2026-01-15 08:50:25.
2026-01-15 08:40:25,312 - vorta.borg.jobs_manager - DEBUG - Finish job for site: 1
2026-01-15 08:40:25,312 - vorta.borg.jobs_manager - DEBUG - No more jobs for site: 1
2026-01-15 08:40:25,419 - vorta.notifications - DEBUG - notification not suppressed
2026-01-15 08:40:25,421 - vorta.scheduler - ERROR - Error during backup creation.
2026-01-15 08:40:25,421 - vorta.scheduler - DEBUG - Override existing timeout for profile 1
2026-01-15 08:40:25,421 - vorta.scheduler - DEBUG - Paused 1 until 2026-01-15 08:50:25
2026-01-15 08:40:25,422 - vorta.scheduler - DEBUG - Nothing scheduled for profile 1 because of timeout until 2026-01-15 08:50:25.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:enhancementImprovement of an existing function

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions