While trying to connect to Bitbucket Data Center from Sonar Application, read timed out error occurring.

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

Summary

While trying to connect to Bitbucket Data Center from the Sonar Application configured using the Sonar Integration article, read timed out error occurring:

1 2 3 [java.net.SocketTimeoutException: Read timed out, java.net.SocketTimeoutException: Read timed out, java.net.SocketTimeoutException: Read timed out] 2025.01.21 07:16:23 INFO sonarqube-64cc3505-5567-4d3c-8041-abdb94007117 web[ABCDEFXYPoay9I6PxAABB][o.s.a.c.b.BitbucketServerRestClient] Unable to contact Bitbucket server: Read timed out java.net.SocketTimeoutException: Read timed out

Environment

Tested on Bitbucket Data Center 8.9.5 and also applicable to other versions of Bitbucket Data Center.

Diagnosis

  • Perform the Test on Sonar Application UI and verify the result if it is failing or succeeding.

  • Validate whether Proxy parameters or environment variables are configured at Sonar Application configuration or relevant Load Balancer for Bitbucket endpoint.

Cause

This issue may arise if the Bitbucket Data Center endpoint is added to an incorrect environment variable NO_PROXY on the Sonar Application Server. The Sonar application does not recognize this configuration because the correct environment variable supported by the Sonar application is HTTP_NONPROXYHOSTS.

Solution

The issue should be resolved by replacing the NO_PROXY environment variable with the HTTP_NONPROXYHOSTS environment variable, including the Bitbucket endpoint, in the Sonar application.

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.