{"thread":{"id":"23472","subject":"Certain git commands fail with \"returned error: 128\" running via Git.pm under mod_perl","startedAt":"2010-04-15T09:22:41Z","lastAt":"2010-04-15T09:22:41Z","messageCount":1,"participants":["Thomas Adam"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"139568","messageId":"x2k18071eea1004150222x2980feb5ub9b15ec0522dd5ff@mail.gmail.com","threadId":"23472","inReplyTo":null,"subject":"Certain git commands fail with \"returned error: 128\" running via Git.pm under mod_perl","fromName":"Thomas Adam","fromEmail":"thomas@xteddy.org","sentAt":"2010-04-15T09:22:41Z","receivedAt":"2010-04-15T09:22:41Z","isPatch":false,"sender":{"key":"thomas@xteddy.org","avatar":"https://gravatar.com/avatar/e7256db4738e501e5d2e84f00bb0bd99503165729573848a03330301fc2adc4a?d=mp&s=160"},"body":"Hello all,\n\nI've got a problem running certain git commands via Git.pm under\nmod_perl.  Specifically so far, these commands are \"push\" and \"fetch\"\n(by way of \"git pull\").  Running the same command set without mod_perl\nworks as expected, including running these commands manually.\n\nI won't bother to describe the application, but most web pages within\nit will \"git pull\" and \"git push\" various bits of information once\nthey're entered.  When I initially try this out, these commands work\nfine, until a point in time when they stop and error with the\nfollowing:\n\ntrace: built-in: git 'push'\ntrace: run_command: 'git-receive-pack '\\''/var/repository'\\'''\ntrace: exec: 'sh' '-c' 'git-receive-pack '\\''/var/repository'\\'''\n'git-receive-pack '\\''/var/repository'\\'''\ntrace: built-in: git 'receive-pack' '/var/repository'\nfatal: read error: Bad file descriptor\nfatal: write error: Broken pipe\nGit command failure:  push: command returned error: 128\n\nNote that in the environment, I have enabled \"GIT_TRACE=1\", so that I\ncould at least make some sense of what's going on.  When this happens\n-- git will remain failing on this command until I restart Apache.\n\nI said I am using Git.pm -- I am doing nothing fancy other than calling:\n\nGit::command()\n\nWhat do people think is happening?  The fact that it's intermittent\nwould suggest to me there's either some global state running these\ncommands under mod_perl -- and perhaps the reason push returns error\n128 with a broken pipe is that it's trying to write to a file handle\nthat's since closed (STDOUT or STDERR)?  It's a little tricky knowing\nwhere/how to diagnose this.\n\nSo any help/pointers would be greatly appreciated.\n\nKindly,\n\n-- Thomas Adam\n"}]}