Unable to get a valid response from Github while adding an Linked repository
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
While trying to add a GitHub Enterprise when creating the Linked repository, a "The Server returned invalid response(not a JSON object)" error is seen in Bamboo UI.
環境
Observed on Bamboo 8.1.8, but might be applicable for any other supported versions.
診断
A simple cURL or Telnet command can help to cross-check the availability of network connection between the Bamboo server and the GitHub instance.
The test can be performed using the commands below. In the examples given below, both Successful and Unsuccessful results are given.
Unsuccessful outcome of the commands looks like below,
$ curl -i https://<Github URL>
curl: (6) Could not resolve host: github.com
または
$ telnet <Github URL> <Port>
Trying 140.82.114.4...
Successful outcome of the commands looks like below,
telnet <Github URL> <Port>
Successful Result:
Trying 140.82.114.4...
Connected to github.com.
Escape character is '^]'.
または
curl -i https://<Github URL>
Successful Result:
HTTP/2 200
server: GitHub.com
date: Tue, 08 Nov 2022 22:59:30 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Language, Accept-Encoding, Accept, X-Requested-With
content-language: en-US
etag: W/"2361a59243f4de7629d4ca75313b86b9"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
原因
2 つの原因が考えられます。
- Bamboo server might be in a Secure network (secure zone) and GitHub is not part of that same secure zone. Usually, if the user needs to be connected through a VPN to access either Github or Bamboo, this represents the Secure zone.
- A new GitHub instance is being added and it is not whitelisted in the Firewall rules.
ソリューション
Check the Network connectivity between the Bamboo and Github servers. Once you enable the network connection between both, it should work as expected.