Closed jacobbednarz closed 7 years ago
Hi,
I just ran into the same problem, tried fiddling around with the receiver script to add some debug output, and noticed a strange thing:
If the receiver script has a newer timestamp then the latest push, it works! Without understanding the issue, I added one line to the receiver script: touch $0
Now it works like a charm. I didn't have too much time to dig into the reason for that, but maybe someone here can tell.
Cheers
Hmm, never chcked the timestamps but perhaps my client was in front of the server time and that caused an issue?
Thanks for the heads up though! I will have a bit of a look and see if I can expand more on my issue after checking the timestamps.
I am having the same problem. Having a lot of difficulty debugging it but it looks like the git archive command in the hook fails with exit status 141. This may be a separate issue since touching the receiver script does nothing for me.
Running git version 1.9.1 on the server and 2.2.2 on the client.
@jacobbednarz Hi, I had the same error before.
In my case, receiver
script caused the error.
I think receiver
script must receive STDIN
from gitreceive
.
Following reciever
script works for me.
#!/bin/bash
APP=$1
REVISION=$2
USER=$3
echo "----> Unpacking repo..."
mkdir -p /tmp/build/$APP && cat | tar -x -C /tmp/build/$APP
I've debugged this and the only way I was able to continue replicating this was to have commented out code (or nothing) in the receiver like the default shows.
The only thing I can put this down to is that the script is expecting a return value and it's not getting it by default. I think to prevent new users from hitting this snag, we should update the default receiver to output and exit with a 0 status.
Thoughts? I'm happy to throw together a pull request if everyone agrees.
Added a pull request in hope that it will be reviewed and this little hurdle is removed for other users.
After messing with it for a while I found out because I wasn't handling the tar file and producing a working version of the repository the script would hang. I removed the following from line 115 in gitreceiver script:
git archive "$newrev" |
That prevents archiving the new revision and piping the resulting tarfile to the gitreceiver script.
Well that is the whole point of this project, so removing that line means you basically don't want this project.
On Fri, Apr 24, 2015 at 6:33 AM, Chad Cravens notifications@github.com wrote:
After messing with it for a while I found out because I wasn't handling the tar file and producing a working version of the repository the script would hang. I removed the following from line 115 in gitreceiver script:
git archive "$newrev" |
That prevents archiving the new revision and piping the resulting tarfile to the gitreceiver script.
— Reply to this email directly or view it on GitHub https://github.com/progrium/gitreceive/issues/36#issuecomment-95798535.
Jeff Lindsay http://progrium.com
I experienced the same problem until i tried the solution pointed by spesnova, which worked for me. However, i still cannot push the tags as explained in this issue. .https://github.com/progrium/gitreceive/issues/38
I was also facing this error and on inspecting script I found out that trigger_receiever method has following logic.
[[ "$refname" == "refs/heads/master" ]] && \
git archive "$newrev" | "$home_dir/receiver" "$repo" "$newrev" "$user" "$fingerprint"
What this means is that you can only push master branch and the code comments explicitly says to disable this condition if you want to push other branches. Since I was pushing non master branch removing this condition fixed the issue.
Hey, I've followed the README and have this setup as instructed however whenever I try to push to it I end up getting the following error.
So I've checked the remotes (and they look fine)
The weirdest thing though is that the repository is created where it should be.
So I am a little stumped as to what to be the cause here? Here is my
authorized_keys
file incase it helps.