Details
-
Bug
-
Resolution: Fixed
-
Low
-
7.2.9, 7.4.6, 7.6.15, 8.5.6, 7.13.15
-
7.02
-
18
-
Severity 2 - Major
-
7
-
Description
Summary
DVCS: sync is broken for Github Enterprise when an organization is deleted
Steps to Reproduce
- goto Github Enterprise, create OAuth credentials for the user;
- create 2 organizations with a repo in each;
- add the organizations, one by one, to DVCS;
- goto Github Enterprise, delete an organization;
- wait until the next hourly sync
Expected Results
The sync should complete successfully
Actual Results
The sync fails and any subsequent sync jobs fail as well. The following error is thrown in atlassian-jira.log
2017-11-24 22:03:33,188 Caesium-1-3 ERROR ServiceRunner [c.a.scheduler.core.JobLauncher] Scheduled job with ID 'com.atlassian.jira.plugins.dvcs.scheduler.DvcsScheduler:job' failed com.atlassian.jira.plugins.dvcs.exception.SourceControlException: Error retrieving list of repositories at com.atlassian.jira.plugins.dvcs.spi.github.GithubCommunicator.getRepositories(GithubCommunicator.java:214) at com.atlassian.jira.plugins.dvcs.service.remote.CachingCommunicator.getRepositories(CachingCommunicator.java:126) at com.atlassian.jira.plugins.dvcs.service.RepositoryServiceImpl.syncRepositoryList(RepositoryServiceImpl.java:205) at com.atlassian.jira.plugins.dvcs.service.RepositoryServiceImpl.syncRepositoryList(RepositoryServiceImpl.java:262) at com.atlassian.jira.plugins.dvcs.scheduler.DvcsSchedulerJobRunner.syncOrganizations(DvcsSchedulerJobRunner.java:60) at com.atlassian.jira.plugins.dvcs.scheduler.DvcsSchedulerJobRunner.runJob(DvcsSchedulerJobRunner.java:51) at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:153) at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(JobLauncher.java:118) at com.atlassian.scheduler.core.JobLauncher.launch(JobLauncher.java:97) at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.launchJob(CaesiumSchedulerService.java:443) at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeClusteredJob(CaesiumSchedulerService.java:438) at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeClusteredJobWithRecoveryGuard(CaesiumSchedulerService.java:462) at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeQueuedJob(CaesiumSchedulerService.java:390) at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService$1.consume(CaesiumSchedulerService.java:285) at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService$1.consume(CaesiumSchedulerService.java:282) at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeJob(SchedulerQueueWorker.java:65) at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeNextJob(SchedulerQueueWorker.java:59) at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.run(SchedulerQueueWorker.java:34) at java.lang.Thread.run(Thread.java:748) Caused by: org.eclipse.egit.github.core.client.RequestException: Not Found (404) at org.eclipse.egit.github.core.client.GitHubClient.createException(GitHubClient.java:552) at org.eclipse.egit.github.core.client.GitHubClient.get(GitHubClient.java:740) 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.getRepositories(RepositoryService.java:242) ... 18 more
This bug is related to JSWSERVER-14268 but deals with deleted organizations rather than forked repositories.
Workaround:
- Run following SQL command and copy the values of NAME and HOST_URL fields in next steps -
If connected to Github Enterprise use this query:SELECT "NAME", "HOST_URL" FROM "AO_E8B6CC_ORGANIZATION_MAPPING" WHERE "DVCS_TYPE" = 'githube';
If connected to Github Cloud use this query:
SELECT "NAME", "HOST_URL" FROM "AO_E8B6CC_ORGANIZATION_MAPPING" WHERE "DVCS_TYPE" = 'github';
- For each record returned by above SQL command, run following curl commands using valid user credentials that have access to corresponding org/user account -
curl -u <GITHUB_USER> -H 'Accept:application/json' '<HOST_URL>/api/v3/orgs/<NAME>/repos?per_page=100&page=1'
Replace <HOST_URL> and <NAME> with values of "HOST_URL" and "NAME" fields respectively in SQL command output.
- Take any of the organizations that return the following response:
{'message': 'Not Found'}
- Validate that they do not exist on the Github Enterprise server
- Navigate to Settings >> Applications >> DVCS Accounts >> <Organization Name from step 4> ... (3-dots menu) >>> Delete
Attachments
Issue Links
- is related to
-
JSWSERVER-14268 List of repositories cannot be synchronized when parent of forked repositories is deleted
- Closed
- Mentioned in
- relates to
-
PSR-353 Loading...
(2 mentioned in, 1 relates to)