'ERROR A backup could not be created. Reason: Lexing failed on line: 1..' When creating a backup using the backup client
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 creating a backup using the backup client, the following error appears in the terminal:
1
2
3
4
5
6
7
2014-02-05 15:56:28,920 INFO Initializing
2014-02-05 15:56:30,760 INFO Contacting Bitbucket Server
2014-02-05 15:56:31,057 ERROR A backup could not be created. Reason: Lexing failed on line: 1, column: 1, while reading '<', no possible valid JSON value or punctuation could be recognized.
groovy.json.JsonException: Lexing failed on line: 1, column: 1, while reading '<', no possible valid JSON value or punctuation could be recognized.
at groovy.json.JsonLexer.nextToken(JsonLexer.java:82) ~[groovy-all-2.1.6.jar:2.1.6]
at groovy.json.JsonSlurper.parse(JsonSlurper.java:73) ~[groovy-all-2.1.6.jar:2.1.6]
... 9 more frames available in the log file
Cause
This happens if Bitbucket Server can't validate the JSON file from Bitbucket Server due to the following reasons:
If there is an Apache setup that redirects to a different port.
If you are using SSL in Bitbucket Server and the
bitbucket.baseUrl
set in the backup configurations is a non-SSL URL redirects to the SSL URL.
Workaround
Set the bitbucket.baseUrl
in the backup configurations to the original servername with the original port. For example: servername:7990
instead of servername:80
.
Was this helpful?