]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/bugs/anonymous_git_push_broken_again.mdwn
removed
[git.ikiwiki.info.git] / doc / bugs / anonymous_git_push_broken_again.mdwn
1 This might not be the same cause or solution as [[git_test_receive_wrapper_fails]] so filing
2 it separately.
4 Anon git push is broken again
6     remote: error: cannot lock ref 'HEAD': Unable to create '/home/b-ikiwiki/source.git/./HEAD.lock': Permission denied
7     To git://git.ikiwiki.info/
8      ! [remote rejected]     master -> master (failed to update ref)
10 *—[[Jon]], 2020-10-06*
12 > It does not seem related to the other problem. I don't understand how it
13 > could have broken in a new way since I fixed it before. git has not been
14 > upgraded in the meantime. This is affecting more than one site, and the
15 > permissions do not seem obviously broken.
16
17 > Since this is now seeming so fragile -- after working for about a decade,
18 > it's broken twice in a matter of months -- I'm questioning whether it's
19 > worth trying to keep the feature working. --[[Joey]]
21 >> Of course, that's got to be your call. I haven't made a great deal of use
22 >> of it, but it *does* seem more convenient if one is working on an IkiWiki
23 >> patch, as I can write the website notes about it in the same tree (although
24 >> I then have to cherry-pick to push that to the live site, of course.). If
25 >> you decide to drop it from `ikiwiki.info`, would you leave the code as-is,
26 >> or drop it as broken? Any further clues what went wrong this time?
27 >> *—[[Jon]], 2021-01-13*
29 ----
31 The HEAD.lock permissions error does not come from the post-receive hook or
32 from ikiwiki when it runs it. Instead, stracing git-daemon shows that it
33 happens after ikiwiki has checked the push and accepted it, and exited
34 successfully. 
36 So the problem is that git-daemon is unable to write to the git repo.
38         drwxr-sr-x+ 8 b-git-annex b-git-annex 4096 Mar 29 17:07 /home/b-git-annex/source.git/
40 ikiwiki-hosting's ikisite is supposed to arrange for git-daemon
41 to be able to write there by using an ACL, so something about that
42 must be what is broken now. --[[Joey]]
44 Ok, found the problem. ikisite runs setfacl, and that does the right thing.
45 Then ikisite runs chmod on the source.git directory (to make it suid as seen
46 above). That seems to mess up the ACLs that were set earlier.
48 The diff from good to bad ACLs, as shown by getfacl is:
50         -group::rwx
51         -group:ikiwiki-anon:rwx
52         -group:b-ikiwiki:rwx
53         -group:b-git-annex:rwx
54         -mask::rwx
55         +group::rwx     #effective:r-x
56         +group:ikiwiki-anon:rwx #effective:r-x
57         +group:b-ikiwiki:rwx    #effective:r-x
58         +group:b-git-annex:rwx  #effective:r-x
59         +mask::r-x
61 I don't understand ACLs or how a chmod could clear them but ok, ikisite needs
62 to chmod before setting the ACLS.
64 This is not an ikiwiki bug and I'll fix it in ikisite-hosting then. [[done]]
65 --[[Joey]]