Git push returns error code 403 in Bitbucket Server / Data Center
要約
When pushing to Bitbucket Server or Bitbucket Data Center, it responds with the error code 403 (Forbidden error).
$ git push url directory
Cloning into 'directory'...
error: The requested URL returned error: 403 while accessing url
fatal: HTTP request failed
環境
Tested in Bitbucket Data Center 7.12.1
Applied to Bitbucket Data Center 7.x and 8.x
診断
- Verify the permissions for problematic users at both Global Permissions as well as Project and Repository levels.
- Verify the "Allow basic authentication on API calls" under the Authentication method.
原因
Scenario 1: When users do not have permission to push changes to this repository.
Scenario 2: "Allow basic authentication on API calls" under the Authentication method is disabled.
ソリューション
Scenario 1: You have permission to see the repository, but not to contribute. You may want to review the project and repository settings.
More info on Using Project permissions and Repo permissions.
Scenario 2: Enabling the "Allow basic authentication on API calls" should resolve this issue.