User Configured pre-receive or post-receive Hooks Break After Upgrading Bitbucket Server

Still need help?

The Atlassian Community is here for you.

Ask the community


User configured pre or post receive hooks are not working after upgrading Bitbucket Server.


If you added a pre-receive or post-receive hook, upon upgrading to Bitbucket Server 2.0 or later, these will be moved to <BITBUCKET_HOME>/data/repositories/<NNN>/hooks/pre-receive.d/10_custom or <BITBUCKET_HOME>/data/repositories/<NNN>/hooks/post-receive.d/10_custom.

We replace the <BITBUCKET_HOME>/data/repositories/<NNN>/hooks/pre-receive and <BITBUCKET_HOME>/data/repositories/<NNN>/hooks/post-receive hook with our own that will call out to all the hooks in the .../hooks/pre-recieve.d and .../hooks/post-recieve.d directories in order.

NNN is the internal repository id.

If your custom hook references other scripts using relative path names (e.g. ./ or ../dir/ these will break and the hook will stop working.


Update your custom hooks accordingly to point to the correct location.
Last modified on Feb 19, 2016

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.