I'm trying to use this plugin, so I created a test script in /var/atlassian/application-data/stash/external-hooks/ called "test".
I've tried using the example script in the documentation and one that just echos one line. The file runs ok in the terminal by itself. When I enter it into the repoistory hook form, it accepts the file as being valid and executable. But then when I do a git push up to my stash repo, it does not call the hook successfully.
The error log looks like this:
2015-08-24 14:25:50,628 ERROR [AtlassianEvent::thread-1] conn @11T3OK8x865x272x0 MYIPADDR "POST /scm/mdl/moodle.git/git-receive-pack HTTP/1.1" c.n.s.e.hook.ExternalPreReceiveHook Error running [/var/atlassian/application-data/stash/external-hooks/test, ] in /var/atlassian/application-data/stash/shared/data/repositories/2 java.io.IOException: Broken pipe at java.io.FileOutputStream.writeBytes(Native Method) ~[na:1.8.0_40] ...
This is actually the first time I've seen the "Broken pipe" error. Every time before this it has said "no such file or directory", like this slightly older error message:
2015-08-24 14:12:29,906 ERROR [AtlassianEvent::thread-1] conn @11T3OK8x852x262x0 MYIPADDR "POST /scm/mdl/moodle.git/git-receive-pack HTTP/1.1" c.n.s.e.hook.ExternalPreReceiveHook Error running [/var/atlassian/application-data/stash/external-hooks/test, ] in /var/atlassian/application-data/stash/shared/data/repositories/2 java.io.IOException: Cannot run program "/var/atlassian/application-data/stash/external-hooks/test" (in directory "/var/atlassian/application-data/stash/shared/data/repositories/2"): error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) ~[na:1.8.0_40] ...
Currently my script looks like this:
#!/usr/bin/env bash echo "Hello Git"
Though I have tried different scripts, for example I've tried the example script copy and pasted in exactly, and that gave me the "no such file or directory" error.
Could anyone help me to get this working or point me in the right direction?
Thanks.
What version of Stash are you using?
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.