Bitbucket Server Backup Client - 401 Unauthorized
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
Problem
When the user tries to create a backup using the Bitbucket Server Backup Client, this error occurs in the command line:
1
2
3
INFO Initializing
INFO Contacting Bitbucket Server
ERROR A backup could not be created. Reason: The Bitbucket Server version could not be verified; the server returned 401 Unauthorized. Backup/restore is only supported by Bitbucket Server 2.7.0 and later.
Cause
The Bitbucket Server Backup Client wasn't able to access Bitbucket Server due to insufficient user's privileges or due to bad authentication to Bitbucket Server.
The exact cause can be identified by enabling the debug log level for the Bitbucket Server Backup Client.
Cause #1 - Incorrect Password
Incorrect password
1
2
3
4
DEBUG -> 401 Unauthorized (@1EU3G03x936x11388x1)
DEBUG HTTP status code: 401, status text: "Unauthorized", headers: [Content-Type:[application/json;charset=UTF-8], Date:[Mon, 09 May 2016 05:36:25 GMT], Server:[Apache-Coyote/1.1], Transfer-Encoding:[chunked], Vary:[Accept-Encoding], WWW-Authenticate:[Basic realm="Atlassian Bitbucket"], X-AREQUESTID:[@1EU3G03x936x11388x1], X-ASEN:[SEN-7135831]]
2016-05-09 15:36:25,460 DEBUG REST call generated an unexpected HTTP error. Response body: {"errors":[
{"context":null,"message":"Authentication failed. Please check your credentials and try again.","exceptionName":"com.atlassian.bitbucket.auth.IncorrectPasswordAuthenticationException"}]}
Resolution
Cause #1 - Incorrect Password
Make sure the password is correct with no quotes enclosed.
Cause #2 - non System Admin user
Make sure the Bitbucket Server user specified in the
backup-config.properties
, has the Bitbucket Server System Admin Global Permission.Check if backup user will require a captcha test by logging in via the gui before the backup scripts will be accepted.
Was this helpful?