Troubleshooting connectivity problem between integration of Jira DVCS with Github
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
This article describes a problem where connectivity between Jira and github.com is not established. Jira DVCS plugin is used for integration between Jira and github.com.
Environment
Jira 9.x
Solution
Cause 1
In application logs following errors are observed
1 2 3
$ grep "Connection timed out" atlassian-jira.log 2023-07-13 12:29:27,257+0200 Caesium-1-4 INFO ServiceRunner [c.a.j.p.dvcs.service.RepositoryServiceImpl] Failed to uninstall postcommit hook for repository id 4751 (https://github.com/some-group/some-repo-1) - java.net.ConnectException: Connection timed out (Connection timed out) 2023-07-13 12:31:38,329+0200 Caesium-1-4 INFO ServiceRunner [c.a.j.p.dvcs.service.RepositoryServiceImpl] Failed to uninstall postcommit hook for repository id 6555 (https://github.com/some-group/some-repo-2) - java.net.ConnectException: Connection timed out (Connection timed out)
When we check connectivity with curl to connect to github.com from Jira node, Connection was not established and got timed out.
But when proxy was used in curl command, connection was established successfully.
1 2 3 4 5
$ curl https://github.com curl: (7) Failed to connect to github.com port 443: Connection timed out $ curl -x proxy:port -Lv https://github.com success
Cause 2
In application logs following errors are observed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
2023-07-24 13:28:16,521+0200 Caesium-1-1 WARN ServiceRunner [c.a.j.p.d.spi.github.GithubClientWithTimeout] Failed to execute request [GET /organizations/83957415/repos?per_page=100&page=26] errors: Parse exception converting JSON to object java.io.IOException: Parse exception converting JSON to object at org.eclipse.egit.github.core.client.GitHubClient.parseJson(GitHubClient.java:424) at org.eclipse.egit.github.core.client.GitHubClient.getBody(GitHubClient.java:529) ------ 2023-07-24 13:28:16,522+0200 Caesium-1-1 INFO ServiceRunner [c.a.j.p.dvcs.service.RepositorySyncServiceImpl] Fetching all remote rep ositories for organization [Some-Group] took 117s 2023-07-24 13:28:16,528+0200 Caesium-1-1 WARN ServiceRunner [c.a.j.p.dvcs.scheduler.DvcsSchedulerJobRunner] Failed to sync organizat ion [com.atlassian.jira.plugins.dvcs.model.Organization@472417a5[id=31,hostUrl=https://github.com,name=Some-Group,dvcsType=githube ,autolinkNewRepos=false,smartcommitsOnNewRepos=true,organizationUrl=https://github.com/Some-Group,repositories=<null>,credential=c om.atlassian.jira.plugins.dvcs.model.credential.ThreeLeggedOAuthCredential@9cc848d0,groups=<null>,defaultGroups=[],approvalState=APPROVE D,status=<null>]] com.atlassian.jira.plugins.dvcs.exception.SourceControlException: Error retrieving list of repositories at com.atlassian.jira.plugins.dvcs.spi.github.GithubCommunicator.getRepositories(GithubCommunicator.java:188) at com.atlassian.jira.plugins.dvcs.service.remote.CachingCommunicator.getRepositories(CachingCommunicator.java:140) at com.atlassian.jira.plugins.dvcs.service.RepositorySyncServiceImpl.getAllRemoteRepositories(RepositorySyncServiceImpl.java:285 ) at com.atlassian.jira.plugins.dvcs.service.RepositorySyncServiceImpl.reconcileRepoList(RepositorySyncServiceImpl.java:126) at com.atlassian.jira.plugins.dvcs.service.RepositorySyncServiceImpl.syncReposWithUpdates(RepositorySyncServiceImpl.java:174) at com.atlassian.jira.plugins.dvcs.scheduler.DvcsSchedulerJobRunner.lambda$syncOrganizations$1(DvcsSchedulerJobRunner.java:85) at java.base/java.util.ArrayList.forEach(Unknown Source) at com.atlassian.jira.plugins.dvcs.scheduler.DvcsSchedulerJobRunner.syncOrganizations(DvcsSchedulerJobRunner.java:82) at com.atlassian.jira.plugins.dvcs.scheduler.DvcsSchedulerJobRunner.runJob(DvcsSchedulerJobRunner.java:63) at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:134) at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(JobLauncher.java:106) at com.atlassian.scheduler.core.JobLauncher.launch(JobLauncher.java:90) at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.launchJob(CaesiumSchedulerService.java:435) at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeClusteredJob(CaesiumSchedulerService.java:430) at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeClusteredJobWithRecoveryGuard(CaesiumSchedulerService.jav a:454) at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeQueuedJob(CaesiumSchedulerService.java:382) at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeJob(SchedulerQueueWorker.java:66) at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeNextJob(SchedulerQueueWorker.java:60) at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.run(SchedulerQueueWorker.java:35) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.io.IOException: Parse exception converting JSON to object at org.eclipse.egit.github.core.client.GitHubClient.parseJson(GitHubClient.java:424) at org.eclipse.egit.github.core.client.GitHubClient.getBody(GitHubClient.java:529) at org.eclipse.egit.github.core.client.GitHubClient.get(GitHubClient.java:736) at com.atlassian.jira.plugins.dvcs.spi.github.GithubClientWithTimeout.lambda$get$0(GithubClientWithTimeout.java:67) at com.atlassian.jira.plugins.dvcs.spi.github.GithubClientWithTimeout.executeRequest(GithubClientWithTimeout.java:103) at org.eclipse.egit.github.core.client.PageIterator.next(PageIterator.java:173) at org.eclipse.egit.github.core.service.GitHubService.getAll(GitHubService.java:151) at org.eclipse.egit.github.core.service.RepositoryService.getOrgRepositories(RepositoryService.java:348) at org.eclipse.egit.github.core.service.RepositoryService.getOrgRepositories(RepositoryService.java:300) at com.atlassian.jira.plugins.dvcs.spi.github.GithubCommunicator.getRepositories(GithubCommunicator.java:178) ... 19 more Caused by: com.google.gson.JsonSyntaxException: java.net.SocketTimeoutException: Read timed out at com.google.gson.Gson.fromJson(Gson.java:804) at com.google.gson.Gson.fromJson(Gson.java:756) at org.eclipse.egit.github.core.client.GitHubClient.parseJson(GitHubClient.java:422) ... 29 more Caused by: java.net.SocketTimeoutException: Read timed out at java.base/java.net.SocketInputStream.socketRead(Unknown Source) at java.base/java.net.SocketInputStream.read(Unknown Source) at java.base/java.net.SocketInputStream.read(Unknown Source) at java.base/sun.security.ssl.SSLSocketInputRecord.read(Unknown Source) at java.base/sun.security.ssl.SSLSocketInputRecord.readFully(Unknown Source) at java.base/sun.security.ssl.SSLSocketInputRecord.decodeInputRecord(Unknown Source) at java.base/sun.security.ssl.SSLSocketInputRecord.decode(Unknown Source) at java.base/sun.security.ssl.SSLTransport.decode(Unknown Source)
Solution for Cause 1
User should try setting following JVM properties as per Setting properties and options on startup
1
2
3
4
5
-Dhttp.proxyHost=<proxyhost> -Dhttp.proxyPort=<proxyPort> -Dhttps.proxyHost=<proxyhost> -Dhttps.proxyPort=<proxyPort>
# for example
-Dhttp.proxyHost=someproxyhost.com -Dhttp.proxyPort=8080 -Dhttps.proxyHost=someproxyhost.com -Dhttps.proxyPort=8080
Solution for Cause 2
User should try setting following JVM property as per Setting properties and options on startup . It would set socket timeout to 5 minute, default is 1 minute for Github integration.
1
-Ddvcs.connector.github.socket.timeout=300000
Was this helpful?