-
Bug
-
Resolution: Unresolved
-
Minor
-
None
In the rare case when GitHub API rate limit is reached, GithubAuthenticationToken.doFinishLogin will throw exception:
INFO o.j.p.GithubAuthenticationToken#loadMyself: API rate limit reached org.kohsuke.github.HttpException: API rate limit reached at org.kohsuke.github.RateLimitHandler.onError(RateLimitHandler.java:42) at org.kohsuke.github.GitHubClient.detectKnownErrors(GitHubClient.java:417) at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:386) at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:355) at org.kohsuke.github.Requester.fetch(Requester.java:76) at org.kohsuke.github.GitHub.setMyself(GitHub.java:569) at org.kohsuke.github.GitHub.getMyself(GitHub.java:563) at org.jenkinsci.plugins.GithubAuthenticationToken.loadMyself(GithubAuthenticationToken.java:501) at org.jenkinsci.plugins.GithubAuthenticationToken.<init>(GithubAuthenticationToken.java:204) ... WARNING o.e.j.s.h.ContextHandler$Context#log: Error while serving https://REDACTED/securityRealm/finishLogin org.acegisecurity.userdetails.UsernameNotFoundException: Token not valid at org.jenkinsci.plugins.GithubAuthenticationToken.<init>(GithubAuthenticationToken.java:207) at org.jenkinsci.plugins.GithubSecurityRealm.doFinishLogin(GithubSecurityRealm.java:403) at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710) at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:398) ...
This will trigger base class exception filter handling and goes back to login URL again, which leads to another round of commenceLogin and finishLogin, over and over until GitHub stops it by asking user to re-authroize the OAuth App, or putting user on a secondary rate limit.