Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-62652

A connection to https://api.github.com/ was leaked. Did you forget to close a response body?

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • github-branch-source 2.9.1
      jenkins 2.261
      github-api 1.116.0

      Our logs are getting spammed with:
      "A connection to https://api.github.com/ was leaked. Did you forget to close a response body?"

      If I enable fine detail logging I get these stacktraces:

      Jun 10, 2020 8:03:39 AM WARNING okhttp3.internal.platform.Platform log
      A connection to https://api.github.com/ was leaked. Did you forget to close a response body?
      java.lang.Throwable: response.body().close()
      	at okhttp3.internal.platform.Platform.getStackTraceForCloseable(Platform.java:148)
      	at okhttp3.RealCall.captureCallStackTrace(RealCall.java:116)
      	at okhttp3.RealCall.execute(RealCall.java:88)
      	at org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory$OkHttpURLConnection.getResponse(ObsoleteUrlFactory.java:666)
      	at org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory$OkHttpURLConnection.getResponseCode(ObsoleteUrlFactory.java:697)
      	at org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory$DelegatingHttpsURLConnection.getResponseCode(ObsoleteUrlFactory.java:1058)
      	at org.kohsuke.github.GitHubHttpUrlConnectionClient.getResponseInfo(GitHubHttpUrlConnectionClient.java:69)
      	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:348)
      	at org.kohsuke.github.GitHubClient.fetch(GitHubClient.java:145)
      	at org.kohsuke.github.GitHubClient.checkApiUrlValidity(GitHubClient.java:279)
      	at org.kohsuke.github.GitHub.checkApiUrlValidity(GitHub.java:1088)
      	at org.jenkinsci.plugins.github_branch_source.Connector.checkApiUrlValidity(Connector.java:332)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator.visitSource(GitHubSCMNavigator.java:1082)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator.visitSources(GitHubSCMNavigator.java:902)
      	at jenkins.scm.api.SCMNavigator.visitSources(SCMNavigator.java:221)
      	at jenkins.branch.OrganizationFolder$SCMEventListenerImpl.onSCMHeadEvent(OrganizationFolder.java:1103)
      	at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:246)
      	at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:229)
      	at jenkins.scm.api.SCMEvent$Dispatcher.run(SCMEvent.java:505)
      	at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      
      Jun 10, 2020 8:03:39 AM WARNING okhttp3.internal.platform.Platform log
      A connection to https://api.github.com/ was leaked. Did you forget to close a response body?
      java.lang.Throwable: response.body().close()
      	at okhttp3.internal.platform.Platform.getStackTraceForCloseable(Platform.java:148)
      	at okhttp3.RealCall.captureCallStackTrace(RealCall.java:116)
      	at okhttp3.RealCall.execute(RealCall.java:88)
      	at org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory$OkHttpURLConnection.getResponse(ObsoleteUrlFactory.java:666)
      	at org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory$OkHttpURLConnection.getResponseCode(ObsoleteUrlFactory.java:697)
      	at org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory$DelegatingHttpsURLConnection.getResponseCode(ObsoleteUrlFactory.java:1058)
      	at org.kohsuke.github.GitHubHttpUrlConnectionClient.getResponseInfo(GitHubHttpUrlConnectionClient.java:69)
      	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:348)
      	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:312)
      	at org.kohsuke.github.GitHubClient.isPrivateModeEnabled(GitHubClient.java:631)
      	at org.kohsuke.github.GitHubClient.checkApiUrlValidity(GitHubClient.java:281)
      	at org.kohsuke.github.GitHub.checkApiUrlValidity(GitHub.java:1088)
      	at org.jenkinsci.plugins.github_branch_source.Connector.checkApiUrlValidity(Connector.java:332)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator.visitSource(GitHubSCMNavigator.java:1082)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator.visitSources(GitHubSCMNavigator.java:902)
      	at jenkins.scm.api.SCMNavigator.visitSources(SCMNavigator.java:221)
      	at jenkins.branch.OrganizationFolder$SCMEventListenerImpl.onSCMHeadEvent(OrganizationFolder.java:1103)
      	at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:246)
      	at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:229)
      	at jenkins.scm.api.SCMEvent$Dispatcher.run(SCMEvent.java:505)
      	at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      

            bitwiseman Liam Newman
            timja Tim Jacomb
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: