Git push returns error code 402
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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
Symptoms
When pushing to Bitbucket Server 1.0.0, it responds with the error code 402.
1
2
3
4
5
$ git push url directory
Cloning into 'directory'...
error: The requested URL returned error: 402 while accessing url
fatal: HTTP request failed
Cause
This may be caused by one of two things:
Your Bitbucket Server License has expired.
You have configured too many users for your current Bitbucket Server license.
Bitbucket Server 1.0.1 and above do not respond with a 402, instead they give an explicit error description in the output of the git command.
Resolution
Contact your administrator and let them know. You will have to renew your license, upgrade to a license that supports more users or reduce the number of active users.
Was this helpful?