topreddy
topreddy

Reputation: 609

Push rejected : No JIRA Issue found in commit message.branch name (pre-receive hook declined) error: failed to push some refs to http://@bitbucket.com

I am trying to push my commit to bitbucket, getting an error Push Rejected No JIRA Issue found in commit message.

I had modified the commit message to match the Jira ticket but still getting the same error:

remote:
remote:remote: Push rejected.
remote:
remote: refs/heads/feature/JR-2923: df323hfsdfw3u23u : No JIRA Issue found in commit message.
remote:
To http://bitbucket/repo/name
 ! [remote rejected] feature/JR-2923 -> feature/JR-2923 (pre-receive hook declined)
error: failed to push some refs to 'http://user@http://bitbucket/repo/name'

Upvotes: 2

Views: 11333

Answers (2)

topreddy
topreddy

Reputation: 609

I added double quotes to my message and it worked. git commit -m "your message about the issue"

Upvotes: 1

VonC
VonC

Reputation: 1325137

You had similar issues reported like (assuming you are using YACC / yet-another-commit-checker):

  • issue 132: check your regex, and also your authentication

On the regex side, for instance:

Actually, I think the issue might be the use of groups in the commit message regex.
if I change:

^[([A-Z]+)-(\d+)](.|\n)+

to

^([[A-Z]+-\d+])(.|\n)+

Then the group is now ([PROJNAME-1234]) instead of [(PROJNAME)-(1234)].

And on the authentication side:

If the issue really exists and JQL issueKey=CM-933 works when you manually test it, then this feels like a permission issue, because if the user doesn't have permission to view it, you would see empty results and YACC complaining it can't find the issue.

In a typical setup, communication looks like:

browser <--\        browser <--\
           |                   |
git <----> BBS <-- oauth --> JIRA

As per your comments, you manually verified and tested BBS and JIRA when logging into them in a browser.
I would also spot check that the expected users are being used when git connects to BBS, and also the BBS<->JIRA communication which should probably be using oauth.
If it isn't using oauth, that might also explain what is going on, because it might be using a user other than the one you expect when communicating with JIRA.

  • issue 148: check if the plugin is activated

That is:

Upgrading BBS may automatically disable plugins, which may require you to re-enable plugins.
In YACC's case, the Configure button should be displayed again after enabling YACC in UPM.

Upvotes: 0

Related Questions