@dennisv - that’s a different solution than what Justin required but I’m glad your problem got solved!
I’ll add a bit more detail to Justin’s reply for anyone else coming across the same problem.
Bitbucket Server adds some server-side hook scripts to the repository directories we keep on the server. These scripts call back into Bitbucket on certain events (before and after git processes a push, for example) so that we can trigger the corresponding events in Java. One of the scripts was called 20_stash_callback but we renamed it to 20_bitbucket_callback. As I understand, Justin put a version of 20_stash_callback back in the repository directory which included both his modifications and the code to call back into Bitbucket. As a result, both his 20_stash_callback script and our own 20_bitbucket_callback script called into Bitbucket and we double-triggered events in Java.
Hopefully, you can understand why we’d prefer people don’t edit the hook scripts. If you need to, please get in touch so we can consider your needs in future versions of Bitbucket Server.