What steps will reproduce the problem?

Try pasting file into annex directory while assistant is running.

What is the expected output? What do you see instead?

Expect file to successfully paste into directory, then be annexed. Instead, see a permissions error, and file disappears.

What version of git-annex are you using? On what operating system?

OSX - 10.6. zsh. git-annex version: 3.20120826

Please provide any additional information below.

Ok, I've put in the one second delay to adding by default on OSX. I consider this bug done, at least for now..

Reopening since I've heard from someone else that it can still happen. --Joey

What is the error message?
Comment by http://joeyh.name/ Tue Sep 18 16:35:36 2012
Exact error message is: "The operation can’t be completed because you don’t have permission to access some of the items." Looks like it starts symlinking and committing before the file is fully copied over.
Comment by http://www.davidhaslem.com/ Tue Sep 18 22:49:09 2012

I can only guess what this paste operation entails, but as far as I can tell, the error message and the deletion of the file both come from the paste program, not git-annex.

I know that git-annex assistant will not annex a file while it's still open to be written to. So my hypothesis is that the file is written to, closed, and then the paste program tries to do something else -- perhaps set the mode of the file -- and by that point git-annex has annexed it, and the program deletes the symlink. (So the content is probably buried in the git annex.)

Could you build from git master and in your annex, run:

git config annex.delayadd 10

That'll add a 10 second grace period for things to finish with files before they get added to the annex. Perhaps this will be enough to avoid the problem. Feel free to play with the number of seconds..

Comment by http://joeyh.name/ Wed Sep 19 17:32:13 2012
Looks like that did it. I started with 5 seconds, which seems to be more than enough - turned it down to 1 and it still seems to work. The mode change sounds like a likely guess for what it's doing after it is doing writing the file - so even a second is probably more than enough.
Comment by http://www.davidhaslem.com/ Fri Sep 21 04:05:20 2012
Ok.. My concern with this kind of "fix" is it could theoretically break under heavy load, and I get to pick a tradeoff between a timeout that's unlikely to break and one that'll make git-annex appear sluggish. OTOH, I can't think of anything better to do to address this. How common is "pasting a file" on OSX?
Comment by http://joeyh.name/ Fri Sep 21 04:12:54 2012
Well, it's not super common - but in the initial import where I'm first trying out git-annex, I'm copy-pasting my files in from my dropbox, keeping them both as separate folders to try out.
Comment by http://www.davidhaslem.com/ Fri Sep 21 14:06:45 2012
Comments on this page are closed.