stash filesize hook plugin


We are trying restrict commits that contain files over a certain size and found this resource:

This is exactly what we need but unfortunately we do not know how to set this up. Unfortunately I'm a sysadmin and not a programmer so I'm not sure what I need to do with the source to get this setup to work properly with stash... any instrictions or direction would be greatly appreciated!


6 answers

Hi James,

I've uploaded a compiled jar to the Bitbucket repository for you:

You should be able to upload that on the plugins administration screen, and then the hook will be visible in the repository hook page which can be enabled per-repository (and a maximum size configured).

Let me know if you have any questions, although I do need to mention that this isn't an official plugin and as such we don't support it in our normal capacity.



Thank you so much Charles! We'll give it a shot, appreciate your help with this!

This plugin is wonderful, however it seems to have been broken by Stash 2.5. Changes in the API?

The configure screen gets stuck while I see that this AJAX request

is returning "204 No Content".... Not what the plugin expects?

Hi Daniel,

The API around hooks shouldn't have changed at all in 2.5. Also, that request is generic across all hooks, so that would mean that everything else was broken too. Are you seeing an error in either your Stash logs (in the home directory), or an error in the Javascript (ie when you open your Chrome console)?


Hi Charles, thanks for the quick answer. What I am seeing is that when I either try to enable or configure the hook in a repo the configure screen stays stuck in the "turning wheel" symbol. The only HTTP request I see the one I mention, that returns a "204". However, the same request is done with Stash 2.4.1, where it returns 204 too but the configure screen does show up. BTW, I'm also having problems with the stash-editor-plugin and "Instant Edit for Stash" plugins in 2.5, so I guess something must have changed...

Hi Daniel,

That does't sound right. Again, is there anything in your Javascript console, or an error in the $STASH_HOME/log/atlassian-stash.log file? I can confirm that the hooks on our 2.5 production server are working as expected.


Ummm, I'm getting the same situation with the HipChat notification plugin, so it is surely not a problem with you plugin, sorry about that. I don't know, I just updated as usual and just as I started this started happening. As I said, also the edit in place plugins stopped working... strange. ps: I don't seem to be able to post a comment (nothing happens) so I have to post a new "answer".


Sorry, I can't help you without more information. I need the logs from your browser and/or Stash (see above). Lastly, have you tried to clear your browser cache? Does it happen to other users or just you?


Aha, there are two Javascript errors loading the "hooks" screen. No errors when clicking the button, but of course the error had already happened previously > TypeError: obj is undefined > > Line 584 > TypeError: loader is undefined > > Line 118
OK, finally found the problem. The ReadMe Parser plugin was interfering, generating the Javascript error and preventing the filesize plugin to work properly. Deactivated the ReadMe Parser and now it all works as usual. Sorry for the noise here.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

690 views 5 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you