External Pre-Recieve plugin Error

HI

we are using External Pre-Recieve plugin for our organization. when users do push to the repo they are getting following error.

Counting objects: 5, done.

Writing objects: 100% (3/3), 249 bytes | 0 bytes/s, done.

Total 3 (delta 0), reused 0 (delta 0)

remote: Hook com.ngs.stash.externalhooks.hook.ExternalPreReceiveHook failed. Er

or:

remote: Permission is not a resource-based permission

To https://padikm@asdstash.isus.emc.com:8443/scm/io/notifier.git

! [remote rejected] release-9.2 -> release-9.2 (pre-receive hook declined)

error: failed to push some refs to 'https://padikm@asdstash.isus.emc.com:8443/s

m/io/notifier.git'

can any one please let me now the user level permissions for the repos to be given so that this works properly. Urgent help is needed.

3 answers

1 vote

Hi Madhu,

That looks like a programming error in the ExternalPreReceiveHook class. They're calling PermissionService.hasAnyPermissions which can only be called with a PROJECT or REPO permission. In the code, it's being called with a global permission (SYSADMIN and ADMIN).

Note that this will only throw an exception if the user has insufficient permissions. If you make the user administrator on the repository or project, the check will succeed.

Edit: issue created: https://github.com/ngsru/atlassian-external-hooks/issues/3

Cheers,

Michael

HI Michael

Thanks much for the reply. i have source code. can i modify and change the permission?

regards

Madhu

Madhu,

It looks like Charles O'Farrell beat you to it.. :) There's an outstanding pull-request with fixes to this issue: https://github.com/ngsru/atlassian-external-hooks/pull/4

You can clone Charles's fork and build the patched version yourself.

Cheers,

Michael

Thanks a lot. That worked for me. Now no errors :). Sorry for the late reply. :(

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

175 views 20 8
Join discussion

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