Today, I got the strange error below. I unlocked a file, and edited it, and attempted to sync, when I saw the error.
remote: error: object a86b9c49d9ef8c88c3180013eef3da5f6ffa9353: symlinkPointsToGitDir: symlink target points to git dir
remote: error: object ebb743ffb44e23c54a7e3ed44a444cc0ed0df42d: symlinkPointsToGitDir: symlink target points to git dir
remote: fatal: fsck error in pack objects
error: remote unpack failed: unpack-objects abnormal exit
To gitlab.com:datamanager/tasks.git
! [remote rejected] git-annex -> synced/git-annex (unpacker error)
! [remote rejected] master -> synced/master (unpacker error)
error: failed to push some refs to 'gitlab.com:datamanager/tasks.git'
remote: error: object a86b9c49d9ef8c88c3180013eef3da5f6ffa9353: symlinkPointsToGitDir: symlink target points to git dir
remote: error: object ebb743ffb44e23c54a7e3ed44a444cc0ed0df42d: symlinkPointsToGitDir: symlink target points to git dir
remote: fatal: fsck error in pack objects
error: remote unpack failed: unpack-objects abnormal exit
To gitlab.com:datamanager/tasks.git
! [remote rejected] master -> master (unpacker error)
It's strange because I've done this unlock, edit, and sync, flow a few times in the past week, with no problems. I've only been able to find one reference point for this, in git's own documentation.
It's very concerning because it prevents me from syncing with my remote repository at all. I was able to work around the problem with git reset HEAD~
so I could at least get a few changes sent to my remote, but that meant I lost all the changes I made to the file itself.
Can anyone say what the problem might be here? Why does git suddenly seem upset that I've got a symlink pointing at my git directory?
git annex assist
ing to GitLab with git annex 10.20240129.I don't think this is git's fault, but my gitlab's. The commit says that setting
fsck.symlinkPointsToGitDir
towarn
should avoid the problem. It seems, however, that gitlab has it set toerror
-- your forge probably has the same setting as well. I can think of only two solutions:warn
You will need to reach out to gitlab if you want to continue using it. They need to set
git config receive.fsck.symlinkPointsToGitDir ignore
.FWIW, github does not (currently) have this behavior.
This change does have some other knock-on effects that git-annex can deal with, see deal with git fsck symlinkPointsToGitDir.
I suppose that it would also work to unlock any annexed files that you want to push to gitlab. It shouldn't matter that there are locked annexed files in the history you've already pushed, only new commits in the push get checked.
Using git-remote-gcrypt will also avoid the problem, since gitlab can't tell that you're a scary symlink user if you encrypt everything.
I went the nuclear route, and decided that I'd move to sourcehut for the moment, which seems to be playing nicely -- at least for the moment.
That gives us github, and sourcehut, as options -- for now.
Is it possible to get my edited file back?
I know that the file I edited, with it's changes, should be somewhere in my .git directory, but I have no idea where (I already undid all commits that contained it's path in my haste to just make it work again), and -- like an idiot -- did not copy it anywhere before doing so.
git show
gave me the path to the object mentioned in the error log at the top. Got my file back!My GitLab forum post about this is now no longer hidden.
Btw, codeberg / forgejo / gitea should also be an alternative.
I have brought this reversion to the attention of the git developers
They were already working on reverting a surprisingly large amount of the recent related patches, but not the one that affects git-annex, so I hope they'll include it.
Seems to have been a case of security fixes under embargo leading to going much too far on trying to harden against future related security problems, with the embargo preventing sufficient review.
Fingers crossed.
git annex assist
to GitLab.com works again 👍