Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

external hook not being triggered

Vivian Zhang January 24, 2014

i have external hook plugin installed. After enable it for both pre and post receive hooks, it only works for pre-receive hook, but not triggered for post-receive hook. I had made sure the executable files runs properly in the path. but the hook apparently is not being called. What did i missed here? Thanks.

5 answers

0 votes
Valeriy Garnitskiy September 18, 2014

Stanislav,

I downloaded & build 1.3-10 version of hook. The post-receive hook plugin still not working

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.
September 18, 2014

Can you post what exactly you specifying as post-receive hook? I've just checked out and it works in my installation. Also, you can try to specify following test data: Executable: /bin/sh Params: -c echo test > /tmp/testing-hook

Valeriy Garnitskiy September 18, 2014

Stanislav, My apology for not correct comments: the post-receive hook triggered but I never get messages from it. Example: in post-receive hook executable is: C:\tmp\run-post.bat Content of this file: echo HELLO POSTRECEIVE HOOK C:\tmp\rep_1>git push origin new-branch Password for 'http://admin@testserver:7990';: Counting objects: 7, done. Delta compression using up to 2 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 268 bytes | 0 bytes/s, done. Total 3 (delta 1), reused 0 (delta 0) remote: remote: Create pull request for new-branch: remote: http://testserver:7990/stash/projects/PROJECT_1/repos/rep_1/compare/commits?sourceBranch=refs/heads/new-branch remote: To http://admin@testserver:7990/stash/scm/project_1/rep_1.git * [new branch] new-branch -> new-branch As you see, there is no output here. If I set same file in pre-receive hook, all output messages were printed out here. The atlassian stash log file does not show any output messages from script. If I follow your wiki page: (https://github.com/ngsru/atlassian-external-hooks/wiki/Documentation), the log file (test-params.log) was created with correct content. Can we print out some messages to client?

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.
September 18, 2014

Ok, sorry, I've got it. Current implementation doesn't support sync post-receive hooks (looks like it was addeed into Stash recently), so currently there is no way to show something from post-receive. However, looks like it's not big deal to implement it, so look forward to 1.4 version which will support sync and async hooks.

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.
October 3, 2014

Uh-oh. I was wrong, there is still no support for repo-specific sync post-receive hooks in Stash. So, there is no way to see something as output of post-receive hook. If output is cruicial it's better to use pre-receive hooks (anyway, everything available in post-receive hook is also available in pre-receive hook).

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.
January 28, 2014

Vivian, I've just uploaded new version (1.2-1) of plugin with Charles PR merged in. Can you try it with your configuration and see what will be popped out in logs?

Vivian Zhang January 29, 2014

I removed my previous comments. The external post receive hook plugin still not working. It's not being triggered at all. The atlassian_stash.log did not show this plugin is being called. I'll have to switch back to put the hook in post-receive.d directory instead.

0 votes
cofarrell
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.
January 28, 2014

Hi Vivian,

Apologies, I'm assuming you mean this plugin?

https://marketplace.atlassian.com/plugins/com.ngs.stash.externalhooks.external-hooks

What executeable are you specifying, and are the permission set correctly on the filesystem? Can you see anything in the $STASH_HOME/log/atlassian-stash.log? or $STASH/logs? Unfortunately the errors from the plugin are outputted to stderr so they may not be printed to the normal logs.
You might want to contact the vendor of the plugin directly. I've send the author an email and hopefully he'll get back to you on this page.
Charles
cofarrell
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.
January 28, 2014

I've created a pull-request to fix the logging in the plugin:

https://github.com/ngsru/atlassian-external-hooks/pull/1

0 votes
Vivian Zhang January 28, 2014

thank you for your reply. It worked after putting it into pre-receive.d. This should solve our problem. However, my original question was regarding the external hook plugin that we installed. It works for pre-receive external hook but not for post receive.

0 votes
cofarrell
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.
January 26, 2014

Hi Vivian,

Where did you put the file exactly? Did you add them to the pre-receive.d and post-receive.d directories? I'm assuming when you pushed the commit succeeded? If you use a post-receive plugin in Stash does it work (on a test URL for example)?

If you get stuck don't hesitate to raise a support ticket as well (with a support ticket attached) so we can take a closer look.

Cheers,

Charles

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events