Skip to content

Error: Failed to create/acquire the lock #3191

Description

@Troyciv

I accidentally disconnected my storage device during backup. I got the following error:


Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 72, in __del__
    self.close()
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 190, in close
    self.io.close()
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 586, in close
    self.close_segment()
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 822, in close_segment
    sync_dir(os.path.dirname(self._write_fd.name))
  File "/usr/lib/python3/dist-packages/borg/platform.py", line 8, in sync_dir
    fd = os.open(path, os.O_RDONLY)
FileNotFoundError: [Errno 2] No such file or directory: '/media/user/Backup/Backup/data/1'
Local Exception.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 85, in wrapper
    return method(self, args, repository=repository, **kwargs)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 249, in do_create
    create_inner(archive, cache)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 223, in create_inner
    read_special=args.read_special, dry_run=dry_run)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 303, in _process
    read_special=read_special, dry_run=dry_run)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 303, in _process
    read_special=read_special, dry_run=dry_run)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 303, in _process
    read_special=read_special, dry_run=dry_run)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 303, in _process
    read_special=read_special, dry_run=dry_run)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 277, in _process
    status = archive.process_file(path, st, cache, self.ignore_inode)
  File "/usr/lib/python3/dist-packages/borg/archive.py", line 683, in process_file
    chunks.append(cache.add_chunk(self.key.id_hash(chunk), chunk, self.stats))
  File "/usr/lib/python3/dist-packages/borg/cache.py", line 371, in add_chunk
    self.repository.put(id, data, wait=False)
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 535, in put
    segment, offset = self.io.write_put(id, data)
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 784, in write_put
    fd = self.get_write_fd(raise_full=raise_full)
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 662, in get_write_fd
    self.close_segment()
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 816, in close_segment
    os.fsync(self._write_fd.fileno())
OSError: [Errno 5] Input/output error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 1684, in main
    exit_code = archiver.run(args)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 1621, in run
    return args.func(args)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 85, in wrapper
    return method(self, args, repository=repository, **kwargs)
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 94, in __exit__
    self.close()
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 190, in close
    self.io.close()
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 586, in close
    self.close_segment()
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 816, in close_segment
    os.fsync(self._write_fd.fileno())
OSError: [Errno 5] Input/output error

Platform: Linux ThinkPad 4.4.0-96-generic #119-Ubuntu SMP Tue Sep 12 14:59:54 UTC 2017 x86_64 x86_64
Linux: Ubuntu 16.04 xenial
Borg: 1.0.7  Python: CPython 3.5.2
PID: 16056  CWD: /home/user/.local/share/Anki2/User 1/collection.media
sys.argv: ['/usr/bin/borg', 'create', '--info', '--stats', '--progress', '--show-rc', '--compression', 'lz4', '/media/user/Backup/Backup/::{hostname}-{now:%Y-%m-%d}', '/home', '--exclude', '/home/*/.cache', '--exclude', '/home/*/.local/share/Trash', '--exclude', '/home/*/.thumbnails', '--exclude', '/home/*/VirtualBox VMs', '--exclude', '/home/user/Dropbox', '--exclude', '/home/user/Steam', '--exclude', '/home/user/.steam', '--exclude', '/home/user/.www.kiwix.org']
SSH_ORIGINAL_COMMAND: None

terminating with error status, rc 2
Repository /media/user/Backup/Backup does not exist.
terminating with error status, rc 2

Now when I try to run borg again, I get the following:


Failed to create/acquire the lock /media/user/Backup/Backup/lock.exclusive (timeout).
terminating with error status, rc 2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions