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

filelock error when using drake #26

Closed
mattwarkentin opened this issue Jun 22, 2020 · 14 comments
Closed

filelock error when using drake #26

mattwarkentin opened this issue Jun 22, 2020 · 14 comments

Comments

@mattwarkentin
Copy link

mattwarkentin commented Jun 22, 2020

Hi @gaborcsardi,

I am running into an issue when trying to use the {drake} package and it seems to be filelock related. The filelock error seems to be holding my drake project hostage, so to speak. I keep running into this error:

Error in filelock::lock(private$lock_file) : 
  Cannot lock file: '/Matt/.drake/drake/history/lock': Operation not supported
Error in filelock::unlock(lock) : 
  VECTOR_ELT() can only be applied to a 'list', not a 'closure'

I really don't know enough about how filelock is used internally for drake, but I have worked with @wlandau to try and get to the bottom of it by running different bits of code to rule-in and out some issues. All of that can be found here ropensci/drake#1280

I am happy to continue to do whatever I can to help work toward a solution. Thanks for your help.

@wlandau
Copy link

wlandau commented Jun 22, 2020

Thanks for posting. Would you share the same reprex and lock file you posted to drake's issue tracker?

@mattwarkentin
Copy link
Author

mattwarkentin commented Jun 22, 2020

Here is a zip file from my drake project containing the lock file:
https://github.com/ropensci/drake/files/4815500/history.zip

Here is a minimal example reproducing the error:

library(filelock)
lock <- lock(".drake/drake/history/lock")
unlock(lock)
Error in lock(".drake/drake/history/lock") : 
  Cannot lock file: '/Volumes/hung_lab/shared/Matt/deep-learning/.drake/drake/history/lock': Operation not supported
Error in unlock(lock) : 
  VECTOR_ELT() can only be applied to a 'list', not a 'closure'

@gaborcsardi
Copy link
Member

Well, sadly, that is not a reprex. I obviously do not have a .drake/drake/history/lock file.

@mattwarkentin
Copy link
Author

You do if you download the zip file I also attached!

@gaborcsardi
Copy link
Member

But I suspect that you are trying to create a lock file on some shared file system, and many of these, e.g. NFS, do not support locks.

@mattwarkentin
Copy link
Author

It is the network drive at my hospital, so I would assumed that is a shared file system as you describe. I am not sure what NFS is.

@gaborcsardi
Copy link
Member

gaborcsardi commented Jun 22, 2020

https://en.wikipedia.org/wiki/Network_File_System

If this is macOS or some other Unix, and you type mount in a terminal, it will tell you the type of the file system. But it does not really matter. If you can use lock() in other directories, but cannot use locks on this file system, then based on the error message, the file system does not support locking.

A workaround would be to configure drake to store the lock files somewhere else, if that's possible.

@mattwarkentin
Copy link
Author

For posterity, when running mount in the terminal

<<redcated info for mounted volume path>> (smbfs, nodev, nosuid, mounted by matt)

Hope this is helpful, @wlandau

@gaborcsardi
Copy link
Member

Interesting, in theory SMBFS supports locking, AFAIK. In any case, being able to configure a custom directory for lock files is a good idea in general.

@mattwarkentin
Copy link
Author

mattwarkentin commented Jun 22, 2020

I don't know enough about this stuff, so I can't really offer much insight. But we seem to have identified the issue.

Running this on the mounted drive:

library(filelock)
lock <- lock("/Volumes/hung_lab/warkentin/lock")
Error in lock("/Volumes/hung_lab/warkentin/lock") : 
  Cannot lock file: '/Volumes/hung_lab/warkentin/lock': Operation not supported

On my internal drive, works fine.

library(filelock)
lock <- lock("/Volumes/Macintosh HD/Users/matt/Desktop/lock")
unlock(lock)
[1] TRUE

@wlandau
Copy link

wlandau commented Jun 23, 2020

Thanks for explaining, @gaborcsardi. I think I can solve this for drake via wlandau/txtq#18.

@wlandau
Copy link

wlandau commented Jun 23, 2020

And @mattwarkentin, thanks for #26 (comment). That makes it clear we need wlandau/txtq#18.

@wlandau
Copy link

wlandau commented Jun 23, 2020

Would you try ropensci/drake@2ffd42a? It should be fixed now because I made drake avoid file locking altogether (via an update I just made to txtq).

@pydupont
Copy link

It works. Thanks for your work!

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

4 participants