-2

So I'm getting the error post-commit hook failed (exit code 255) with no output. after committing to the repository. The commit goes through fine, but the hook is obviously not working. The hook code is:

#!/bin/sh

REPOS="$1"
REV="$2"
TXN_NAME="$3"

/usr/bin/svn update --username user --password pass /var/www/clients/clientx/weby/web >&2

exit 1

I've tried changing the permission of /var/www/clients/clientx/weby/web to 775, but that doesn't work. It's an ISPConfig installation, so the user/group that runs the commit hook is webz:clienty, while the output folder's ownership is webx:clienty. I've also run the code without the exit 1 and the >&2. I just need to be able to see what the problem is, and then I can fix it, but there is no output. I've read about STDERR and I think what I have should work.

I ran the same command, without the exit 1 and >&2, from the command line and it worked, no problem.

I'm not sure why I can't get any output, or why the post-commit hook is returning an error.

ashraj98
  • 384
  • 5
  • 17
  • Can you `su` to the webz user and run that command at the command line? – MarkNFI Mar 29 '16 at 14:20
  • Ok, now it is saying `Skipped '/var/www/clients/clientx/weby/web'` and the it summarizes the conflicts, but still no error message. – ashraj98 Mar 29 '16 at 14:58
  • I've been away from svn for too long to be much more help, but perhaps this link might give you more information: http://stackoverflow.com/questions/3048662/svn-skipped-paths -- Good luck! – MarkNFI Mar 29 '16 at 19:53
  • I fixed the skipped path issue, but it still has not worked. – ashraj98 Mar 30 '16 at 14:09
  • If you `su` to the webz user and run it at the command line, are you still getting errors? If so, just keep doing that until you track down all the bugs and get them fixed. – MarkNFI Mar 30 '16 at 14:33
  • no when I su to the webz user it works now... – ashraj98 Mar 30 '16 at 14:34
  • Debian 8, I tried changing `/bin/sh` to `/bin/bash` – ashraj98 Mar 30 '16 at 14:40
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/107753/discussion-between-marknfi-and-ashraj98). – MarkNFI Mar 30 '16 at 14:48

1 Answers1

0

So I figured out that the problem was that the post-commit hook was not even running. I ran the whole post-commit hook from the terminal itself, and got this error. All I needed to do was make the file Unix executable by using vim and running the command :set fileformat=unix. This effectively solved the issue.

Community
  • 1
  • 1
ashraj98
  • 384
  • 5
  • 17