Наш jenkins запускает версию 2.8.3 плагина github-branch-source, и у нас есть очень большая организация github, которая случайным образом не выполняет сканирование организации с ошибкой ниже:
Could not fetch sources from navigator org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator@531ba666
java.io.FileNotFoundException: https://api.github.com/organizations/5421563/repos?per_page=100&page=8
at org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory$OkHttpURLConnection.getInputStream(ObsoleteUrlFactory.java:488)
at org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory$DelegatingHttpsURLConnection.getInputStream(ObsoleteUrlFactory.java:1201)
at org.kohsuke.github.GitHubHttpUrlConnectionClient$HttpURLConnectionResponseInfo.bodyStream(GitHubHttpUrlConnectionClient.java:197)
at org.kohsuke.github.GitHubResponse$ResponseInfo.getBodyAsString(GitHubResponse.java:321)
at org.kohsuke.github.GitHubResponse.parseBody(GitHubResponse.java:86)
at org.kohsuke.github.GitHubPageIterator.lambda$fetch$0(GitHubPageIterator.java:145)
at org.kohsuke.github.GitHubClient.createResponse(GitHubClient.java:462)
at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:413)
Caused: org.kohsuke.github.GHFileNotFoundException: https://api.github.com/organizations/5421563/repos?per_page=100&page=8 {"message":"Bad credentials","documentation_url":"https://docs.github.com/rest"}
at org.kohsuke.github.GitHubClient.interpretApiError(GitHubClient.java:493)
at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:421)
at org.kohsuke.github.GitHubPageIterator.fetch(GitHubPageIterator.java:144)
Caused: org.kohsuke.github.GHException: Failed to retrieve https://api.github.com/organizations/5421563/repos?per_page=100&page=8
at org.kohsuke.github.GitHubPageIterator.fetch(GitHubPageIterator.java:155)
at org.kohsuke.github.GitHubPageIterator.hasNext(GitHubPageIterator.java:91)
at org.kohsuke.github.PagedIterator.fetch(PagedIterator.java:106)
at org.kohsuke.github.PagedIterator.hasNext(PagedIterator.java:74)
at org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator.visitSources(GitHubSCMNavigator.java:997)
at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:489)
at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:278)
at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:970)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:428)
[Mon Aug 03 16:39:10 UTC 2020] Finished organization scan. Scan took 1 hr 4 min
FATAL: Failed to recompute children of GH-ORG-NAME
org.kohsuke.github.GHException: Failed to retrieve https://api.github.com/organizations/5421563/repos?per_page=100&page=8
at org.kohsuke.github.GitHubPageIterator.fetch(GitHubPageIterator.java:155)
at org.kohsuke.github.GitHubPageIterator.hasNext(GitHubPageIterator.java:91)
at org.kohsuke.github.PagedIterator.fetch(PagedIterator.java:106)
at org.kohsuke.github.PagedIterator.hasNext(PagedIterator.java:74)
at org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator.visitSources(GitHubSCMNavigator.java:997)
at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:489)
at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:278)
at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:970)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:428)
Caused by: org.kohsuke.github.GHFileNotFoundException: https://api.github.com/organizations/5421563/repos?per_page=100&page=8 {"message":"Bad credentials","documentation_url":"https://docs.github.com/rest"}
at org.kohsuke.github.GitHubClient.interpretApiError(GitHubClient.java:493)
at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:421)
at org.kohsuke.github.GitHubPageIterator.fetch(GitHubPageIterator.java:144)
... 10 more
Caused by: java.io.FileNotFoundException: https://api.github.com/organizations/5421563/repos?per_page=100&page=8
at org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory$OkHttpURLConnection.getInputStream(ObsoleteUrlFactory.java:488)
at org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory$DelegatingHttpsURLConnection.getInputStream(ObsoleteUrlFactory.java:1201)
at org.kohsuke.github.GitHubHttpUrlConnectionClient$HttpURLConnectionResponseInfo.bodyStream(GitHubHttpUrlConnectionClient.java:197)
at org.kohsuke.github.GitHubResponse$ResponseInfo.getBodyAsString(GitHubResponse.java:321)
at org.kohsuke.github.GitHubResponse.parseBody(GitHubResponse.java:86)
at org.kohsuke.github.GitHubPageIterator.lambda$fetch$0(GitHubPageIterator.java:145)
at org.kohsuke.github.GitHubClient.createResponse(GitHubClient.java:462)
at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:413)
... 11 more
Finished: FAILURE
Я читал об обходном пути для отключения кеша в более старых версиях, установив:
org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.cacheSize=0
Наш каталог кеша все еще заполняется, и я также видел комментарий об их установке:
GitHubServerConfig server = new GitHubServerConfig("my_github_credential_API");
server.setApiUrl(githubAPIurl)
server.setClientCacheSize(0) //<--See https://issues.jenkins-ci.org/browse/JENKINS-54126. Had to disable this one too to get this to stop happening
но я я не уверен, где это устанавливается? Возможно ли это обходное решение для версии 2.8.3?