pre-receive hook declined
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
If you created an empty repo in Bitbucket, set the upstream URL in the clone to the new location, and tried to push but you are getting errors like these during the push:
remote: refs/heads/master: ab9b6a5fc48877dfcb8b25c42543c718e6f95b22: expected committer name 'Doe, John' but found 'somebodyelse'
remote:
remote: refs/heads/master: 81fe8f2000537b8e201c0f0730ec35b21dae4681: expected committer email 'john.doe@your.domain.com' but found 'somebody.else@your.domain.com'
To http://bitbucket.yourdomain.com/git/scm/testproject/my_git_repo.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://bitbucket.yourdomain.com/git/scm/testproject/my_git_repo.git'
Some pushes are working some are failing.
Diagnosis
If you set the Git client to DEBUG and see an output like:
09:11:17.590393 pkt-line.c:80 packet: sideband< \2 (c).-.(c) (c).-.(c) (c).-.(c) (c).-.(c) (c).-.(c) / ._. \ / ._. \ / ._. \ / ._. \ / ._. \
remote:
remote: (c).-.(c) (c).-.(c) (c).-.(c) (c).-.(c) (c).-.(c)
09:11:17.590393 pkt-line.c:80 packet: sideband< \2 __\( Y )/__ __\( Y )/__ __\( Y )/__ __\( Y )/__ __\( Y )/__(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\
remote: / ._. \ / ._. \ / ._. \ / ._. \ / ._. \
remote: __\( Y )/__ __\( Y )/__ __\( Y )/__ __\( Y )/__ __\( Y )/__
09:11:17.590393 pkt-line.c:80 packet: sideband< \2-._) || E || || R || || R || || O || || R || _.' `-' '._ _.' `-' '._ _.' `-' '._ _.' `-' '._ _.' `-'
remote: (_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._)
remote: || E || || R || || R || || O || || R ||
09:11:17.590393 pkt-line.c:80 packet: sideband< \2 '.(.-./`-'\.-.)(.-./`-`\.-.)(.-./`-`\.-.)(.-./`-'\.-.)(.-./`-`\.-.) `-' `-' `-' `-' `-' `-' `-' `-' `-'
remote: _.' `-' '._ _.' `-' '._ _.' `-' '._ _.' `-' '._ _.' `-' '.
remote: (.-./`-'\.-.)(.-./`-`\.-.)(.-./`-`\.-.)(.-./`-'\.-.)(.-./`-`\.-.)
The messages below are also a very good indication:
expected committer name
expected committer email
Cause
Problem 1:
The root cause of the issue is the add-on Yet Another Commit checker.
Problem 2:
Notice that we didn't support Git 2.11 up until Bitbucket Server 4.13+. So please look into - BSERV-9388Getting issue details... STATUS to define if that's your case.
Resolution
Problem 1:
This add-on has been found to cause this even if not explicitly enabled for the repo. Please check your add-on configuration as it has a Global configuration that could be causing that. To change the global settings, you go to the plugin in Manage Add-ons, "Configure", and uncheck the first two boxes.
If you find that to be a bug, please report it directly to the third-party add-on developer. All the Support details are described on the add-on website hosted on our Marketplace.
Problem 2:
Please upgrade your Bitbucket Server.