Unable to get a valid response from Github while adding an Linked repository
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the server and data center platforms.
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.
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 184.108.40.206...
Successful outcome of the commands looks like below,
telnet <Github URL> <Port> Successful Result: Trying 220.127.116.11... 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
There are two possible causes:
- 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.