Forums

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

New Windows Server Install - BitBucket 6.3.2 - Hooks not executing

Kyle B
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 8, 2019

2019-06-08 21:39:13,935 WARN [https-jsse-nio-192.168.5.17-443-exec-4] ***** @187W2D4x1299x3x0 192.168.5.52 "POST /scm/kbots/kekistan-bots.git/git-receive-pack HTTP/1.1" c.a.s.i.s.g.p.http.HttpReceivePack KBOTS/kekistan-bots[1]: Git hooks have not been called. Please verify that the hooks are configured correctly - see https://confluence.atlassian.com/display/BITBUCKETSERVERKB/Git+hook+scripts+are+not+executing?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash for details

After following all instructions on the KB article, everything came back ok, yet it still isn't able to run.  This has made BitBucket not able to receive and Pushes to any repos.

All 4 files are confirmed installed into the repo, and the support diagnostic info that is output from the plugin indicates the four scripts that need to execute are executable.  I have confirmed the rights on the files are correct and the service account that is created for BitBucket Server has full control of the files.

<hook>
<name>pre-receive</name>
<size>430 B</size>
<executable>true</executable>
<callbacks>
<callback>
<name>20_bitbucket_callback</name>
<size>416 B</size>
<executable>true</executable>
</callback>
</callbacks>
</hook>
<hook>
<name>post-receive</name>
<size>432 B</size>
<executable>true</executable>
<callbacks>
<callback>
<name>20_bitbucket_callback</name>
<size>418 B</size>
<executable>true</executable>
</callback>
</callbacks>
</hook>
git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v --tags --set-upstream origin master:master
POST git-receive-pack (395 bytes)
Pushing to https://URL/scm/kbots/kekistan-bots.git
To https://URL/scm/kbots/kekistan-bots.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://URL/scm/kbots/kekistan-bots.git'

 Anyone have any super secret knowledge here?  I've been looking for some kind of fix for several hours now, and nothing has helped.

EDIT1:

When running the following command in git-bash, I find there might be an error in the scripts?:

$ ./pre-receive
./pre-receive: line 9: /c/Atlassian/ApplicationData/Bitbucket/shared/data/repositories/1/hooks/hooks/pre-receive.d: No such file or directory

That's a bad location, since hooks/hooks/ repeats.

 

1 answer

1 accepted

0 votes
Answer accepted
Kyle B
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 8, 2019

Ok, their damn scripts have a bug...

I changed line 9 in both scripts in the Hooks dir, and now it works...

Here's the original line:

exec $STASH_HOOK_COORDINATOR hooks/post-receive.d "$@" <&0 >&1 2>&2

And what I changed it to

exec $STASH_HOOK_COORDINATOR ./post-receive.d "$@" <&0 >&1 2>&2

Same situation for the post-receive script, btw....  Mega face palm on Atlassian here.  Whoops?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events