Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Errors when trying to use post receive

Conn August 24, 2015

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.

1 answer

0 votes
Stanislav Seletskiy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 24, 2015

What version of Stash are you using?

Conn August 24, 2015

Atlassian Stash v3.11.2

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events