Jira Hooks for Stash is blocking my tag's push

I'm trying to push a tag to a Bitbucket server with JIRA Hooks for Stash plugin, but Push check hook is blocking it with:

"remote: [Syntax check] There should be at least one change-set with a valid issue key"

But my tags usually doesn't have a valid issue key, they're just like:

git tag -a v1.4 -m "my version 1.4"

Is there a way to tell JIRA Hooks to ignore tags in the validation?

9 answers

Hi Paolo,

 

can you send me the version of JIRA and Stash/Bitbucket you use?

 

Thanks & Cheers

Benjamin

We are seeing this on JIRA 6.4.13 and stash 4.3.0 . Any ideas?

Benjamin we are also seeing this using JIRA 6.4.13 and Stash 4.3.0. Can you help us debug why this is happening?

Happens for me too, with Hooks 3.0.0 + Bitbucket 4.7.1. 

The repository is configured with a Push check, with checkbox Issue-key check ticked. When trying to push a branch:

git clone ssh://git@example.com:7999/tst/testrepo.git
cd testrepo
git branch testbranch
git checkout testbranch
git push --set-upstream origin testbranch

I get:

Total 0 (delta 0), reused 0 (delta 0)
remote: [Syntax check] There should be at least one change-set with a valid issue key
To ssh://git@example.com:7999/tst/testrepo.git
 ! [remote rejected] testbranch -> testbranch (pre-receive hook declined)
error: failed to push some refs to 'ssh://git@example.com:7999/tst/testrepo.git'

Hi Jeff,

 

was this the first time you have pushed something? with enabled hook? Because in that case the history of the branch (each commit) will be scanned. Also if the branch has no additional commit. The reason is, that each commit needs to be indexed by indexer of the hook. If you push the first time, the indexer has not build up the index and each commit will be scanned. 

Try to push the branch as user which has "Exception rights" (e.g. with a user, which is in a special group)

 

Cheers Benjamin

Kailas I'm New Here Sep 08, 2017

Hi Benjin,

We are also facing the same issue, is there any other way to do the first checkin with correct JIRA Issue while keeping "Puch Check " plugin enabled and without "Exception rights".

Regards

Kailas 

Hi Kailas,

please use the latest version. The issue is already fixed in the version 3.0.2.

For Bitbucket 4.x users i have backported some bug fixes in the version 3.0.0.1.

if you have still problems, please contact our support channel

https://tracker-develop-and-consult.atlassian.net/servicedesk/customer/portal/4

Thank you in advance

Benjamin

Benjamin,

We are also facing issue with below error, using Bitbucket 4.9.1 & JIRA 6.4.12.

remote: [Syntax check] Permission problems. You are not allowed to execute the requested JIRA Rest action. Please ensure that authentication method OAuth is enabled. Also the OAuth options "Allow 2-Legged OAuth" and "Allow user impersonation through 2-Legged OAuth" should be set on both sides of the application link (in- and outgoing connections) (CredentialsRequiredException: You do not have an authorized access token for the remote resource.)

OR

remote: [Syntax check] There should be at least one change-set with a valid issue key

while application is setup correctly & i am an admin for both the instances. Even if i disable the plugin & commit the file with valid issue id then i am able to see linking under commit on UI & navigate the issue from that link.

Hi the first message points out that the application link is not configured as 2 Legged OAuth. Also maybe the impersonation is not enabled. Please check this in both directions. The second point should be fixed in the latest release.


If you have still problems, please raise a request in the service desk linked in the marketplace listing

I just wanted to chime in that we have also been seeing this with the latest JIRA hooks for stash plugin (3.0?).  We are seeing it with tags and with branch creation/deletion, which don't get commit messages.

NOTE:  i'm not the admin, and cannot tell for certain which version of hooks, but from the documentation, it appears to be the latest 3.0 version.

Bitbucket v4.10.0

JIRA (v7.2.2#72004-sha1:9d51328)

Benjamin,

We are also facing the same issue. I am not even able to enable the hook the "Push Check" add-on and get the following error:

Permission problems. You are not allowed to execute the requested JIRA Rest action. Please ensure that authentication method OAuth is enabled. Also the OAuth options "Allow 2-Legged OAuth" and "Allow user impersonation through 2-Legged OAuth" should be set on both sides of the application link (in- and outgoing connections) (CredentialsRequiredException: You do not have an authorized access token for the remote resource.)

Bitbucket v4.10.1

JIRA v7.2.0

I have tried re-creating the links, I am admin on both the applications. 

One observation is that the option to choose Allow 2-Legged OAuth" and "Allow user impersonation through 2-Legged OAuth" for incoming and outgoing connections is no longer available on both Bitbucket and JIRA in their current versions. 

Can you check?

Hi this message points out that the application link is not configured as 2 Legged OAuth. Also maybe the impersonation is not enabled. Please check this in both directions.

I this will not work, please raise a request in the service desk linked in the marketplace listing 

We are experienceing the same issue with this hook. I configured it and tested it in a test repo. It works for me without that Jira error. But, when others on my team attempt to push, they get the Jira issue.

 

remote: [Syntax check] Permission problems. You are not allowed to execute the requested JIRA Rest action. Please ensure that authentication method OAuth is enabled. Also the OAuth options "Allow 2-Legged OAuth" and "Allow user impersonation through 2-Legged OAuth" should be set on both sides of the application link (in- and outgoing connections) (CredentialsRequiredException: You do not have an authorized access token for the remote resource.)

BTW: We are all admins in this project.

It is a new project with four repos. When the hook is enabled on any of the four, the error occurs for them, but not me.

 Atlassian Bitbucket v4.6.2

 Atlassian JIRA Project Management Software (v7.3.3#73014-sha1:d5be8da) 

Its Pre-recevie hook, if you have bitbucket admin access, go to the bitbucket repository setting -> Hook-> push check-> Enabled

Admin can manage this hook repository base.i am using this hook its good for traking purpose.

Hello everybody,

the issue has been fixed in the latest version of the plugin.

 

Cheers Benjamin

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

635 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot