Please describe the problem.
After having added new content (SHA1E backend), when trying to commit, git commit fails with the following error:
(Recording state in git...)
error: invalid object 100644 5d471129a031f0f493de3736eaea6f2f4056aeee for '000/091/WORM-s1493-m1321288671--scrapbook%data%20111114173520%horiz-menu-tab-r_001.png.log'
fatal: git-write-tree: error building trees
git-annex: failed to read sha from git write-tree
The commit subsequently fails and the index is left as is. When I did git-annex add, I got the same error, but the additions seem to have been staged, at least.
What’s curious about this is that I migrated all keys to SHA1E earlier and dropped all WORM keys. git annex info also says that all my keys are SHA1E.
Can this be related to your changes to the WORM backend? I upgraded to git-annex 5.20140818 today. Rolling back to 5.20140716 didn’t allow me to commit, either, though.
Any way I could resolve this? I don’t want to git reset for now, since this will leave the added objects in the annex store.
What version of git-annex are you using? On what operating system?
git-annex 5.20140818
Linux 3.16.1
git fsck only shows a few dangling blobs from a branch I did earlier and left behind, but otherwise reports no errors.
git annex fsck --fast ultimately fails with the original error message at some point:
git commit with git-annex debug output enabled:
Doing a git annex fsck on a new clone of the repository succeded; the problem must somehow with the .git/annex/index then, I presume?
I did a git reset to restore to the sane state state before adding, but the problem is that I cannot unannex the files I added. :(
The file referred to in the error message seems to be in good shape:
Strangely, the SHA1 of the blob is different from the one reported in the write-tree error.
I tried git annex repair on the repo (before doing any adds). It reports no fsck errors, but the repair then dies from a stack overflow.
Any ideas? I noticed one alternative way (cf. the reset workaround above) to make «git annex add» work again is by deleting .git/annex/index*. Is this safe?
In both repos, I had not even staged annex additions before the index was corrupted; the corruption must somehow have been left-over from earlier actions, altough all previous additions succeeded at the time, before both repositories mysteriously stopped working (in the context of backend-migration).
I still have the original snapshots around if you’d like to debug this. As noted, «git fsck» succeeds, and all the block-level checksums check out, so the problem can’t be on the block device or file-system level.
It seems to me that the problem must be with .git/annex/index.
I would be interested in looking at this git repository, if there's a way to get a copy (no .git/annex/objects needed).
Do you still have this repository?
Marking this bug moreinfo.
Hello, I've had the same problem, removing the index fixed the issue.
I have a backup of it, it's 88MB, how shall I share it with you, Joey?
same here: scary error message, easy fix (
rm .git/annex/index.lck
):Unfortunately, this is a very large repo and I can't really reproduce now that I removed the lockfile. Do note there was an out of disk space condition earlier on that drive, but that was resolved before starting the git-annex operations. -- anarcat
Also ran across this today. All I did was a simple copy of a few files to a remote using a filter. I can provide the index and lck files if needed.
This seems to be a not entirely uncommon git failure. google search has tens of thousands of hits that look like this and do not involve git-annex.
One commenter in https://stackoverflow.com/questions/14448326/git-commit-stopped-working-error-building-trees said it was a permissions problem.
Disconnecting a drive before all of git's changes have been written to it seem like the other likely way.
Got the same error today, added some files (git annex add .) then tried to commit and got:
error: invalid object 100644 88e4306546e6d62a10fb79506d06bcf6492d3934 for '000/c75/SHA256E-s200678--f0fd2056044082bc8c0e03edb93fbcc745627b6e638c4e2f4263fbb0a1fa0cce.SDT.log' fatal: git-write-tree: error building trees .git-annex-wrapped: failed to read sha from git write-tree CallStack (from HasCallStack): error, called at ./Git/Sha.hs:23:15 in main:Git.Sha
Doing a
rm .git/annex/index.lck
fixed it.