Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Failed to acquire write lock" FUSE #317

Open
feboss opened this issue Jun 4, 2015 · 11 comments
Open

"Failed to acquire write lock" FUSE #317

feboss opened this issue Jun 4, 2015 · 11 comments

Comments

@feboss
Copy link

feboss commented Jun 4, 2015

I want backup in a ftp and i mount my ftp with curlftpfs. But i can't init.
This is the error i get
attic: Error: Failed to acquire write lock on test/config
what can i do?

@ThomasWaldmann
Copy link
Contributor

Likely your fs does not support fcntl.lockf (with LOCK_EX to get an exclusive lock).

An idea would be to implement (or reuse) a different way of locking, e.g. directory based.
portalocker?

@jasontbradshaw
Copy link

I'm getting the same error after running attic init on a repository located on a ZFS file system:

$ attic init test-repository
Initializing repository at "test-repository"
attic: Error: Failed to acquire write lock on test-repository/config

The repository appears to have been created even after the error, but attempting to attic create to it fails with the same error after a moment or two.

I would be happy to implement a directory-based locking mechanism, but pointers on where to start would be appreciated.

@ThomasWaldmann
Copy link
Contributor

@jasontbradshaw that was a locally mounted zfs? which OS precisely?

Just wondering: considering the amount of stuff ZFS does support, it would seem strange it does not support such simple things as fcntl.lockf.

@jasontbradshaw
Copy link

The ZFS volume is running on a different machine running FreeNAS 9.3 on my local network, and is mounted using NFSv3. My desktop (on which I was attempting to run attic) runs Arch Linux.

@jasontbradshaw
Copy link

Now that you mention it, NFS is probably the issue. However, this doesn't change the general problem that attic (apparently) requires a lock to operate, and can't reliably obtain one on all filesystems.

@ThomasWaldmann
Copy link
Contributor

Ah, NFS, that explains it.

For NFS, maybe running lockd would help?

About the state of locking in general: http://0pointer.de/blog/projects/locking.html

@ThomasWaldmann
Copy link
Contributor

@feboss @jasontbradshaw ^^^ can you try?

@feboss
Copy link
Author

feboss commented Jul 13, 2015

i installed borg with pip3.
get this:

root@server1:/mnt/ftpB# borg init b
Initializing repository at "b"
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/borg/helpers.py", line 50, in __init__
    fcntl.lockf(self.fd, fcntl.LOCK_EX)
OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/borg/archiver.py", line 857, in main
    exit_code = archiver.run(sys.argv[1:])
  File "/usr/local/lib/python3.4/dist-packages/borg/archiver.py", line 813, in run
    return args.func(args)
  File "/usr/local/lib/python3.4/dist-packages/borg/archiver.py", line 62, in do_init
    repository = self.open_repository(args.repository, create=True, exclusive=True)
  File "/usr/local/lib/python3.4/dist-packages/borg/archiver.py", line 37, in open_repository
    repository = Repository(location.path, create=create, exclusive=exclusive)
  File "/usr/local/lib/python3.4/dist-packages/borg/repository.py", line 59, in __init__
    self.open(path, exclusive)
  File "/usr/local/lib/python3.4/dist-packages/borg/repository.py", line 120, in open
    self.lock = UpgradableLock(os.path.join(path, 'config'), exclusive)
  File "/usr/local/lib/python3.4/dist-packages/borg/helpers.py", line 56, in __init__
    raise self.WriteLockFailed(self.path)
borg.helpers.WriteLockFailed: b/config
borg: Error: Failed to acquire write lock on b/config

@ThomasWaldmann
Copy link
Contributor

I meant the code from git (the new locking code is not on pypi yet).

@jasontbradshaw
Copy link

lockd already appears to be running on the FreeNAS box.

After installing attic manually from git (python setup.py install, etc.), I get the exact same error.

@ThomasWaldmann
Copy link
Contributor

I did the changes in borgbackup (a fork of attic): https://github.com/borgbackup/borg

Sorry for the confusion.

BTW, if you test the new code and have feedback for it, please use the issue tracker there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants