Unable to import exported Bitbucket Server projects and repositories due to SSL issue
プラットフォームについて: Data Center のみ - この記事は、Data Center プラットフォームのアトラシアン製品にのみ適用されます。
この KB は Data Center バージョンの製品用に作成されています。Data Center 固有ではない機能の Data Center KB は、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
The curl
command for importing projects and repositories into a Bitbucket Data Center instance fails and no output is provided by the command.
環境
Bitbucket Data Center version 5.14 and newer
診断
A curl
command similar to the following is run in order to start the import:
curl -s -n -u admin:secretpwd -X POST -H 'Content-type: application/json' -d '{"archivePath":"Bitbucket_export_1.tar"}' https://localhost:8443/rest/api/1.0/migration/imports | jq .
期待される結果
The command should print some output similar to the following:
{
"id": 1,
"initiator": {
"name": "admin",
"emailAddress": "admin@mybitbucket.com",
"id": 52,
"displayName": "The Admin",
"active": true,
"slug": "admin",
"type": "NORMAL",
"links": {
"self": [
{
"href": "https://localhost:8443/users/admin"
}
]
}
},
"nodeId": "aaa35131-b8cb-4ef0-9934-7dadb70d8a74",
"progress": {
"percentage": 0
},
"startDate": 1617720659322,
"state": "INITIALISING",
"type": "com.atlassian.bitbucket.migration.import",
"updateDate": 1617720659322
}
Actual result
The command produces no output.
Adding the -v
switch (to increase verbosity) to that curl
command will show this output:
curl: (60) SSL certificate problem: self signed certificate
More details here: https://curl.haxx.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
原因
The SSL certificate that Bitbucket Data Center is presenting to curl
is not trusted.
ソリューション
Ensure you are using a certificate signed by a well-known Certificate Authority so that it will be trusted automatically.
回避策
You can add the -k
parameter to the curl
command to bypass the certificate check, and prevent failure.